結果

問題 No.1506 Unbalanced Pocky Game
ユーザー ks2mks2m
提出日時 2021-05-14 22:20:59
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 614 bytes
コンパイル時間 2,554 ms
コンパイル使用メモリ 75,340 KB
実行使用メモリ 65,460 KB
最終ジャッジ日時 2024-04-10 00:49:07
合計ジャッジ時間 34,641 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
54,252 KB
testcase_01 AC 129 ms
54,252 KB
testcase_02 AC 129 ms
53,980 KB
testcase_03 AC 225 ms
57,516 KB
testcase_04 AC 577 ms
59,432 KB
testcase_05 AC 597 ms
59,284 KB
testcase_06 AC 500 ms
59,280 KB
testcase_07 AC 483 ms
59,188 KB
testcase_08 AC 513 ms
59,424 KB
testcase_09 AC 646 ms
59,240 KB
testcase_10 AC 655 ms
60,436 KB
testcase_11 AC 499 ms
59,256 KB
testcase_12 AC 440 ms
59,076 KB
testcase_13 AC 329 ms
59,036 KB
testcase_14 AC 450 ms
59,248 KB
testcase_15 AC 406 ms
59,204 KB
testcase_16 AC 539 ms
58,748 KB
testcase_17 AC 526 ms
59,060 KB
testcase_18 AC 434 ms
58,996 KB
testcase_19 AC 345 ms
58,944 KB
testcase_20 AC 638 ms
59,248 KB
testcase_21 AC 468 ms
59,304 KB
testcase_22 AC 545 ms
59,700 KB
testcase_23 AC 127 ms
54,204 KB
testcase_24 AC 127 ms
53,820 KB
testcase_25 AC 589 ms
63,544 KB
testcase_26 AC 781 ms
63,400 KB
testcase_27 AC 761 ms
63,368 KB
testcase_28 AC 763 ms
63,416 KB
testcase_29 AC 777 ms
63,612 KB
testcase_30 AC 764 ms
64,488 KB
testcase_31 AC 733 ms
64,420 KB
testcase_32 AC 740 ms
64,232 KB
testcase_33 AC 775 ms
63,588 KB
testcase_34 AC 728 ms
63,572 KB
testcase_35 WA -
testcase_36 AC 137 ms
54,544 KB
testcase_37 AC 173 ms
54,224 KB
testcase_38 AC 147 ms
54,336 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 163 ms
54,104 KB
testcase_42 AC 147 ms
54,144 KB
testcase_43 AC 165 ms
54,132 KB
testcase_44 AC 146 ms
54,536 KB
testcase_45 AC 137 ms
53,856 KB
testcase_46 AC 498 ms
59,428 KB
testcase_47 AC 351 ms
59,280 KB
testcase_48 AC 395 ms
59,240 KB
testcase_49 AC 580 ms
59,204 KB
testcase_50 AC 506 ms
59,548 KB
testcase_51 AC 567 ms
59,540 KB
testcase_52 AC 519 ms
59,320 KB
testcase_53 AC 593 ms
59,088 KB
testcase_54 AC 441 ms
59,328 KB
testcase_55 AC 342 ms
59,080 KB
testcase_56 AC 354 ms
58,988 KB
testcase_57 AC 517 ms
59,496 KB
testcase_58 WA -
testcase_59 AC 278 ms
58,668 KB
testcase_60 AC 449 ms
59,200 KB
testcase_61 AC 564 ms
59,192 KB
testcase_62 AC 527 ms
59,560 KB
testcase_63 AC 477 ms
59,344 KB
testcase_64 WA -
testcase_65 AC 491 ms
59,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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];
				}
			} else {
				if (!b[i + 1] && a[i] > 1) {
					b[i + 1] = !b[i + 1];
				}
			}
		}
		if (b[n]) {
			System.out.println("Alice");
		} else {
			System.out.println("Bob");
		}
	}
}
0