Submission #63505231
Source Code Expand
Copy
#include<iostream>#include<stack>using namespace std;stack<int> st;int main(){int q;cin>>q;for(int i=1;i<=100;i++){st.push(0);}while(q--){int f;cin>>f;if(f==1){int x;cin>>x;st.push(x);}if(f==2){cout<<st.top()<<endl;st.pop();
#include<iostream> #include<stack> using namespace std; stack<int> st; int main(){ int q; cin>>q; for(int i=1;i<=100;i++){ st.push(0); } while(q--){ int f; cin>>f; if(f==1){ int x; cin>>x; st.push(x); } if(f==2){ cout<<st.top()<<endl; st.pop(); } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Card Pile |
User | xy0906 |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 320 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3652 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
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 | 3436 KB |
00_sample_01.txt | AC | 1 ms | 3452 KB |
01_handmade_00.txt | AC | 1 ms | 3492 KB |
01_handmade_01.txt | AC | 1 ms | 3436 KB |
01_handmade_02.txt | AC | 1 ms | 3360 KB |
01_handmade_03.txt | AC | 1 ms | 3432 KB |
01_handmade_04.txt | AC | 1 ms | 3524 KB |
01_handmade_05.txt | AC | 1 ms | 3528 KB |
02_random_00.txt | AC | 1 ms | 3496 KB |
02_random_01.txt | AC | 1 ms | 3532 KB |
02_random_02.txt | AC | 1 ms | 3448 KB |
02_random_03.txt | AC | 1 ms | 3492 KB |
02_random_04.txt | AC | 1 ms | 3488 KB |
02_random_05.txt | AC | 1 ms | 3404 KB |
02_random_06.txt | AC | 1 ms | 3456 KB |
02_random_07.txt | AC | 1 ms | 3528 KB |
02_random_08.txt | AC | 1 ms | 3452 KB |
02_random_09.txt | AC | 1 ms | 3456 KB |
02_random_10.txt | AC | 1 ms | 3480 KB |
02_random_11.txt | AC | 1 ms | 3528 KB |
02_random_12.txt | AC | 1 ms | 3344 KB |
02_random_13.txt | AC | 1 ms | 3652 KB |
02_random_14.txt | AC | 1 ms | 3444 KB |