結果
| 問題 | No.2059 Odd Move Nim |
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2022-08-26 21:50:33 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 240 ms / 2,000 ms |
| コード長 | 580 bytes |
| 記録 | |
| コンパイル時間 | 2,304 ms |
| コンパイル使用メモリ | 81,432 KB |
| 実行使用メモリ | 67,316 KB |
| 最終ジャッジ日時 | 2026-05-04 05:07:24 |
| 合計ジャッジ時間 | 5,678 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 |
ソースコード
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
String[] sa = br.readLine().split(" ");
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = Integer.parseInt(sa[i]);
}
br.close();
int x = 0;
for (int i = 1; i < n; i += 2) {
x ^= a[i];
}
if (x == 0) {
System.out.println("Bob");
} else {
System.out.println("Alice");
}
}
}
ks2m