Submission #1675483
Source Code Expand
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int A = sc.nextInt(); int B = sc.nextInt(); String S = sc.next(); int passed = 0; int passedFore = 1; for(int i = 0 ; i < n ; i++) { if(S.charAt(i) == 'a') { if(passed < A + B) { passed++; System.out.println("Yes"); } else { System.out.println("No"); } } else if(S.charAt(i) == 'b') { if(passed < A + B && passedFore <= B) { passedFore++; passed++; System.out.println("Yes"); } else { System.out.println("No"); } } else { System.out.println("No"); } } } }
Submission Info
Submission Time | |
---|---|
Task | B - Qualification simulator |
User | kouta1612 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 200 |
Code Size | 731 Byte |
Status | AC |
Exec Time | 657 ms |
Memory | 34976 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, s1.txt, s2.txt, s3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 655 ms | 34664 KB |
02.txt | AC | 656 ms | 34780 KB |
03.txt | AC | 634 ms | 30344 KB |
04.txt | AC | 639 ms | 34800 KB |
05.txt | AC | 593 ms | 34188 KB |
06.txt | AC | 652 ms | 34568 KB |
07.txt | AC | 640 ms | 34976 KB |
08.txt | AC | 624 ms | 31384 KB |
09.txt | AC | 639 ms | 34112 KB |
10.txt | AC | 657 ms | 33152 KB |
s1.txt | AC | 95 ms | 22996 KB |
s2.txt | AC | 96 ms | 21204 KB |
s3.txt | AC | 96 ms | 19284 KB |