結果
問題 |
No.1053 ゲーミング棒
|
ユーザー |
![]() |
提出日時 | 2020-06-03 20:26:44 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 122 ms / 2,000 ms |
コード長 | 450 bytes |
コンパイル時間 | 331 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 20,680 KB |
最終ジャッジ日時 | 2024-11-25 10:14:49 |
合計ジャッジ時間 | 3,172 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
N = int(input()) A = [int(a) for a in input().split()] newA = [A[0]] for i in range(1, N): if newA[-1] == A[i]: continue newA.append(A[i]) N = len(newA) ans = 0 num = [0]*(max(newA)+1) for i in range(N): if num[newA[i]] == 0: num[newA[i]] += 1 elif newA[i-1] == newA[i]: num[newA[i]] += 1 elif i == N-1 and newA[0] == newA[i] and N > 1: ans = 1 else: ans = -1 break print(ans)