제출 #344591

#제출 시각아이디문제언어결과실행 시간메모리
344591Erzhan06은행 (IZhO14_bank)C++17
0 / 100
80 ms364 KiB
/*#pragma GCC optimize("O3") #pragma GCC target ("avx2") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC optimize("unroll-loops") */ #include <bits/stdc++.h> using namespace std; #define nl "\n" #define bananas return 0; #define ll long long #define IOS ios_base :: sync_with_stdio(NULL); cin.tie(0); cout.tie(0); const int N=2e5+6; const int INF=1e9+6; int dp[2001]; int main() { freopen("bank.in", "r", stdin); freopen("bank.out", "w", stdout); IOS int n,m; cin>>n>>m; int a[n+1]; int b[m+1]; for (int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=m;i++) { cin>>b[i]; } int s=a[1]; dp[0]=1; for (int i=1;i<=s;i++) { dp[i]=0; } for (int i=1;i<=m;i++) { for (int j=s;j>=0;j--) { if (j>=b[i] && dp[j-b[i]]==1){ dp[j]=1; } } } if (dp[s]!=1) { cout<<"NO"; }else { cout<<"YES"; } bananas }

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

bank.cpp: In function 'int main()':
bank.cpp:17:8: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   17 | freopen("bank.in", "r", stdin);
      | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
bank.cpp:18:8: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   18 | 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...