結果

問題 No.3067 +10 Seconds Clock
ユーザー miho-4
提出日時 2025-03-21 23:01:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 702 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 82,432 KB
最終ジャッジ日時 2025-03-21 23:01:27
合計ジャッジ時間 4,426 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
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=10**6
for bit in range(2**k):
	tmp=[]
	cnt=0
	for i in range(k):
		if bit>>i&1:
			cnt+=1
			tmp.append(A[i])
	tmp=tmp[::-1]
	T=t
	now=0
	flag=1
	for e in L:
		if tmp:
			if now<=tmp[-1]<=now+e and tmp[-1]<now+T:
				T+=10
				tmp.pop()
		T-=e
		if T<=0:
			flag=0
			break
	if flag:
		ans=min(ans,cnt)
print(ans if ans<10**6 else -1)
0