結果

問題 No.2693 Sword
ユーザー sasa8uyauyasasa8uyauya
提出日時 2024-03-23 04:08:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 224 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 75,740 KB
最終ジャッジ日時 2024-03-23 04:08:08
合計ジャッジ時間 3,188 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,332 KB
testcase_01 AC 39 ms
53,332 KB
testcase_02 AC 40 ms
53,332 KB
testcase_03 AC 37 ms
53,332 KB
testcase_04 AC 40 ms
53,332 KB
testcase_05 AC 37 ms
53,332 KB
testcase_06 AC 41 ms
53,332 KB
testcase_07 AC 41 ms
53,332 KB
testcase_08 AC 43 ms
53,332 KB
testcase_09 AC 65 ms
70,756 KB
testcase_10 AC 49 ms
61,856 KB
testcase_11 AC 59 ms
68,708 KB
testcase_12 AC 37 ms
53,332 KB
testcase_13 AC 57 ms
66,636 KB
testcase_14 AC 44 ms
59,652 KB
testcase_15 AC 70 ms
72,792 KB
testcase_16 AC 68 ms
70,800 KB
testcase_17 AC 78 ms
73,896 KB
testcase_18 AC 70 ms
70,772 KB
testcase_19 AC 68 ms
72,876 KB
testcase_20 AC 58 ms
64,556 KB
testcase_21 AC 55 ms
64,556 KB
testcase_22 AC 69 ms
72,860 KB
testcase_23 AC 53 ms
64,596 KB
testcase_24 AC 38 ms
53,332 KB
testcase_25 AC 37 ms
53,332 KB
testcase_26 AC 37 ms
53,332 KB
testcase_27 AC 37 ms
53,332 KB
testcase_28 AC 37 ms
53,332 KB
testcase_29 AC 38 ms
53,332 KB
testcase_30 AC 37 ms
53,332 KB
testcase_31 AC 40 ms
53,332 KB
testcase_32 AC 75 ms
75,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,p,k=map(int,input().split())
x=10**18
q=[-1]*(k+1)
q[0]=p
for _ in range(n):
	t,b=map(int,input().split())
	for i in reversed(range(k)):
		if q[i]!=-1:
			q[i+1]=max(q[i+1],min(t*q[i]+b,x+1))
print(q[k] if q[k]<=x else -1)
0