UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#188308#3362. 签到题sumeru100941ms1304kbC++11491b2023-10-03 08:38:542023-10-03 12:02:11

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
queue<ll> q;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll t;
	cin>>t;
	for(int i=1;i<=t;i++)
	{
		string s;
		cin>>s;
		if(s[2]=='S')
		{
			ll temp;
			cin>>temp;
			q.push(temp);
		}
		else if(s[2]=='P')
		{
			if(q.empty())cout<<"ERROR!\n";
			else q.pop();
		}
		else
		{
			if(q.empty())cout<<"ERROR!\n";
			else cout<<q.front()<<"\n";
		}
	}
	return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 10
Accepted
time: 188ms
memory: 1296kb

input:

1000000
POP
QUERY
PUSH 309365360
POP
PUSH 199989283
QUERY
QUERY
PUSH 426129435
QUERY
QUERY
POP
POP
P...

output:

ERROR!
ERROR!
199989283
199989283
199989283
199989283
ERROR!
ERROR!
ERROR!
ERROR!
ERROR!
670617789
6...

result:

ok 333547 lines

Test #2:

score: 10
Accepted
time: 0ms
memory: 1280kb

input:

1000
PUSH 988230049
POP
QUERY
QUERY
PUSH 756384264
PUSH 475755011
PUSH 796369883
PUSH 570561132
PUSH...

output:

ERROR!
ERROR!
756384264
756384264
475755011
588509151
856803961
218518770
101998041
101998041
940337...

result:

ok 376 lines

Test #3:

score: 10
Accepted
time: 0ms
memory: 1276kb

input:

1000
POP
QUERY
PUSH 241930825
QUERY
POP
POP
PUSH 472761151
PUSH 877848433
QUERY
POP
POP
QUERY
PUSH 3...

output:

ERROR!
ERROR!
241930825
ERROR!
472761151
ERROR!
ERROR!
ERROR!
ERROR!
ERROR!
861469058
138600146
1386...

result:

ok 352 lines

Test #4:

score: 10
Accepted
time: 0ms
memory: 1276kb

input:

1000
QUERY
POP
QUERY
PUSH 249939428
PUSH 52380350
PUSH 465251810
PUSH 734617051
QUERY
PUSH 459553719...

output:

ERROR!
ERROR!
ERROR!
249939428
249939428
249939428
977811790
413512379
413512379
50593172
50593172
5...

result:

ok 350 lines

Test #5:

score: 10
Accepted
time: 0ms
memory: 1276kb

input:

1000
QUERY
QUERY
QUERY
QUERY
PUSH 849412139
POP
PUSH 368858122
POP
QUERY
POP
PUSH 370154366
PUSH 689...

output:

ERROR!
ERROR!
ERROR!
ERROR!
ERROR!
ERROR!
689793445
122079564
ERROR!
ERROR!
ERROR!
849866440
8498664...

result:

ok 344 lines

Test #6:

score: 10
Accepted
time: 0ms
memory: 1284kb

input:

1000
QUERY
PUSH 382379904
POP
POP
QUERY
PUSH 307724811
QUERY
QUERY
POP
PUSH 814704179
QUERY
POP
POP
...

output:

ERROR!
ERROR!
ERROR!
307724811
307724811
814704179
ERROR!
ERROR!
ERROR!
908282704
908282704
63410573...

result:

ok 382 lines

Test #7:

score: 10
Accepted
time: 193ms
memory: 1304kb

input:

1000000
PUSH 248977493
PUSH 675561091
QUERY
QUERY
POP
QUERY
PUSH 101472384
POP
POP
QUERY
POP
PUSH 48...

output:

248977493
248977493
675561091
ERROR!
ERROR!
489211421
489211421
830805513
830805513
699334872
842492...

result:

ok 333541 lines

Test #8:

score: 10
Accepted
time: 193ms
memory: 1300kb

input:

1000000
PUSH 652152756
QUERY
POP
POP
QUERY
PUSH 794581491
QUERY
QUERY
PUSH 198565134
POP
PUSH 634933...

output:

652152756
ERROR!
ERROR!
794581491
794581491
198565134
ERROR!
ERROR!
ERROR!
ERROR!
ERROR!
ERROR!
ERRO...

result:

ok 333475 lines

Test #9:

score: 10
Accepted
time: 177ms
memory: 1292kb

input:

1000000
POP
QUERY
PUSH 459285888
QUERY
PUSH 316620231
PUSH 806052043
POP
POP
POP
PUSH 225673213
POP
...

output:

ERROR!
ERROR!
459285888
ERROR!
ERROR!
ERROR!
ERROR!
ERROR!
ERROR!
ERROR!
ERROR!
ERROR!
180302100
ERR...

result:

ok 333781 lines

Test #10:

score: 10
Accepted
time: 190ms
memory: 1296kb

input:

1000000
POP
PUSH 577769465
PUSH 228236795
QUERY
PUSH 367637907
QUERY
QUERY
PUSH 926762347
QUERY
QUER...

output:

ERROR!
577769465
577769465
577769465
577769465
577769465
577769465
577769465
367637907
367637907
367...

result:

ok 335167 lines

Extra Test:

score: 0
Extra Test Passed