제출 #82902

#제출 시각아이디문제언어결과실행 시간메모리
82902ToadDaveski은행 (IZhO14_bank)C++14
0 / 100
56 ms16860 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; ll dp[45][45][2501],a[45],b[45]; int main() { freopen("bank.in","r",stdin); freopen("bank.out","w",stdout); ll n,m,i,j,g; cin>>n>>m; for(i=1;i<=n;i++) cin>>a[i]; for(i=1;i<=m;i++) cin>>b[i]; dp[0][0][0]=1; for(i=1;i<=m;i++) for(j=0;j<=n;j++) { for(g=0;g<=a[j];g++) { dp[i][j][g]=dp[i-1][j][g]; if (g==b[i]) dp[i][j][g]=max(dp[i][j][g],dp[i-1][j-1][a[j-1]]); if (g>b[i])dp[i][j][g]=max(dp[i][j][g],dp[i-1][j][g-b[i]]); } } if (dp[m][n][a[n]]) cout<<"Yes"; else cout<<"No"; }

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

bank.cpp: In function 'int main()':
bank.cpp:7:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     freopen("bank.in","r",stdin);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
bank.cpp:8:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     freopen("bank.out","w",stdout);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...