제출 #972184

#제출 시각아이디문제언어결과실행 시간메모리
972184Aika은행 (IZhO14_bank)C++14
0 / 100
1 ms456 KiB
#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; }

컴파일 시 표준 에러 (stderr) 메시지

bank.cpp: In function 'int main()':
bank.cpp:8:12: warning: unused variable 'k' [-Wunused-variable]
    8 |     int n, k, m, i, j;
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...