結果

問題 No.1053 ゲーミング棒
ユーザー 👑 H20H20
提出日時 2021-10-06 09:21:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 164 ms / 2,000 ms
コード長 398 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 110,044 KB
最終ジャッジ日時 2023-09-30 08:38:54
合計ジャッジ時間 6,244 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,600 KB
testcase_01 AC 89 ms
71,724 KB
testcase_02 AC 85 ms
71,972 KB
testcase_03 AC 91 ms
71,648 KB
testcase_04 AC 87 ms
71,872 KB
testcase_05 AC 83 ms
71,740 KB
testcase_06 AC 86 ms
71,796 KB
testcase_07 AC 85 ms
71,688 KB
testcase_08 AC 84 ms
71,976 KB
testcase_09 AC 85 ms
71,544 KB
testcase_10 AC 85 ms
71,548 KB
testcase_11 AC 83 ms
71,832 KB
testcase_12 AC 87 ms
71,688 KB
testcase_13 AC 86 ms
72,016 KB
testcase_14 AC 84 ms
71,800 KB
testcase_15 AC 84 ms
71,524 KB
testcase_16 AC 85 ms
71,864 KB
testcase_17 AC 83 ms
71,660 KB
testcase_18 AC 84 ms
71,968 KB
testcase_19 AC 85 ms
72,016 KB
testcase_20 AC 83 ms
71,540 KB
testcase_21 AC 85 ms
71,804 KB
testcase_22 AC 84 ms
71,832 KB
testcase_23 AC 160 ms
109,976 KB
testcase_24 AC 163 ms
110,044 KB
testcase_25 AC 158 ms
110,032 KB
testcase_26 AC 164 ms
110,028 KB
testcase_27 AC 85 ms
71,720 KB
testcase_28 AC 86 ms
71,548 KB
testcase_29 AC 85 ms
71,700 KB
testcase_30 AC 117 ms
105,636 KB
testcase_31 AC 121 ms
103,608 KB
testcase_32 AC 121 ms
104,272 KB
testcase_33 AC 118 ms
101,392 KB
testcase_34 AC 120 ms
102,140 KB
testcase_35 AC 118 ms
99,424 KB
testcase_36 AC 121 ms
102,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0