結果
問題 |
No.1053 ゲーミング棒
|
ユーザー |
![]() |
提出日時 | 2020-06-12 22:30:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 97 ms / 2,000 ms |
コード長 | 532 bytes |
コンパイル時間 | 102 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 24,364 KB |
最終ジャッジ日時 | 2024-06-24 05:21:03 |
合計ジャッジ時間 | 2,895 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
# 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) == 1: 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()