ログインしてください。
提出 #23678936
ソースコード 拡げる
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int a = Integer.parseInt(sc.next());
int b = Integer.parseInt(sc.next()); // Yesになる海外学生
int p = a + b; // 定員
String s = sc.next();
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == 'a') {
if (0 < p) {
System.out.println("Yes");
p--;
} else {
System.out.println("No");
}
} else if (s.charAt(i) == 'b') {
if (0 < p && 0 < b) {
System.out.println("Yes");
p--;
b--;
} else {
System.out.println("No");
}
} else if (s.charAt(i) == 'c') {
System.out.println("No");
}
}
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Qualification simulator |
| ユーザ | tobi00604 |
| 言語 | Java (OpenJDK 11.0.6) |
| 得点 | 200 |
| コード長 | 779 Byte |
| 結果 | AC |
| 実行時間 | 645 ms |
| メモリ | 51716 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01.txt | AC | 626 ms | 48468 KiB |
| 02.txt | AC | 641 ms | 50312 KiB |
| 03.txt | AC | 631 ms | 50380 KiB |
| 04.txt | AC | 628 ms | 49376 KiB |
| 05.txt | AC | 589 ms | 48460 KiB |
| 06.txt | AC | 634 ms | 50112 KiB |
| 07.txt | AC | 628 ms | 51716 KiB |
| 08.txt | AC | 645 ms | 50148 KiB |
| 09.txt | AC | 634 ms | 50348 KiB |
| 10.txt | AC | 639 ms | 49980 KiB |
| s1.txt | AC | 101 ms | 35296 KiB |
| s2.txt | AC | 115 ms | 35392 KiB |
| s3.txt | AC | 105 ms | 35436 KiB |