結果
| 問題 |
No.1053 ゲーミング棒
|
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2021-10-06 09:21:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 132 ms / 2,000 ms |
| コード長 | 398 bytes |
| コンパイル時間 | 218 ms |
| コンパイル使用メモリ | 82,564 KB |
| 実行使用メモリ | 108,460 KB |
| 最終ジャッジ日時 | 2024-07-23 02:41:42 |
| 合計ジャッジ時間 | 4,010 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
import collections
import itertools
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
va = len(CA)
GR = itertools.groupby(A+A)
L = []
for k,v in GR:
L.append(len(list(v)))
AL = list(itertools.accumulate(L))+[0]
if AL[va-1]>=N:
print(0)
else:
for i in range(len(L)-va):
if AL[i+va-1]-AL[i-1]>=N:
print(1)
exit()
print(-1)
H20