結果

問題 No.1053 ゲーミング棒
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2020-05-15 21:33:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 300 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 81,760 KB
実行使用メモリ 96,484 KB
最終ジャッジ日時 2023-10-19 13:09:06
合計ジャッジ時間 3,158 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,480 KB
testcase_01 AC 39 ms
53,480 KB
testcase_02 AC 39 ms
53,480 KB
testcase_03 AC 39 ms
53,480 KB
testcase_04 AC 39 ms
53,480 KB
testcase_05 AC 38 ms
53,480 KB
testcase_06 AC 38 ms
53,480 KB
testcase_07 AC 39 ms
53,480 KB
testcase_08 AC 39 ms
53,480 KB
testcase_09 AC 39 ms
53,480 KB
testcase_10 AC 40 ms
53,480 KB
testcase_11 AC 40 ms
53,480 KB
testcase_12 AC 39 ms
53,480 KB
testcase_13 AC 39 ms
53,480 KB
testcase_14 AC 39 ms
53,480 KB
testcase_15 AC 39 ms
53,480 KB
testcase_16 AC 39 ms
53,480 KB
testcase_17 AC 39 ms
53,480 KB
testcase_18 AC 39 ms
53,480 KB
testcase_19 AC 38 ms
53,480 KB
testcase_20 AC 39 ms
53,480 KB
testcase_21 AC 39 ms
53,480 KB
testcase_22 AC 39 ms
53,480 KB
testcase_23 AC 80 ms
96,484 KB
testcase_24 AC 78 ms
96,484 KB
testcase_25 AC 79 ms
96,484 KB
testcase_26 AC 78 ms
96,484 KB
testcase_27 AC 39 ms
53,484 KB
testcase_28 AC 38 ms
53,484 KB
testcase_29 AC 39 ms
53,484 KB
testcase_30 AC 58 ms
78,732 KB
testcase_31 AC 59 ms
78,732 KB
testcase_32 AC 58 ms
78,732 KB
testcase_33 AC 58 ms
78,732 KB
testcase_34 AC 59 ms
78,732 KB
testcase_35 AC 60 ms
79,192 KB
testcase_36 AC 60 ms
79,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

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

dic = {}

import sys
for i in range(N):

    if A[i] != A[i-1]:

        if A[i] in dic:
            print (-1)
            sys.exit()

        dic[A[i]] = 1

if len(dic) <= 1:
    print (0)
elif A[0] == A[-1]:
    print (1)
else:
    print (0)
0