Submission #26223


ソースコード

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
#include<bits/stdc++.h>
using namespace std;
int main(){
queue<string>gate1;
queue<string>gate2;
string syori,inm,temp;
while(1){
cin >> syori;
if(syori=="exit") break;
cin >> inm;
if(syori=="push") gate1.push(inm);
if(syori=="out"){
if(inm=="1"){
temp=gate1.front();
gate1.pop();
gate2.push(temp);
}else if(inm=="2"){
if(gate2.empty()) continue;
gate2.pop();
}
}
}
puts("1");
while(!gate1.empty()){
temp=gate1.front();
gate1.pop();
cout << temp << endl;
}
puts("2");
while(!gate2.empty()){
temp=gate2.front();
gate2.pop();
cout << temp << endl;
}
return 0;
}

ステータス

項目 データ
問題 0826 - Kitty!
ユーザー名 ei1711
投稿日時 2017-09-05 11:52:06
言語 C++11
状態 Accepted
得点 1
ソースコード長 858 Byte
最大実行時間 2 ms
最大メモリ使用量 0 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Kitty AC 2 ms 0 KB
1