結果

問題 No.1808 Fullgold Alchemist
ユーザー MasKoaTSMasKoaTS
提出日時 2021-09-16 19:01:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 682 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 32,632 KB
最終ジャッジ日時 2024-04-08 14:57:31
合計ジャッジ時間 8,570 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
9,984 KB
testcase_01 AC 29 ms
9,984 KB
testcase_02 AC 29 ms
9,984 KB
testcase_03 AC 30 ms
9,984 KB
testcase_04 AC 29 ms
9,984 KB
testcase_05 AC 75 ms
14,220 KB
testcase_06 AC 173 ms
25,784 KB
testcase_07 AC 98 ms
25,784 KB
testcase_08 AC 682 ms
32,632 KB
testcase_09 AC 208 ms
32,632 KB
testcase_10 AC 132 ms
32,632 KB
testcase_11 AC 203 ms
32,032 KB
testcase_12 AC 115 ms
30,000 KB
testcase_13 AC 245 ms
29,992 KB
testcase_14 AC 283 ms
30,008 KB
testcase_15 AC 207 ms
29,996 KB
testcase_16 AC 34 ms
10,624 KB
testcase_17 AC 29 ms
9,984 KB
testcase_18 AC 56 ms
13,792 KB
testcase_19 AC 32 ms
10,368 KB
testcase_20 AC 84 ms
14,776 KB
testcase_21 AC 45 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 78 ms
13,728 KB
testcase_27 AC 91 ms
14,180 KB
testcase_28 AC 264 ms
30,200 KB
testcase_29 AC 111 ms
16,600 KB
testcase_30 AC 98 ms
15,944 KB
testcase_31 AC 316 ms
28,032 KB
testcase_32 AC 156 ms
21,008 KB
testcase_33 AC 308 ms
24,944 KB
testcase_34 AC 241 ms
29,884 KB
testcase_35 AC 236 ms
23,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

n,m = map(int,input().split())
a = list(map(int,input().split()))
s = list(itertools.accumulate(a))
if(len(a) != n):
	exit()

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