結果

問題 No.1506 Unbalanced Pocky Game
ユーザー ks2mks2m
提出日時 2021-05-14 22:23:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 797 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 2,141 ms
コンパイル使用メモリ 74,544 KB
実行使用メモリ 64,428 KB
最終ジャッジ日時 2024-04-10 00:52:15
合計ジャッジ時間 33,636 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
54,124 KB
testcase_01 AC 128 ms
54,012 KB
testcase_02 AC 127 ms
54,156 KB
testcase_03 AC 229 ms
57,472 KB
testcase_04 AC 569 ms
59,372 KB
testcase_05 AC 616 ms
59,656 KB
testcase_06 AC 526 ms
59,096 KB
testcase_07 AC 448 ms
59,044 KB
testcase_08 AC 524 ms
59,384 KB
testcase_09 AC 588 ms
59,704 KB
testcase_10 AC 608 ms
60,260 KB
testcase_11 AC 459 ms
59,276 KB
testcase_12 AC 442 ms
59,236 KB
testcase_13 AC 329 ms
59,068 KB
testcase_14 AC 456 ms
59,164 KB
testcase_15 AC 414 ms
59,200 KB
testcase_16 AC 546 ms
58,956 KB
testcase_17 AC 473 ms
59,264 KB
testcase_18 AC 438 ms
59,212 KB
testcase_19 AC 346 ms
58,760 KB
testcase_20 AC 620 ms
60,444 KB
testcase_21 AC 439 ms
59,044 KB
testcase_22 AC 533 ms
59,228 KB
testcase_23 AC 130 ms
53,992 KB
testcase_24 AC 130 ms
54,316 KB
testcase_25 AC 700 ms
63,772 KB
testcase_26 AC 749 ms
63,712 KB
testcase_27 AC 796 ms
63,824 KB
testcase_28 AC 754 ms
63,532 KB
testcase_29 AC 765 ms
63,584 KB
testcase_30 AC 746 ms
64,428 KB
testcase_31 AC 797 ms
63,572 KB
testcase_32 AC 723 ms
64,320 KB
testcase_33 AC 781 ms
63,616 KB
testcase_34 AC 658 ms
63,408 KB
testcase_35 AC 725 ms
63,460 KB
testcase_36 AC 143 ms
54,540 KB
testcase_37 AC 171 ms
54,680 KB
testcase_38 AC 141 ms
54,404 KB
testcase_39 AC 142 ms
54,336 KB
testcase_40 AC 139 ms
54,264 KB
testcase_41 AC 155 ms
54,560 KB
testcase_42 AC 156 ms
53,960 KB
testcase_43 AC 160 ms
54,144 KB
testcase_44 AC 142 ms
54,344 KB
testcase_45 AC 139 ms
54,088 KB
testcase_46 AC 555 ms
59,220 KB
testcase_47 AC 323 ms
58,588 KB
testcase_48 AC 398 ms
59,436 KB
testcase_49 AC 558 ms
59,284 KB
testcase_50 AC 550 ms
59,652 KB
testcase_51 AC 569 ms
59,512 KB
testcase_52 AC 530 ms
59,440 KB
testcase_53 AC 582 ms
59,640 KB
testcase_54 AC 437 ms
59,360 KB
testcase_55 AC 353 ms
59,460 KB
testcase_56 AC 351 ms
59,184 KB
testcase_57 AC 520 ms
59,556 KB
testcase_58 AC 349 ms
59,036 KB
testcase_59 AC 286 ms
58,800 KB
testcase_60 AC 464 ms
59,376 KB
testcase_61 AC 548 ms
59,564 KB
testcase_62 AC 504 ms
59,232 KB
testcase_63 AC 448 ms
59,140 KB
testcase_64 AC 591 ms
59,548 KB
testcase_65 AC 477 ms
59,516 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 (!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