結果

問題 No.2693 Sword
ユーザー sasa8uyauya
提出日時 2024-03-23 03:49:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 304 bytes
コンパイル時間 372 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 67,200 KB
最終ジャッジ日時 2024-09-30 13:01:46
合計ジャッジ時間 2,871 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 3
other AC * 17 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

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+=t
				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