Submission #54894


ソースコード

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
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define int long long
using pii = pair<int,int>;
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = 1000000007;
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
string s;
queue<int> que;
while(true){
cin >> s;
if(s == "exit") return 0;
else if(s == "push"){
int a;
cin >> a;
que.emplace(a);
}
else if(s == "front"){
cout << que.front() << '\n';
}
else que.pop();
}
return 0;
}

ステータス

項目 データ
問題 0601 - プログラミング入門:Queue
ユーザー名 ei1903
投稿日時 2019-09-16 09:16:34
言語 C++14
状態 Accepted
得点 1
ソースコード長 697 Byte
最大実行時間 125 ms
最大メモリ使用量 6000 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 29 ms 604 KB
1
Input02 AC 23 ms 556 KB
1
Input03 AC 24 ms 636 KB
1
Input04 AC 23 ms 712 KB
1
Input05 AC 26 ms 636 KB
1
Input06 AC 25 ms 808 KB
1
Input07 AC 32 ms 1100 KB
1
Input08 AC 57 ms 2240 KB
1
Input09 AC 92 ms 4024 KB
1
Input10 AC 125 ms 6000 KB
1