Submission #1520703
Source Code Expand
#include <vector> #include <queue> #include <algorithm> #include <iostream> #include <string> #include <ctime> #include <map> #include <stack> #include <sstream> using namespace std; int main(void) { queue <char> s1, s2, s3; char temp; while (1) { scanf("%c", &temp); if (temp == '\n') { break; } s1.push(temp); } while (1) { scanf("%c", &temp); if (temp == '\n') { break; } s2.push(temp); } while (1) { scanf("%c", &temp); if (temp == '\n') { break; } s3.push(temp); } char card = 'a'; while (1) { if (card == 'a') { if (s1.empty()) { cout << 'A' << endl; break; } card = s1.front(); s1.pop(); } else if (card == 'b') { if (s2.empty()) { cout << 'B' << endl; break; } card = s2.front(); s2.pop(); } else if (card == 'c') { if (s3.empty()) { cout << 'C' << endl; break; } card = s3.front(); s3.pop(); } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Card Game for Three (ABC Edit) |
User | joker_x |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1048 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:19:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%c", &temp); ^ ./Main.cpp:29:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%c", &temp); ^ ./Main.cpp:39:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%c", &temp); ^
Judge Result
Set Name | Sample | All | ||
---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||
Status | AC |
|
Set Name | Test Cases |
---|---|
Sample | |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample_01.txt, sample_02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 1 ms | 256 KB |
02.txt | AC | 1 ms | 256 KB |
03.txt | AC | 1 ms | 256 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | AC | 1 ms | 256 KB |
06.txt | AC | 1 ms | 256 KB |
07.txt | AC | 1 ms | 256 KB |
08.txt | AC | 1 ms | 256 KB |
09.txt | AC | 1 ms | 256 KB |
10.txt | AC | 1 ms | 256 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |