제출 #523276

#제출 시각아이디문제언어결과실행 시간메모리
523276tmn2005은행 (IZhO14_bank)C++17
19 / 100
59 ms300 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define fr first #define sc second #define vec vector #define ret return #define ins insert #define mk make_pair #define pb push_back #define pii pair<int,int> #define all(s) s.begin(), s.end() #define allr(s) s.rbegin(), s.rend() const int N = 2e5+12, INF = 1e9, mod = 1e9+7; int a[N], b[N]; main(){ int n, m; cin>>n>>m; for(int i=0; i<n; i++)cin>>a[i]; for(int i=0; i<m; i++)cin>>b[i]; for(int mask=0; mask<(1<<m); mask++){ int ans = 0; for(int i=0; i<m; i++){ if(mask & (1<<i)){ ans += b[i]; } } if(ans == a[0]){ cout<<"YES"<<endl; return 0; } } cout<<"NO"; return 0; }

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

bank.cpp:22:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   22 | main(){
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...