Submission #63505456


Source Code Expand

Copy
#include<bits/stdc++.h>
#define int long long
using namespace std;
stack<int> s;
int q,op,x;
signed main(){
for(int i=1;i<=100;i++) s.push(0);
cin>>q;
while(q--){
cin>>op;
if(op==1){
cin>>x;
s.push(x);
}
else{
cout<<s.top()<<"\n";
s.pop();
}
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include<bits/stdc++.h>
#define int long long
using namespace std;
stack<int> s;
int q,op,x;
signed main(){
	for(int i=1;i<=100;i++) s.push(0);
	cin>>q;
	while(q--){
		cin>>op;
		if(op==1){
			cin>>x;
			s.push(x);
		}
		else{
			cout<<s.top()<<"\n";
			s.pop();
		}
	}
}

Submission Info

Submission Time
Task B - Card Pile
User Fengjunning
Language C++ 17 (gcc 12.2)
Score 200
Code Size 290 Byte
Status AC
Exec Time 1 ms
Memory 3668 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 23
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt
All 00_sample_00.txt, 00_sample_01.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3608 KB
00_sample_01.txt AC 1 ms 3480 KB
01_handmade_00.txt AC 1 ms 3452 KB
01_handmade_01.txt AC 1 ms 3536 KB
01_handmade_02.txt AC 1 ms 3480 KB
01_handmade_03.txt AC 1 ms 3532 KB
01_handmade_04.txt AC 1 ms 3476 KB
01_handmade_05.txt AC 1 ms 3528 KB
02_random_00.txt AC 1 ms 3488 KB
02_random_01.txt AC 1 ms 3472 KB
02_random_02.txt AC 1 ms 3488 KB
02_random_03.txt AC 1 ms 3476 KB
02_random_04.txt AC 1 ms 3380 KB
02_random_05.txt AC 1 ms 3400 KB
02_random_06.txt AC 1 ms 3404 KB
02_random_07.txt AC 1 ms 3484 KB
02_random_08.txt AC 1 ms 3484 KB
02_random_09.txt AC 1 ms 3480 KB
02_random_10.txt AC 1 ms 3536 KB
02_random_11.txt AC 1 ms 3468 KB
02_random_12.txt AC 1 ms 3480 KB
02_random_13.txt AC 1 ms 3668 KB
02_random_14.txt AC 1 ms 3532 KB


2025-04-05 (Sat)
21:49:00 +00:00