結果
問題 | No.2890 Chiffon |
ユーザー | vwxyz |
提出日時 | 2024-09-13 22:46:52 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 187 ms / 2,000 ms |
コード長 | 727 bytes |
コンパイル時間 | 482 ms |
コンパイル使用メモリ | 82,080 KB |
実行使用メモリ | 199,008 KB |
最終ジャッジ日時 | 2024-09-13 22:47:03 |
合計ジャッジ時間 | 6,046 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 38 ms
52,548 KB |
testcase_01 | AC | 38 ms
52,280 KB |
testcase_02 | AC | 37 ms
53,244 KB |
testcase_03 | AC | 38 ms
52,696 KB |
testcase_04 | AC | 39 ms
52,488 KB |
testcase_05 | AC | 37 ms
52,948 KB |
testcase_06 | AC | 37 ms
52,752 KB |
testcase_07 | AC | 38 ms
52,808 KB |
testcase_08 | AC | 38 ms
52,684 KB |
testcase_09 | AC | 37 ms
52,272 KB |
testcase_10 | AC | 36 ms
52,748 KB |
testcase_11 | AC | 38 ms
52,360 KB |
testcase_12 | AC | 37 ms
53,136 KB |
testcase_13 | AC | 40 ms
53,412 KB |
testcase_14 | AC | 38 ms
52,988 KB |
testcase_15 | AC | 38 ms
53,200 KB |
testcase_16 | AC | 38 ms
52,612 KB |
testcase_17 | AC | 38 ms
52,592 KB |
testcase_18 | AC | 38 ms
52,212 KB |
testcase_19 | AC | 37 ms
52,620 KB |
testcase_20 | AC | 38 ms
53,536 KB |
testcase_21 | AC | 37 ms
52,488 KB |
testcase_22 | AC | 187 ms
199,008 KB |
testcase_23 | AC | 42 ms
59,644 KB |
testcase_24 | AC | 41 ms
59,384 KB |
testcase_25 | AC | 38 ms
53,352 KB |
testcase_26 | AC | 47 ms
61,772 KB |
testcase_27 | AC | 38 ms
53,212 KB |
testcase_28 | AC | 42 ms
59,412 KB |
testcase_29 | AC | 41 ms
58,784 KB |
testcase_30 | AC | 47 ms
62,128 KB |
testcase_31 | AC | 48 ms
62,572 KB |
testcase_32 | AC | 48 ms
62,792 KB |
testcase_33 | AC | 109 ms
126,576 KB |
testcase_34 | AC | 109 ms
126,308 KB |
testcase_35 | AC | 109 ms
126,656 KB |
testcase_36 | AC | 108 ms
126,352 KB |
testcase_37 | AC | 107 ms
126,552 KB |
testcase_38 | AC | 109 ms
126,176 KB |
testcase_39 | AC | 110 ms
126,476 KB |
testcase_40 | AC | 109 ms
126,356 KB |
testcase_41 | AC | 108 ms
126,436 KB |
testcase_42 | AC | 109 ms
126,736 KB |
testcase_43 | AC | 115 ms
128,284 KB |
testcase_44 | AC | 112 ms
128,260 KB |
testcase_45 | AC | 111 ms
128,476 KB |
testcase_46 | AC | 112 ms
128,084 KB |
testcase_47 | AC | 112 ms
128,360 KB |
testcase_48 | AC | 112 ms
126,408 KB |
testcase_49 | AC | 111 ms
126,648 KB |
testcase_50 | AC | 111 ms
126,324 KB |
testcase_51 | AC | 110 ms
126,328 KB |
testcase_52 | AC | 113 ms
128,072 KB |
testcase_53 | AC | 45 ms
59,164 KB |
testcase_54 | AC | 83 ms
102,400 KB |
ソースコード
def Bisect_Int(ok,ng,is_ok): while abs(ok-ng)>1: mid=(ok+ng)//2 if is_ok(mid): ok=mid else: ng=mid return ok N,K=map(int,input().split()) A=list(map(int,input().split())) D=[b-a for a,b in zip(A,A[1:])] D.append(2*N-sum(D)) mi=min(D) i=D.index(mi) D=D[i:]+D[:i] for i in range(K): D[i]//=2 C=[0]+D for i in range(1,K+1): C[i]+=C[i-1] def is_ok(d): for s in range(C[1]): cur=s for k in range(1,K): cur+=d if cur<C[k]: cur=C[k] elif C[k+1]<=cur: return False cur+=d if cur<=s+N: return True return False ans=Bisect_Int(0,N+1,is_ok)*2 print(ans)