結果

問題 No.1808 Fullgold Alchemist
ユーザー MasKoaTSMasKoaTS
提出日時 2021-09-16 20:21:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 713 ms / 2,000 ms
コード長 464 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 32,656 KB
最終ジャッジ日時 2024-04-08 14:57:58
合計ジャッジ時間 6,840 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,112 KB
testcase_01 AC 30 ms
10,112 KB
testcase_02 AC 29 ms
10,112 KB
testcase_03 AC 30 ms
10,112 KB
testcase_04 AC 31 ms
10,112 KB
testcase_05 AC 88 ms
14,120 KB
testcase_06 AC 196 ms
27,096 KB
testcase_07 AC 118 ms
27,096 KB
testcase_08 AC 713 ms
32,656 KB
testcase_09 AC 228 ms
32,656 KB
testcase_10 AC 152 ms
32,656 KB
testcase_11 AC 220 ms
32,060 KB
testcase_12 AC 133 ms
30,028 KB
testcase_13 AC 265 ms
30,024 KB
testcase_14 AC 301 ms
30,140 KB
testcase_15 AC 227 ms
30,024 KB
testcase_16 AC 34 ms
10,624 KB
testcase_17 AC 29 ms
10,112 KB
testcase_18 AC 60 ms
13,780 KB
testcase_19 AC 31 ms
10,368 KB
testcase_20 AC 87 ms
14,636 KB
testcase_21 AC 47 ms
11,776 KB
testcase_22 AC 28 ms
10,112 KB
testcase_23 AC 38 ms
11,264 KB
testcase_24 AC 35 ms
10,624 KB
testcase_25 AC 34 ms
10,752 KB
testcase_26 AC 80 ms
13,756 KB
testcase_27 AC 94 ms
14,264 KB
testcase_28 AC 279 ms
30,228 KB
testcase_29 AC 116 ms
16,712 KB
testcase_30 AC 102 ms
15,972 KB
testcase_31 AC 333 ms
28,056 KB
testcase_32 AC 164 ms
21,036 KB
testcase_33 AC 325 ms
24,972 KB
testcase_34 AC 261 ms
29,912 KB
testcase_35 AC 248 ms
23,772 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()
if not(1 <= n <= 2*(10**5) and 1 <= m <= 10**9):
	exit()
if not(all(0 <= i <= 10**9 for i in a)):
	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