結果

問題 No.1808 Fullgold Alchemist
ユーザー MasKoaTSMasKoaTS
提出日時 2021-09-16 12:24:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 676 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 32,064 KB
最終ジャッジ日時 2024-04-08 14:57:50
合計ジャッジ時間 6,454 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
9,984 KB
testcase_01 AC 33 ms
9,984 KB
testcase_02 AC 28 ms
9,984 KB
testcase_03 AC 30 ms
9,984 KB
testcase_04 AC 29 ms
9,984 KB
testcase_05 AC 72 ms
14,216 KB
testcase_06 AC 174 ms
25,788 KB
testcase_07 AC 99 ms
25,788 KB
testcase_08 AC 676 ms
32,064 KB
testcase_09 AC 208 ms
32,064 KB
testcase_10 AC 135 ms
32,064 KB
testcase_11 AC 204 ms
32,032 KB
testcase_12 AC 115 ms
30,000 KB
testcase_13 AC 246 ms
29,992 KB
testcase_14 AC 282 ms
30,008 KB
testcase_15 AC 206 ms
29,996 KB
testcase_16 AC 34 ms
10,624 KB
testcase_17 AC 29 ms
9,984 KB
testcase_18 AC 55 ms
13,788 KB
testcase_19 AC 31 ms
10,368 KB
testcase_20 AC 83 ms
14,776 KB
testcase_21 AC 44 ms
11,776 KB
testcase_22 AC 29 ms
9,984 KB
testcase_23 AC 38 ms
11,264 KB
testcase_24 AC 35 ms
10,496 KB
testcase_25 AC 34 ms
10,752 KB
testcase_26 AC 77 ms
13,728 KB
testcase_27 AC 94 ms
14,180 KB
testcase_28 AC 264 ms
30,200 KB
testcase_29 AC 111 ms
16,600 KB
testcase_30 AC 99 ms
15,944 KB
testcase_31 AC 322 ms
27,900 KB
testcase_32 AC 161 ms
21,008 KB
testcase_33 AC 310 ms
24,940 KB
testcase_34 AC 251 ms
29,884 KB
testcase_35 AC 240 ms
23,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

n,m = map(int,input().split())
a = list(map(int,input().split()))
s = list(itertools.accumulate(a))

def func(k):
	t = m * k
	res = True
	for i in s:
		if(i < t):
			res = False
			break
		t += m * k
	return res

ok = 0
ng = 10**9+1
while(ng-ok > 1):
	k = (ok+ng)//2
	if(func(k)):
		ok = k
	else:
		ng = k
print(ok)
0