結果

問題 No.2217 Suffix+
ユーザー shobonvipshobonvip
提出日時 2023-02-17 21:30:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 289 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 140,036 KB
最終ジャッジ日時 2023-09-26 18:37:50
合計ジャッジ時間 7,129 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,260 KB
testcase_01 AC 74 ms
71,244 KB
testcase_02 AC 74 ms
71,464 KB
testcase_03 AC 74 ms
71,316 KB
testcase_04 AC 74 ms
71,176 KB
testcase_05 AC 74 ms
71,404 KB
testcase_06 AC 76 ms
71,424 KB
testcase_07 AC 74 ms
71,136 KB
testcase_08 AC 73 ms
71,136 KB
testcase_09 AC 74 ms
71,244 KB
testcase_10 AC 75 ms
71,132 KB
testcase_11 AC 74 ms
71,476 KB
testcase_12 AC 73 ms
71,132 KB
testcase_13 AC 73 ms
71,244 KB
testcase_14 AC 102 ms
90,844 KB
testcase_15 AC 103 ms
90,676 KB
testcase_16 AC 128 ms
109,180 KB
testcase_17 AC 115 ms
99,300 KB
testcase_18 AC 107 ms
94,596 KB
testcase_19 AC 214 ms
125,248 KB
testcase_20 AC 204 ms
118,168 KB
testcase_21 AC 101 ms
76,480 KB
testcase_22 AC 210 ms
122,920 KB
testcase_23 AC 188 ms
109,872 KB
testcase_24 AC 159 ms
138,732 KB
testcase_25 AC 164 ms
139,768 KB
testcase_26 AC 166 ms
139,744 KB
testcase_27 AC 163 ms
139,420 KB
testcase_28 AC 160 ms
139,568 KB
testcase_29 AC 254 ms
114,948 KB
testcase_30 AC 253 ms
114,792 KB
testcase_31 AC 250 ms
114,280 KB
testcase_32 AC 258 ms
114,748 KB
testcase_33 AC 255 ms
115,028 KB
testcase_34 AC 167 ms
140,036 KB
testcase_35 AC 75 ms
71,224 KB
testcase_36 AC 289 ms
114,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int,input().split())
a = list(map(int,input().split()))

suki = 10 ** 18
kirai = 0
while suki - kirai > 1:
	targ = (suki + kirai) // 2
	tai = 0
	rrs = 0
	b = a[::]
	for i in range(n):
		b[i] += tai
		if b[i] < targ:
			g = (targ - b[i] + i) // (i + 1)
			tai += g * (i + 1)
			rrs += g
	if rrs > k:
		suki = targ
	else:
		kirai = targ

print(kirai)
0