結果

問題 No.2666 Decreasing Modulo Nim
ユーザー ks2mks2m
提出日時 2024-03-08 22:32:41
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,010 bytes
コンパイル時間 3,561 ms
コンパイル使用メモリ 78,120 KB
実行使用メモリ 81,712 KB
最終ジャッジ日時 2024-03-08 22:33:11
合計ジャッジ時間 28,348 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
53,984 KB
testcase_01 AC 58 ms
53,980 KB
testcase_02 AC 56 ms
53,944 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 237 ms
61,848 KB
testcase_13 AC 315 ms
67,248 KB
testcase_14 AC 246 ms
62,208 KB
testcase_15 AC 617 ms
78,936 KB
testcase_16 AC 222 ms
62,692 KB
testcase_17 AC 312 ms
66,476 KB
testcase_18 AC 532 ms
77,036 KB
testcase_19 AC 346 ms
67,636 KB
testcase_20 AC 367 ms
67,692 KB
testcase_21 AC 573 ms
75,508 KB
testcase_22 AC 232 ms
62,064 KB
testcase_23 AC 230 ms
62,496 KB
testcase_24 AC 251 ms
61,900 KB
testcase_25 AC 283 ms
62,212 KB
testcase_26 AC 526 ms
77,896 KB
testcase_27 AC 361 ms
67,784 KB
testcase_28 AC 590 ms
76,436 KB
testcase_29 AC 569 ms
78,672 KB
testcase_30 AC 547 ms
75,652 KB
testcase_31 AC 403 ms
71,784 KB
testcase_32 AC 563 ms
81,712 KB
testcase_33 AC 608 ms
76,148 KB
testcase_34 AC 194 ms
61,736 KB
testcase_35 AC 561 ms
78,884 KB
testcase_36 AC 444 ms
78,704 KB
testcase_37 AC 521 ms
79,236 KB
testcase_38 AC 582 ms
75,872 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 425 ms
68,584 KB
testcase_42 AC 396 ms
67,536 KB
testcase_43 AC 58 ms
53,968 KB
testcase_44 AC 58 ms
53,984 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 593 ms
75,364 KB
testcase_48 AC 503 ms
76,228 KB
testcase_49 AC 605 ms
75,688 KB
testcase_50 AC 577 ms
76,000 KB
testcase_51 AC 610 ms
75,980 KB
testcase_52 AC 496 ms
75,764 KB
testcase_53 AC 425 ms
75,604 KB
testcase_54 AC 460 ms
75,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;
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));
		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();

		Set<Integer> set1 = new HashSet<>();
		Set<Integer> set2 = new HashSet<>();
		for (int i = 0; i < n; i++) {
			int v1 = a[i] / m;
			int v2 = a[i] % m;
			if (set1.contains(v1)) {
				set1.remove(v1);
			} else {
				set1.add(v1);
			}
			if (set2.contains(v2)) {
				set2.remove(v2);
			} else {
				set2.add(v2);
			}
		}
		set1.remove(0);
		set2.remove(0);
		if (set1.isEmpty() && set2.isEmpty()) {
			System.out.println("Bob");
		} else {
			System.out.println("Alice");
		}
	}
}
0