結果
| 問題 | No.1053 ゲーミング棒 |
| コンテスト | |
| ユーザー |
googol_S0
|
| 提出日時 | 2020-05-15 21:34:32 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 74 ms / 2,000 ms |
| + 588µs | |
| コード長 | 323 bytes |
| 記録 | |
| コンパイル時間 | 474 ms |
| コンパイル使用メモリ | 14,464 KB |
| 実行使用メモリ | 24,980 KB |
| 最終ジャッジ日時 | 2026-10-15 17:32:56 |
| 合計ジャッジ時間 | 3,782 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 |
ソースコード
N=int(input())
A=list(map(int,input().split()))
B=[False]*N
P=0
if len(set(A))==1:
print(0)
exit()
if A[0]==A[-1]:
for i in range(N-1,-1,-1):
if A[0]==A[i]:
del A[i]
else:
break
P=1
for i in range(len(A)-1):
B[A[i]-1]=True
if B[A[i+1]-1] and (A[i]!=A[i+1]):
print(-1)
exit()
print(P)
googol_S0