結果

問題 No.1053 ゲーミング棒
ユーザー c-yan
提出日時 2020-05-15 22:02:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 260 bytes
コンパイル時間 714 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 25,368 KB
最終ジャッジ日時 2024-09-19 10:31:40
合計ジャッジ時間 2,731 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

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

d = {}
prev = ''
for a in A:
    if prev != a:
        d.setdefault(a, 0)
        d[a] += 1

t = len([i for i in d.values() if i >= 2])
if t >= 2:
    print(-1)
elif t >= 1:
    print(1)
else:
    print(0)
0