結果

問題 No.3067 +10 Seconds Clock
ユーザー miho-4
提出日時 2025-03-21 23:13:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 471 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 82,652 KB
実行使用メモリ 83,704 KB
最終ジャッジ日時 2025-03-21 23:13:29
合計ジャッジ時間 4,437 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 WA * 1 TLE * 1 -- * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n,t=map(int,input().split())
L=list(map(int,input().split()))
k=int(input())
A=list(map(int,input().split()))

ans=-1
for bit in range(2**k):
	tmp=[]
	cnt=0
	for i in range(k):
		if bit>>i&1:
			cnt+=1
			tmp.append(A[i])
	if cnt<ans:continue
	tmp=tmp[::-1]
	T=t
	now=0
	flag=1
	for i in range(n-1):
		if tmp:
		    if tmp[-1]==i:
		        tmp.pop()
		        T+=10
		T-=L[i]
		if T<=0:
			flag=0
			break
	if flag:
		if ans==-1:
			ans=cnt
		ans=min(ans,cnt)
print(ans)
0