結果
| 問題 |
No.1053 ゲーミング棒
|
| コンテスト | |
| ユーザー |
nephrologist
|
| 提出日時 | 2020-05-15 22:16:36 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 352 bytes |
| コンパイル時間 | 87 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 23,668 KB |
| 最終ジャッジ日時 | 2024-09-19 10:55:54 |
| 合計ジャッジ時間 | 2,751 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 1 WA * 33 |
ソースコード
n=int(input())
if n==1:
print(0)
exit()
A=list(map(int,input().split()))
pre=-1
kouho=set()
out=[]
for i in range(n):
if A[i]==pre:
continue
if A[i] in kouho:
out.append(A[i])
kouho.add(A[i])
pre=A[i]
if not out:
if len(out)==1 and A[0]==A[-1]:
print(1)
else:
print(-1)
else:
print(0)
nephrologist