Submission #1380108
Source Code Expand
import java.util.Scanner; public class Main { static Scanner in = new Scanner(System.in); public static void main(String[] args) { char[] ac = in.nextLine().toCharArray(), bc = in.nextLine().toCharArray(), cc = in.nextLine().toCharArray(); int a = 0, b = 0, c = 0; char w = 'a'; while (true) { switch (w) { case 'a': if (a == ac.length) { System.out.println("A"); return; } w = ac[a++]; break; case 'b': if (b == bc.length) { System.out.println("B"); return; } w = bc[b++]; break; case 'c': if (c == cc.length) { System.out.println("C"); return; } w = cc[c++]; break; } } } }
Submission Info
Submission Time | |
---|---|
Task | B - Card Game for Three (ABC Edit) |
User | mosmos21 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 200 |
Code Size | 1040 Byte |
Status | AC |
Exec Time | 91 ms |
Memory | 21972 KB |
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 | 88 ms | 19796 KB |
02.txt | AC | 89 ms | 20692 KB |
03.txt | AC | 90 ms | 21204 KB |
04.txt | AC | 89 ms | 19924 KB |
05.txt | AC | 89 ms | 18772 KB |
06.txt | AC | 88 ms | 18900 KB |
07.txt | AC | 88 ms | 21972 KB |
08.txt | AC | 88 ms | 19796 KB |
09.txt | AC | 88 ms | 19796 KB |
10.txt | AC | 91 ms | 18900 KB |
sample_01.txt | AC | 87 ms | 19796 KB |
sample_02.txt | AC | 89 ms | 19924 KB |