結果
| 問題 |
No.1053 ゲーミング棒
|
| コンテスト | |
| ユーザー |
hir355
|
| 提出日時 | 2020-05-15 21:35:10 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 350 bytes |
| コンパイル時間 | 142 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 20,772 KB |
| 最終ジャッジ日時 | 2024-09-19 09:18:27 |
| 合計ジャッジ時間 | 2,792 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 WA * 5 |
ソースコード
n = int(input())
a = list(map(int, input().split()))
idx = 0
while idx < n and a[idx] == a[-1]:
a.append(a[0])
idx += 1
s = set([a[idx]])
for i in range(idx, n - 1 + idx):
if a[i] != a[i + 1]:
if a[i + 1] in s:
print(-1)
break
else:
if idx == 0 or idx == n:
print(0)
else:
print(1)
hir355