Submission #1098109

#TimeUsernameProblemLanguageResultExecution timeMemory
1098109vjudge1Bank (IZhO14_bank)Cpython 3
19 / 100
13 ms2980 KiB
n,m=map(int,input().split()) salaries = list(map(int, input().split())) banknotes = list(map(int, input().split())) for salary in salaries: dp=[False]*(salary+1) dp[0]=True for banknote in banknotes: for i in range(salary,banknote-1,-1): dp[i]=dp[i]-dp[i-banknote] if not dp[salary]: print("NO") exit() print("YES")
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...