結果

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

ソースコード

diff #

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

index=[]
prev=A[0]
for i in range(len(A)):
    if prev !=A[i]:
        if A[i] in index:
            print(-1)
            exit()
        else:
            prev=A[i]
            index.append(A[i])

if A[0] != A[-1]:
    print(0)
else:
    print(1)
exit()
0