結果

問題 No.1053 ゲーミング棒
ユーザー tamatotamato
提出日時 2020-05-15 21:47:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 517 bytes
コンパイル時間 624 ms
コンパイル使用メモリ 81,932 KB
実行使用メモリ 88,364 KB
最終ジャッジ日時 2023-10-19 13:11:35
合計ジャッジ時間 3,111 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,740 KB
testcase_01 AC 41 ms
53,740 KB
testcase_02 AC 39 ms
53,740 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 40 ms
53,740 KB
testcase_06 AC 36 ms
53,740 KB
testcase_07 AC 38 ms
53,740 KB
testcase_08 AC 38 ms
53,740 KB
testcase_09 AC 39 ms
53,740 KB
testcase_10 AC 35 ms
53,740 KB
testcase_11 AC 35 ms
53,740 KB
testcase_12 AC 35 ms
53,740 KB
testcase_13 AC 35 ms
53,740 KB
testcase_14 AC 35 ms
53,740 KB
testcase_15 AC 35 ms
53,740 KB
testcase_16 AC 35 ms
53,740 KB
testcase_17 AC 37 ms
53,740 KB
testcase_18 AC 36 ms
53,740 KB
testcase_19 AC 36 ms
53,740 KB
testcase_20 AC 38 ms
53,740 KB
testcase_21 AC 36 ms
53,740 KB
testcase_22 AC 35 ms
53,740 KB
testcase_23 AC 63 ms
88,364 KB
testcase_24 AC 63 ms
88,364 KB
testcase_25 AC 62 ms
88,364 KB
testcase_26 WA -
testcase_27 AC 35 ms
53,740 KB
testcase_28 AC 35 ms
53,740 KB
testcase_29 AC 35 ms
53,740 KB
testcase_30 AC 53 ms
79,264 KB
testcase_31 AC 53 ms
79,264 KB
testcase_32 AC 53 ms
79,264 KB
testcase_33 AC 53 ms
79,264 KB
testcase_34 AC 57 ms
79,264 KB
testcase_35 AC 54 ms
79,552 KB
testcase_36 AC 59 ms
79,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N = int(input())
    A = list(map(int, input().split()))

    AA = []
    prev = -1
    for a in A:
        if a != prev:
            AA.append(a)
        prev = a
    seen = [0] * (N+1)
    for i in range(len(AA)-1):
        a = AA[i]
        if seen[a]:
            print(-1)
            exit()
        seen[a] = 1
    if seen[AA[-1]]:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()
0