Submission #00056


ソースコード

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
43
44
45
46
47
#include<algorithm>
#include<iostream>
#include<math.h>
#include<stdio.h>
#include<vector>
#include<limits.h>
#include<string>
#include<queue>
#include<stack>
#include<deque>
#include<set>
#include<map>
#define endl "\n"
using namespace std;
int main(){
int n;
cin >> n;
queue<int>d;
int a;
cin >> a;
for( int i = 0; i < n; i++){
int x;
cin >> x;
if( x == 1 ){
d.push(x);
}else if( x == 2 ){
if( d.size() >= 1 ){
d.pop();
} else{
}
}if( x == 3 ){
int b = d.size();
cout << b << endl;
d.pop();
}else if( x == 4 ){
if( a >= 0 ){
cout << d.size() << endl;
}else{
cout << "-1" << endl;
}
}
}
return(0);
}

ステータス

項目 データ
問題 0002 - 行列のできる喫茶店
ユーザー名 kamba
投稿日時 2024-07-08 17:38:51
言語 C++17
状態 Wrong Answer
得点 0
ソースコード長 811 Byte
最大実行時間 191 ms
最大メモリ使用量 668 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in1.txt AC 25 ms 476 KB
1
in2.txt WA 22 ms 572 KB
1
in3.txt WA 23 ms 668 KB
1
in4.txt RE 191 ms 640 KB
1
in5.txt RE 29 ms 608 KB
1
in6.txt RE 28 ms 580 KB
1