| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1194601 | ahmetlbktd4 | 은행 (IZhO14_bank) | C++20 | 36 ms | 24392 KiB |
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
freopen("bank.in","r",stdin);
freopen("bank.out","w",stdout);
int n,m;
cin >> n >> m;
vector <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];
}
int l = 0;
for (int i = 0;i < n;i++){
for (int mask = 0;mask < (1<<m);mask++){
int s = 0;
vector <int> v;
for (int j = 0;j < m;j++){
if (mask & (1<<j)){
v.push_back(j);s+=b[j];
}
}
if (s == a[i]){
cout << "YES";return 0;
}
}
}
cout << "NO";
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
