結果

問題 No.1053 ゲーミング棒
ユーザー 👑 KazunKazun
提出日時 2021-02-26 02:22:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 82,088 KB
実行使用メモリ 120,020 KB
最終ジャッジ日時 2024-04-09 18:30:30
合計ジャッジ時間 3,046 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,408 KB
testcase_01 AC 37 ms
51,756 KB
testcase_02 AC 36 ms
53,008 KB
testcase_03 AC 36 ms
52,272 KB
testcase_04 AC 35 ms
52,568 KB
testcase_05 AC 36 ms
52,120 KB
testcase_06 AC 36 ms
52,392 KB
testcase_07 AC 36 ms
53,372 KB
testcase_08 AC 37 ms
52,552 KB
testcase_09 AC 36 ms
52,744 KB
testcase_10 AC 37 ms
52,908 KB
testcase_11 AC 36 ms
53,540 KB
testcase_12 AC 37 ms
52,584 KB
testcase_13 AC 36 ms
52,360 KB
testcase_14 AC 36 ms
52,616 KB
testcase_15 AC 36 ms
52,440 KB
testcase_16 AC 36 ms
52,532 KB
testcase_17 AC 36 ms
53,132 KB
testcase_18 AC 36 ms
52,036 KB
testcase_19 AC 36 ms
52,772 KB
testcase_20 AC 35 ms
52,028 KB
testcase_21 AC 37 ms
52,272 KB
testcase_22 AC 37 ms
52,508 KB
testcase_23 AC 78 ms
104,204 KB
testcase_24 AC 79 ms
104,660 KB
testcase_25 AC 90 ms
120,020 KB
testcase_26 AC 89 ms
119,620 KB
testcase_27 AC 36 ms
52,396 KB
testcase_28 AC 36 ms
53,540 KB
testcase_29 AC 36 ms
52,476 KB
testcase_30 AC 54 ms
79,676 KB
testcase_31 AC 55 ms
79,476 KB
testcase_32 AC 54 ms
77,976 KB
testcase_33 AC 56 ms
78,596 KB
testcase_34 AC 56 ms
78,668 KB
testcase_35 AC 57 ms
79,980 KB
testcase_36 AC 56 ms
79,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

B=[A[0]]
a=A[0]
for x in A[1:]:
    if a!=x:
        a=x
        B.append(a)


if len(B)==len(set(B)):
    print(0)
elif len(B)==len(set(B))+1 and B[0]==B[-1]:
    print(1)
else:
    print(-1)
0