結果

問題 No.2693 Sword
コンテスト
ユーザー sasa8uyauya
提出日時 2024-03-23 03:50:35
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 304 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 143 ms
コンパイル使用メモリ 85,132 KB
実行使用メモリ 67,748 KB
最終ジャッジ日時 2026-04-16 16:28:51
合計ジャッジ時間 2,499 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 3
other AC * 18 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n,p,k=map(int,input().split())
x=10**18
g=-1
items=[tuple(map(int,input().split())) for i in range(n)]
for i in range(k+1):
	f=p
	c=0
	d=0
	for j in range(n):
		t,b=items[j]
		if t==1:
			if c<i:
				f+=b
				c+=1
		else:
			if c+d<k and f<=x:
				f*=2
				d+=1
	if c+d==k and f<=x:
		g=max(g,f)
print(g)
0