結果

問題 No.2890 Chiffon
ユーザー 👑 p-adicp-adic
提出日時 2024-07-05 23:56:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 325 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 61,352 KB
最終ジャッジ日時 2024-07-06 11:13:35
合計ジャッジ時間 5,932 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,880 KB
testcase_01 AC 24 ms
10,624 KB
testcase_02 AC 25 ms
10,752 KB
testcase_03 AC 24 ms
10,624 KB
testcase_04 AC 24 ms
10,880 KB
testcase_05 AC 24 ms
10,752 KB
testcase_06 AC 24 ms
10,752 KB
testcase_07 AC 28 ms
10,752 KB
testcase_08 AC 27 ms
10,624 KB
testcase_09 AC 26 ms
10,752 KB
testcase_10 AC 25 ms
10,752 KB
testcase_11 AC 25 ms
10,752 KB
testcase_12 AC 26 ms
10,624 KB
testcase_13 AC 26 ms
10,624 KB
testcase_14 AC 25 ms
10,752 KB
testcase_15 AC 28 ms
10,624 KB
testcase_16 AC 25 ms
10,752 KB
testcase_17 AC 26 ms
10,752 KB
testcase_18 AC 26 ms
10,624 KB
testcase_19 AC 25 ms
10,752 KB
testcase_20 AC 25 ms
10,752 KB
testcase_21 AC 24 ms
10,624 KB
testcase_22 AC 325 ms
61,352 KB
testcase_23 AC 29 ms
10,752 KB
testcase_24 AC 27 ms
10,752 KB
testcase_25 AC 26 ms
10,624 KB
testcase_26 AC 29 ms
10,880 KB
testcase_27 AC 24 ms
10,752 KB
testcase_28 AC 26 ms
10,752 KB
testcase_29 AC 27 ms
10,624 KB
testcase_30 AC 29 ms
10,880 KB
testcase_31 AC 36 ms
11,008 KB
testcase_32 AC 29 ms
10,752 KB
testcase_33 AC 150 ms
29,464 KB
testcase_34 AC 143 ms
29,456 KB
testcase_35 AC 144 ms
29,456 KB
testcase_36 AC 144 ms
29,576 KB
testcase_37 AC 149 ms
29,596 KB
testcase_38 AC 150 ms
29,452 KB
testcase_39 AC 147 ms
29,456 KB
testcase_40 AC 151 ms
29,456 KB
testcase_41 AC 143 ms
29,584 KB
testcase_42 AC 151 ms
29,452 KB
testcase_43 AC 156 ms
29,456 KB
testcase_44 AC 148 ms
29,464 KB
testcase_45 AC 146 ms
29,604 KB
testcase_46 AC 142 ms
29,584 KB
testcase_47 AC 145 ms
29,456 KB
testcase_48 AC 144 ms
29,596 KB
testcase_49 AC 160 ms
29,528 KB
testcase_50 AC 159 ms
29,488 KB
testcase_51 AC 151 ms
29,460 KB
testcase_52 AC 148 ms
29,584 KB
testcase_53 AC 116 ms
10,752 KB
testcase_54 AC 107 ms
22,908 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.py:5: SyntaxWarning: invalid decimal literal
  A+=[a+N*2for a in A]

ソースコード

diff #

R=range
J=lambda:map(int,input().split())
N,K=J()
A=list(J())
A+=[a+N*2for a in A]
s=0
d=9**9
for i in R(K):
	if d>A[i+1]-A[i]:s,d=i,A[i+1]-A[i]
l,r=1,N+1
while l<r-1:
	m=(l+r)>>1;d=m*2
	for j in R(A[s]+1,A[s+1],2):
		t=j
		for i in R(1,K):
			if A[s+i+1]<=t+d:break
			t=max(A[s+i]+1,t+d)
		else:
			if t+d<=j+N*2:l=m;break
	else:r=m
print(l*2)
0