Submission #38662


ソースコード

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
#include<cstdio>
#include<iostream>
#include<cmath>
#include<stack>
#include<queue>
#include<algorithm>
#include<vector>
#include<string.h>
using namespace std;
int main(){
stack<int>stk;
string s;
int a;
while(1){
cin>>s;
if(s=="exit") break;
else if(s=="push"){
scanf("%d",&a);
stk.push(a);
}else if(s=="top"){
printf("%d\n",stk.top());
}else if(s=="pop"){
stk.pop();
}
}
return 0;
}

ステータス

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

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 20 ms 480 KB
1
Input02 AC 21 ms 588 KB
1
Input03 AC 20 ms 432 KB
1
Input04 AC 26 ms 536 KB
1
Input05 AC 27 ms 508 KB
1
Input06 AC 50 ms 592 KB
1
Input07 AC 83 ms 744 KB
1
Input08 AC 208 ms 1444 KB
1
Input09 AC 430 ms 2708 KB
1
Input10 AC 626 ms 4148 KB
1