結果
| 問題 |
No.1053 ゲーミング棒
|
| コンテスト | |
| ユーザー |
kurimupy
|
| 提出日時 | 2020-06-12 22:28:39 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 532 bytes |
| コンパイル時間 | 311 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 24,372 KB |
| 最終ジャッジ日時 | 2024-06-24 05:19:42 |
| 合計ジャッジ時間 | 3,567 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 WA * 3 |
ソースコード
# problem 1
N = int(input())
K = list(map(int, input().split()))
d = []
d.append(K[0])
for i in range(1, N):
if K[i] == d[-1]:
pass
else:
d.append(K[i])
ALL = len(d)
# 施行は行われても一回までである
if d[0] == d[-1]:
if len(d) == 0:
print(0)
exit()
else:
del d[0]
if len(d) == len(set(d)):
print(1)
else:
print(-1)
exit()
else:
if ALL == len(set(d)):
print(0)
else:
print(-1)
exit()
kurimupy