Submission #40071


ソースコード

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
#include <iostream>
#include <stack>
#include <string>
#define endl '\n'
int main()
{
std::stack<int> S;
std::string command;
int n;
std::cin.tie(0);
std::ios::sync_with_stdio(false);
while(std::cin >> command, command != "exit") {
if (command == "push") {
std::cin >> n;
S.push(n);
}
else if (command == "top") {
std::cout << S.top() << endl;
}
else {
S.pop();
}
}
}

ステータス

項目 データ
問題 0600 - プログラミング入門:Stack
ユーザー名 Arumakan_ei1727
投稿日時 2018-07-27 21:19:23
言語 C++11
状態 Accepted
得点 1
ソースコード長 525 Byte
最大実行時間 187 ms
最大メモリ使用量 19796 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 43 ms 476 KB
1
Input02 AC 23 ms 696 KB
1
Input03 AC 22 ms 652 KB
1
Input04 AC 44 ms 596 KB
1
Input05 AC 37 ms 664 KB
1
Input06 AC 40 ms 1236 KB
1
Input07 AC 34 ms 2128 KB
1
Input08 AC 61 ms 4852 KB
1
Input09 AC 152 ms 11084 KB
1
Input10 AC 187 ms 19796 KB
1