結果
| 問題 |
No.2813 Cookie
|
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2024-07-19 22:02:08 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 946 bytes |
| コンパイル時間 | 3,122 ms |
| コンパイル使用メモリ | 77,780 KB |
| 実行使用メモリ | 45,948 KB |
| 最終ジャッジ日時 | 2024-07-19 22:02:20 |
| 合計ジャッジ時間 | 11,609 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 WA * 25 |
ソースコード
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
PrintWriter pw = new PrintWriter(System.out);
for (int z = 0; z < t; z++) {
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]);
}
Set<Integer> set = new HashSet<>();
for (int i = 0; i < n; i++) {
if (a[i] % 2 == 0) {
a[i]--;
}
if (set.contains(a[i])) {
set.remove(a[i]);
} else {
set.add(a[i]);
}
}
if (set.isEmpty()) {
pw.println("Bob");
} else {
pw.println("Alice");
}
}
pw.flush();
br.close();
}
}
ks2m