Submission #37277


ソースコード

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 <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main(){
int list[1000001];
int index = 0;
char com[5];
scanf("%s", com);
while (strcmp("exit", com)) {
if(!strcmp("push", com)) {
int n;
scanf("%d", &n);
list[index++] = n;
}
else if(!strcmp("top", com)) {
printf("%d\n", list[index-1]);
}
else {
index--;
}
scanf("%s",com);
}
return 0;
}

ステータス

項目 データ
問題 0600 - プログラミング入門:Stack
ユーザー名 r1825
投稿日時 2018-06-14 06:34:26
言語 C
状態 Accepted
得点 1
ソースコード長 439 Byte
最大実行時間 189 ms
最大メモリ使用量 20604 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 45 ms 380 KB
1
Input02 AC 21 ms 392 KB
1
Input03 AC 22 ms 436 KB
1
Input04 AC 31 ms 612 KB
1
Input05 AC 32 ms 556 KB
1
Input06 AC 40 ms 1076 KB
1
Input07 AC 39 ms 1944 KB
1
Input08 AC 62 ms 4784 KB
1
Input09 AC 165 ms 12168 KB
1
Input10 AC 189 ms 20604 KB
1