Submission #63503186
Source Code Expand
Copy
#include <bits/stdc++.h>using namespace std;#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);typedef long long ll;typedef long double ld;typedef pair<int,int> pii;#define F first#define S second#define PB push_back#define MP make_pairconst ll mod = 1e9+7, N = 2e6+7, M = 2e6+7, INF = INT_MAX/10;ll powe(ll x, ll y){ x = x%mod, y=y%(mod-1);ll ans = 1;while(y>0){if (y&1){ans = (1ll * x * ans)%mod;}y>>=1;x = (1ll * x * x)%mod;}return ans;}void solve() {int q;cin >> q;stack<int> stk;for(int i=1;i<=100;i++)stk.push(0);while(q--) {
#include <bits/stdc++.h> using namespace std; #define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); typedef long long ll;typedef long double ld;typedef pair<int,int> pii; #define F first #define S second #define PB push_back #define MP make_pair const ll mod = 1e9+7, N = 2e6+7, M = 2e6+7, INF = INT_MAX/10; ll powe(ll x, ll y){ x = x%mod, y=y%(mod-1);ll ans = 1;while(y>0){if (y&1){ans = (1ll * x * ans)%mod;}y>>=1;x = (1ll * x * x)%mod;}return ans;} void solve() { int q; cin >> q; stack<int> stk; for(int i=1;i<=100;i++) stk.push(0); while(q--) { int t,x; cin >> t; if (t==1) { cin >> x; stk.push(x); } else { cout << stk.top() << "\n"; stk.pop(); } } } signed main() { fast; int t=1; while(t--){ solve(); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Card Pile |
User | Ord1n_at_ry |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 924 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3616 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 | 3524 KB |
00_sample_01.txt | AC | 1 ms | 3420 KB |
01_handmade_00.txt | AC | 1 ms | 3536 KB |
01_handmade_01.txt | AC | 1 ms | 3428 KB |
01_handmade_02.txt | AC | 1 ms | 3492 KB |
01_handmade_03.txt | AC | 1 ms | 3512 KB |
01_handmade_04.txt | AC | 1 ms | 3480 KB |
01_handmade_05.txt | AC | 1 ms | 3480 KB |
02_random_00.txt | AC | 1 ms | 3456 KB |
02_random_01.txt | AC | 1 ms | 3528 KB |
02_random_02.txt | AC | 1 ms | 3428 KB |
02_random_03.txt | AC | 1 ms | 3484 KB |
02_random_04.txt | AC | 1 ms | 3356 KB |
02_random_05.txt | AC | 1 ms | 3472 KB |
02_random_06.txt | AC | 1 ms | 3460 KB |
02_random_07.txt | AC | 1 ms | 3616 KB |
02_random_08.txt | AC | 1 ms | 3524 KB |
02_random_09.txt | AC | 1 ms | 3424 KB |
02_random_10.txt | AC | 1 ms | 3536 KB |
02_random_11.txt | AC | 1 ms | 3412 KB |
02_random_12.txt | AC | 1 ms | 3480 KB |
02_random_13.txt | AC | 1 ms | 3492 KB |
02_random_14.txt | AC | 1 ms | 3528 KB |