結果

問題 No.1506 Unbalanced Pocky Game
ユーザー ripityripity
提出日時 2021-12-13 21:04:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 680 ms / 2,000 ms
コード長 574 bytes
コンパイル時間 4,279 ms
コンパイル使用メモリ 71,920 KB
実行使用メモリ 66,404 KB
最終ジャッジ日時 2023-09-30 02:28:11
合計ジャッジ時間 32,500 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,728 KB
testcase_01 AC 120 ms
56,028 KB
testcase_02 AC 121 ms
55,856 KB
testcase_03 AC 225 ms
58,928 KB
testcase_04 AC 476 ms
62,048 KB
testcase_05 AC 530 ms
61,616 KB
testcase_06 AC 427 ms
61,052 KB
testcase_07 AC 374 ms
60,732 KB
testcase_08 AC 410 ms
60,396 KB
testcase_09 AC 530 ms
62,052 KB
testcase_10 AC 537 ms
62,328 KB
testcase_11 AC 376 ms
60,504 KB
testcase_12 AC 355 ms
60,220 KB
testcase_13 AC 286 ms
60,240 KB
testcase_14 AC 372 ms
60,716 KB
testcase_15 AC 363 ms
60,840 KB
testcase_16 AC 529 ms
61,092 KB
testcase_17 AC 392 ms
60,648 KB
testcase_18 AC 333 ms
60,196 KB
testcase_19 AC 312 ms
59,960 KB
testcase_20 AC 548 ms
61,496 KB
testcase_21 AC 368 ms
60,404 KB
testcase_22 AC 430 ms
60,440 KB
testcase_23 AC 122 ms
55,752 KB
testcase_24 AC 121 ms
56,224 KB
testcase_25 AC 589 ms
64,984 KB
testcase_26 AC 648 ms
64,632 KB
testcase_27 AC 652 ms
64,856 KB
testcase_28 AC 655 ms
64,628 KB
testcase_29 AC 651 ms
64,676 KB
testcase_30 AC 680 ms
66,404 KB
testcase_31 AC 665 ms
64,608 KB
testcase_32 AC 677 ms
64,508 KB
testcase_33 AC 676 ms
64,996 KB
testcase_34 AC 646 ms
65,072 KB
testcase_35 AC 663 ms
64,892 KB
testcase_36 AC 137 ms
55,508 KB
testcase_37 AC 168 ms
55,972 KB
testcase_38 AC 137 ms
55,880 KB
testcase_39 AC 136 ms
55,892 KB
testcase_40 AC 131 ms
55,900 KB
testcase_41 AC 148 ms
56,212 KB
testcase_42 AC 153 ms
56,016 KB
testcase_43 AC 142 ms
56,140 KB
testcase_44 AC 135 ms
56,136 KB
testcase_45 AC 129 ms
56,416 KB
testcase_46 AC 440 ms
60,564 KB
testcase_47 AC 306 ms
60,188 KB
testcase_48 AC 339 ms
60,576 KB
testcase_49 AC 475 ms
62,372 KB
testcase_50 AC 475 ms
62,196 KB
testcase_51 AC 486 ms
60,264 KB
testcase_52 AC 428 ms
60,912 KB
testcase_53 AC 519 ms
60,140 KB
testcase_54 AC 350 ms
60,028 KB
testcase_55 AC 311 ms
59,932 KB
testcase_56 AC 312 ms
60,440 KB
testcase_57 AC 450 ms
58,740 KB
testcase_58 AC 312 ms
60,152 KB
testcase_59 AC 271 ms
60,356 KB
testcase_60 AC 374 ms
62,452 KB
testcase_61 AC 439 ms
58,772 KB
testcase_62 AC 411 ms
60,444 KB
testcase_63 AC 374 ms
60,000 KB
testcase_64 AC 464 ms
60,360 KB
testcase_65 AC 392 ms
60,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];
        String[] ans = {"Bob","Alice"};
        for( int i = 0; i < N; i++ ) {
            A[i] = sc.nextInt();
        }
        
        for( int i = N-1; i >= 0; i-- ) {
            if( A[i] != 1 ) {
                System.out.println(ans[(N-i)%2]);
                return;
            }
        }
        
        System.out.println(ans[N%2]);
        
    }
    
}
0