結果
問題 | No.1053 ゲーミング棒 |
ユーザー |
![]() |
提出日時 | 2024-11-16 15:35:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 71 ms / 2,000 ms |
コード長 | 341 bytes |
コンパイル時間 | 395 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 80,512 KB |
最終ジャッジ日時 | 2024-11-16 15:35:47 |
合計ジャッジ時間 | 3,150 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
N = int(input()) A = list(map(int,input().split())) X = [0] * (N + 1) start = A[0] for i in range(N - 1): if A[i] != A[i+1]: if X[A[i]] == 1: print(-1) exit() else: X[A[i]] = 1 if X[A[N - 1]] == 0: print(0) else: if A[0] == A[N-1]: print(1) else: print(-1)