結果
| 問題 | No.1053 ゲーミング棒 |
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2020-05-15 21:33:06 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
RE
不安定
|
| 実行時間 | - |
| コード長 | 457 bytes |
| 記録 | |
| コンパイル時間 | 287 ms |
| コンパイル使用メモリ | 21,464 KB |
| 実行使用メモリ | 23,700 KB |
| 最終ジャッジ日時 | 2026-08-30 23:17:00 |
| 合計ジャッジ時間 | 5,955 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 RE * 2 |
ソースコード
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline
n,*a = list(map(int,read().split()))
res = [0]*(10**5+3)
now = 10**6
two = 0
for i in a:
if i != now:
res[i] += 1
if res[i]==2: two += 1
now = i
if two >= 2:
print(-1)
elif two == 1:
if a[0] == a[-1] == res.index(2):
print(1)
else:
print(-1)
elif two==0:
print(0)
#print(res[:5],two)
convexineq