제출 #655540

#제출 시각아이디문제언어결과실행 시간메모리
655540iskhakkutbilim은행 (IZhO14_bank)C++14
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second #define all(a) a.begin(), a.end() const int M = 1e9 + 7; const int N = 1e6 + 1; main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ifstream cin("bank.in"); ofstream cout("bank.out"); int n, m; cin >> n >> m; int a[n], b[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 sum = 0; for(int i = 0;i < m; i++){ if(mask & (1<<i)){ sum+= b[i]; } } if(sum == a[0]){ cout << "YES"; return 0; } } cout << "NO"; return 0; }

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

bank.cpp:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | 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...