Submission #63518558
Source Code Expand
Copy
#include<iostream>#include<iostream>#include<string>#include<vector>#include<queue>#include<cmath>#include<algorithm>#include<map>using namespace std;using ll = long long;int main() {int q;cin >> q;vector<int> a(100);for (int i = 0; i < 100; i++) {a[i] = 0;}vector<int> s;for (int i = 0; i < q; i++) {
#include<iostream> #include<iostream> #include<string> #include<vector> #include<queue> #include<cmath> #include<algorithm> #include<map> using namespace std; using ll = long long; int main() { int q; cin >> q; vector<int> a(100); for (int i = 0; i < 100; i++) { a[i] = 0; } vector<int> s; for (int i = 0; i < q; i++) { int x; cin >> x; if (x == 1) { int y; cin >> y; a.push_back(y); } else if (x == 2) { s.push_back(a.back()); a.pop_back(); } } if (s.size() > 0) { for (int i = 0; i < s.size(); i++) { cout << s[i] << endl; } } }
Submission Info
Submission Time | |
---|---|
Task | B - Card Pile |
User | ryota20080628 |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 616 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3672 KB |
Compile Error
Main.cpp: In function ‘int main()’: Main.cpp:35:35: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 35 | for (int i = 0; i < s.size(); i++) { | ~~^~~~~~~~~~
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 | 3476 KB |
00_sample_01.txt | AC | 1 ms | 3448 KB |
01_handmade_00.txt | AC | 1 ms | 3468 KB |
01_handmade_01.txt | AC | 1 ms | 3608 KB |
01_handmade_02.txt | AC | 1 ms | 3472 KB |
01_handmade_03.txt | AC | 1 ms | 3532 KB |
01_handmade_04.txt | AC | 1 ms | 3616 KB |
01_handmade_05.txt | AC | 1 ms | 3672 KB |
02_random_00.txt | AC | 1 ms | 3472 KB |
02_random_01.txt | AC | 1 ms | 3540 KB |
02_random_02.txt | AC | 1 ms | 3540 KB |
02_random_03.txt | AC | 1 ms | 3432 KB |
02_random_04.txt | AC | 1 ms | 3496 KB |
02_random_05.txt | AC | 1 ms | 3544 KB |
02_random_06.txt | AC | 1 ms | 3608 KB |
02_random_07.txt | AC | 1 ms | 3544 KB |
02_random_08.txt | AC | 1 ms | 3452 KB |
02_random_09.txt | AC | 1 ms | 3536 KB |
02_random_10.txt | AC | 1 ms | 3476 KB |
02_random_11.txt | AC | 1 ms | 3612 KB |
02_random_12.txt | AC | 1 ms | 3400 KB |
02_random_13.txt | AC | 1 ms | 3540 KB |
02_random_14.txt | AC | 1 ms | 3528 KB |