Submission #1725907
Source Code Expand
import java.util.*; 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 str = sc.next(); int cntA=0, cntB=0, passed=0, rankB=0; for (char c : str.toCharArray()) { if (c == 'a') { cntA++; } if (c == 'b') { cntB++; } if (c == 'c') { System.out.println("No"); continue; } if (c == 'a') { if (passed < a+b) { System.out.println("Yes"); passed++; } else { System.out.println("No"); } } if (c == 'b') { rankB++; if (passed < a+b && rankB <= b) { System.out.println("Yes"); passed++; } else { System.out.println("No"); } } } } }
Submission Info
Submission Time | |
---|---|
Task | B - Qualification simulator |
User | shirishdwa |
Language | Java8 (OpenJDK 1.8.0) |
Score | 200 |
Code Size | 1120 Byte |
Status | AC |
Exec Time | 639 ms |
Memory | 34920 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 | 633 ms | 32856 KB |
02.txt | AC | 627 ms | 34920 KB |
03.txt | AC | 633 ms | 32980 KB |
04.txt | AC | 622 ms | 34912 KB |
05.txt | AC | 567 ms | 34180 KB |
06.txt | AC | 617 ms | 33156 KB |
07.txt | AC | 639 ms | 33864 KB |
08.txt | AC | 632 ms | 33568 KB |
09.txt | AC | 636 ms | 33428 KB |
10.txt | AC | 626 ms | 34128 KB |
s1.txt | AC | 95 ms | 19412 KB |
s2.txt | AC | 98 ms | 19924 KB |
s3.txt | AC | 95 ms | 21716 KB |