結果

問題 No.1211 円環はお断り
ユーザー titiatitia
提出日時 2020-08-30 17:34:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 602 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 81,816 KB
実行使用メモリ 119,064 KB
最終ジャッジ日時 2024-04-27 12:11:41
合計ジャッジ時間 23,554 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
54,212 KB
testcase_01 AC 33 ms
52,528 KB
testcase_02 AC 33 ms
52,528 KB
testcase_03 AC 33 ms
52,672 KB
testcase_04 AC 37 ms
52,884 KB
testcase_05 AC 34 ms
53,108 KB
testcase_06 AC 33 ms
54,072 KB
testcase_07 AC 45 ms
63,440 KB
testcase_08 AC 34 ms
53,368 KB
testcase_09 AC 43 ms
65,348 KB
testcase_10 AC 42 ms
61,804 KB
testcase_11 AC 48 ms
65,220 KB
testcase_12 AC 41 ms
59,152 KB
testcase_13 AC 868 ms
93,904 KB
testcase_14 WA -
testcase_15 AC 668 ms
99,680 KB
testcase_16 AC 1,489 ms
111,808 KB
testcase_17 AC 114 ms
77,264 KB
testcase_18 AC 644 ms
96,652 KB
testcase_19 AC 231 ms
76,900 KB
testcase_20 AC 136 ms
77,728 KB
testcase_21 AC 232 ms
77,668 KB
testcase_22 AC 830 ms
94,148 KB
testcase_23 AC 1,015 ms
97,184 KB
testcase_24 AC 840 ms
87,180 KB
testcase_25 AC 85 ms
76,340 KB
testcase_26 AC 886 ms
103,260 KB
testcase_27 AC 744 ms
87,376 KB
testcase_28 AC 837 ms
103,344 KB
testcase_29 AC 978 ms
96,808 KB
testcase_30 AC 1,331 ms
103,748 KB
testcase_31 AC 581 ms
85,652 KB
testcase_32 AC 1,853 ms
110,292 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 AC 704 ms
112,448 KB
testcase_39 AC 706 ms
112,632 KB
testcase_40 AC 79 ms
108,084 KB
testcase_41 AC 35 ms
53,504 KB
testcase_42 AC 33 ms
54,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
import bisect

N,K=map(int,input().split())
A=list(map(int,input().split()))

OK=0
NG=sum(A)//K+1
B=A*3
SUM=[0]
for a in B:
    SUM.append(SUM[-1]+a)

while NG-OK>1:
    mid=(OK+NG)//2

    flag=0
    for start in range(min(N//K+5,N%K+5)):
        if start>N:
            break
        G=0
        now=start

        for j in range(K):
            now=bisect.bisect_left(SUM,SUM[now]+mid)
            if now>start+N:
                break
        if now<=start+N:
            flag=1
            break

    if flag:
        OK=mid
    else:
        NG=mid
print(OK)
0