結果
| 問題 |
No.2666 Decreasing Modulo Nim
|
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2024-03-08 22:39:30 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 297 ms / 2,000 ms |
| コード長 | 720 bytes |
| コンパイル時間 | 2,954 ms |
| コンパイル使用メモリ | 74,532 KB |
| 実行使用メモリ | 71,744 KB |
| 最終ジャッジ日時 | 2024-09-29 20:07:56 |
| 合計ジャッジ時間 | 16,476 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 55 |
ソースコード
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));
String[] sa = br.readLine().split(" ");
int n = Integer.parseInt(sa[0]);
int m = Integer.parseInt(sa[1]);
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 x1 = 0;
int x2 = 0;
for (int i = 0; i < n; i++) {
int v1 = a[i] / m;
int v2 = a[i] % m;
x1 ^= v1;
x2 ^= v2;
}
if (x1 == 0 && x2 == 0) {
System.out.println("Bob");
} else {
System.out.println("Alice");
}
}
}
ks2m