Submission #40103


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <stack>
#include <cstring>
using namespace std;
stack<int>st;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
char command[5];
cin >> command;
while ( strcmp("exit", command) ) {
if ( !strcmp("push", command) ) {
int a;
cin >> a;
st.push(a);
}
else if ( !strcmp("top", command) ) {
cout << st.top() << "\n";
}
else {
st.pop();
}
cin >> command;
}
return 0;
}

ステータス

項目 データ
問題 0600 - プログラミング入門:Stack
ユーザー名 r1825
投稿日時 2018-07-29 10:36:18
言語 C++11
状態 Accepted
得点 1
ソースコード長 588 Byte
最大実行時間 149 ms
最大メモリ使用量 4192 KB

セット

セット 得点 Cases
1 ALL 1 / 1 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 32 ms 480 KB
1
Input02 AC 22 ms 444 KB
1
Input03 AC 22 ms 400 KB
1
Input04 AC 27 ms 480 KB
1
Input05 AC 26 ms 420 KB
1
Input06 AC 38 ms 732 KB
1
Input07 AC 56 ms 984 KB
1
Input08 AC 59 ms 1532 KB
1
Input09 AC 105 ms 2776 KB
1
Input10 AC 149 ms 4192 KB
1