結果
| 問題 | No.1506 Unbalanced Pocky Game |
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2021-05-14 22:18:11 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 536 bytes |
| 記録 | |
| コンパイル時間 | 3,508 ms |
| コンパイル使用メモリ | 85,252 KB |
| 実行使用メモリ | 57,036 KB |
| 最終ジャッジ日時 | 2026-09-08 11:35:08 |
| 合計ジャッジ時間 | 24,478 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 WA * 26 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = sc.nextInt();
}
sc.close();
boolean[] b = new boolean[n + 1];
for (int i = 0; i < n; i++) {
b[i + 1] = !b[i];
if (i % 2 == 1) {
if (a[i] > 1) {
b[i + 1] = !b[i + 1];
}
}
}
if (b[n]) {
System.out.println("Alice");
} else {
System.out.println("Bob");
}
}
}
ks2m