Submission #38587


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<bits/stdc++.h>
using namespace std;
int main(){
string e="exit",pu="push",t="top",po="pop",s;
stack<int> st;
int n;
while(0==0){
cin>>s;
if(s==e)break;
if(s==pu){
scanf("%d",&n);
st.push(n);
}
if(s==t){
printf("%d\n",st.top());
}
if(s==po){
st.pop();
}
}
return(0);
}

ステータス

項目 データ
問題 0600 - プログラミング入門:Stack
ユーザー名 珈琲の素材は虚数渦動
投稿日時 2018-07-11 17:18:39
言語 C++11
状態 Accepted
得点 1
ソースコード長 365 Byte
最大実行時間 611 ms
最大メモリ使用量 4144 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 24 ms 480 KB
1
Input02 AC 21 ms 456 KB
1
Input03 AC 23 ms 560 KB
1
Input04 AC 21 ms 532 KB
1
Input05 AC 36 ms 372 KB
1
Input06 AC 51 ms 580 KB
1
Input07 AC 85 ms 856 KB
1
Input08 AC 210 ms 1432 KB
1
Input09 AC 415 ms 2700 KB
1
Input10 AC 611 ms 4144 KB
1