結果

問題 No.1053 ゲーミング棒
ユーザー hir355hir355
提出日時 2020-05-15 21:35:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 350 bytes
コンパイル時間 643 ms
コンパイル使用メモリ 11,764 KB
実行使用メモリ 21,512 KB
最終ジャッジ日時 2023-10-19 13:10:52
合計ジャッジ時間 2,840 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,016 KB
testcase_01 AC 31 ms
10,016 KB
testcase_02 AC 29 ms
10,016 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 32 ms
10,016 KB
testcase_06 AC 27 ms
10,016 KB
testcase_07 AC 27 ms
10,016 KB
testcase_08 AC 27 ms
10,016 KB
testcase_09 AC 27 ms
10,016 KB
testcase_10 AC 27 ms
10,016 KB
testcase_11 AC 27 ms
10,016 KB
testcase_12 AC 27 ms
10,016 KB
testcase_13 AC 28 ms
10,016 KB
testcase_14 AC 30 ms
10,016 KB
testcase_15 AC 27 ms
10,016 KB
testcase_16 AC 28 ms
10,016 KB
testcase_17 AC 28 ms
10,016 KB
testcase_18 AC 28 ms
10,016 KB
testcase_19 AC 28 ms
10,016 KB
testcase_20 AC 28 ms
10,016 KB
testcase_21 AC 28 ms
10,016 KB
testcase_22 AC 27 ms
10,016 KB
testcase_23 AC 85 ms
21,512 KB
testcase_24 AC 84 ms
21,512 KB
testcase_25 AC 85 ms
21,512 KB
testcase_26 WA -
testcase_27 AC 29 ms
10,016 KB
testcase_28 AC 28 ms
10,016 KB
testcase_29 AC 28 ms
10,016 KB
testcase_30 AC 99 ms
11,812 KB
testcase_31 AC 83 ms
11,812 KB
testcase_32 AC 100 ms
11,812 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 76 ms
16,548 KB
testcase_36 AC 78 ms
17,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
idx = 0
while idx < n and a[idx] == a[-1]:
    a.append(a[0])
    idx += 1
s = set([a[idx]])
for i in range(idx, n - 1 + idx):
    if a[i] != a[i + 1]:
        if a[i + 1] in s:
            print(-1)
            break
else:
    if idx == 0 or idx == n:
        print(0)
    else:
        print(1)
0