Submission #40112


ソースコード

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
32
33
34
35
36
37
38
39
40
41
42
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd( ll x, ll y );
ll lcm( ll x, ll y );
int main()
{
queue<int> que;
int data;
string operation;
cin >> operation;
while ( operation != "exit" ) {
if ( operation == "push") {
scanf("%d", &data );
que.push( data );
} else if ( operation == "front" ) {
printf("%d\n", que.front() );
} else if ( operation == "pop" ) {
que.pop();
}
cin >> operation;
}
return 0;
}
ll gcd( ll x, ll y )
{
if ( y == 0 ) return x;
return gcd( y, x % y );
}
ll lcm( ll x, ll y )
{
return x / gcd( x, y ) * y;
}

ステータス

項目 データ
問題 0601 - プログラミング入門:Queue
ユーザー名 ei1711
投稿日時 2018-07-29 20:02:43
言語 C++11
状態 Accepted
得点 1
ソースコード長 740 Byte
最大実行時間 654 ms
最大メモリ使用量 4220 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 31 ms 480 KB
1
Input02 AC 32 ms 464 KB
1
Input03 AC 21 ms 572 KB
1
Input04 AC 32 ms 416 KB
1
Input05 AC 28 ms 640 KB
1
Input06 AC 88 ms 724 KB
1
Input07 AC 91 ms 744 KB
1
Input08 AC 244 ms 1440 KB
1
Input09 AC 456 ms 2656 KB
1
Input10 AC 654 ms 4220 KB
1