結果

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

ソースコード

diff #

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

tmp = A[0]
st = {tmp}
ans = 0
for a in A:
    if a != tmp:
        tmp = a
        if ans:
            print(-1)
            break
        elif tmp in st:
            if a == A[0]:
                ans = 1
        else:
            st.add(tmp)
else:
    print(ans)
0