結果
| 問題 |
No.1053 ゲーミング棒
|
| コンテスト | |
| ユーザー |
👑 Kazun
|
| 提出日時 | 2021-02-26 02:22:37 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 95 ms / 2,000 ms |
| コード長 | 241 bytes |
| コンパイル時間 | 445 ms |
| コンパイル使用メモリ | 81,664 KB |
| 実行使用メモリ | 119,040 KB |
| 最終ジャッジ日時 | 2024-10-01 18:34:25 |
| 合計ジャッジ時間 | 3,094 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
N=int(input())
A=list(map(int,input().split()))
B=[A[0]]
a=A[0]
for x in A[1:]:
if a!=x:
a=x
B.append(a)
if len(B)==len(set(B)):
print(0)
elif len(B)==len(set(B))+1 and B[0]==B[-1]:
print(1)
else:
print(-1)
Kazun