제출 #936515

#제출 시각아이디문제언어결과실행 시간메모리
936515tamir1은행 (IZhO14_bank)C++14
0 / 100
1 ms348 KiB
#include<bits/stdc++.h> using namespace std; int n,m,a[30],b[30],i,j,x; int main(){ freopen("bank.in","r",stdin); freopen("bank.out","w",stdout); cin >> n >> m; for(i=0;i<n;i++) cin >> a[i]; for(i=0;i<m;i++) cin >> b[i]; if(n==1) x=a[0]; for(i=0;i<(1<<m);i++){ int sum=0; for(j=0;j<m;j++){ if(i&(1<<j)) sum+=b[j]; } if(sum==x){ cout << "YES"; return 0; } } cout << "NO"; }

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

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