# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
972184 | 2024-04-30T08:22:19 Z | Aika | 은행 (IZhO14_bank) | C++14 | 1 ms | 456 KB |
#include <bits/stdc++.h> #define int long long #define aiiiii ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); using namespace std; signed main(){ aiiiii int n, k, m, i, j; cin>>n>>m; int a[n], b[m]; for(i=0;i<n;i++){ cin>>a[i]; } for(i=0;i<m;i++){ cin>>b[i]; } bool a1=0; for(i=0;i<n;i++){ int ans[a[i]+1]; for(i=0;i<a[i];i++){ ans[i]=10001; } for(j=0;j<m;j++){ for(int r=a[i];r>=0;r--){ if(ans[r]!=10001&&r+b[j]<=a[i])ans[r+b[j]]=min(ans[r+1],ans[r]+1); } } if(ans[a[i]]==10001)a1=1; } if(a1!=1)cout<<"YES"<<endl; else cout<<"NO"<<endl; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |