結果

問題 No.1506 Unbalanced Pocky Game
ユーザー ks2mks2m
提出日時 2021-05-14 22:18:11
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 536 bytes
コンパイル時間 2,471 ms
コンパイル使用メモリ 74,308 KB
実行使用メモリ 65,524 KB
最終ジャッジ日時 2024-04-10 00:42:59
合計ジャッジ時間 30,760 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
54,296 KB
testcase_01 AC 117 ms
54,488 KB
testcase_02 AC 122 ms
54,396 KB
testcase_03 AC 214 ms
57,336 KB
testcase_04 AC 511 ms
59,136 KB
testcase_05 AC 459 ms
59,204 KB
testcase_06 AC 475 ms
59,340 KB
testcase_07 AC 423 ms
58,968 KB
testcase_08 AC 470 ms
61,240 KB
testcase_09 AC 542 ms
60,148 KB
testcase_10 AC 544 ms
60,332 KB
testcase_11 AC 399 ms
59,200 KB
testcase_12 AC 414 ms
59,336 KB
testcase_13 AC 303 ms
58,940 KB
testcase_14 WA -
testcase_15 AC 327 ms
57,996 KB
testcase_16 AC 548 ms
59,176 KB
testcase_17 AC 442 ms
59,328 KB
testcase_18 AC 323 ms
57,928 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 107 ms
52,844 KB
testcase_24 AC 118 ms
54,016 KB
testcase_25 AC 620 ms
63,540 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 671 ms
63,368 KB
testcase_29 AC 683 ms
63,516 KB
testcase_30 WA -
testcase_31 AC 705 ms
63,712 KB
testcase_32 WA -
testcase_33 AC 684 ms
63,492 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 142 ms
54,068 KB
testcase_37 WA -
testcase_38 AC 145 ms
54,220 KB
testcase_39 WA -
testcase_40 AC 125 ms
54,124 KB
testcase_41 WA -
testcase_42 AC 144 ms
54,236 KB
testcase_43 AC 144 ms
54,268 KB
testcase_44 AC 132 ms
54,484 KB
testcase_45 AC 127 ms
54,268 KB
testcase_46 AC 513 ms
59,600 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 489 ms
59,552 KB
testcase_50 WA -
testcase_51 WA -
testcase_52 AC 500 ms
59,584 KB
testcase_53 WA -
testcase_54 AC 368 ms
59,372 KB
testcase_55 AC 312 ms
59,252 KB
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 AC 382 ms
59,292 KB
testcase_61 WA -
testcase_62 WA -
testcase_63 AC 412 ms
59,540 KB
testcase_64 AC 494 ms
59,372 KB
testcase_65 WA -
権限があれば一括ダウンロードができます

ソースコード

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];
				}
			}
		}
		if (b[n]) {
			System.out.println("Alice");
		} else {
			System.out.println("Bob");
		}
	}
}
0