# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1127417 | FucKanh | Bank (IZhO14_bank) | C++20 | 162 ms | 33264 KiB |
#include<bits/stdc++.h>
#define ll long long
#define int ll
#define pii pair<int,int>
using namespace std;
int n,m;
int w[1<<21], pos[1<<21], ok[1<<21];
int a[30], b[30], s[30];
void solve() {
cin >> n >> m;
if (n > m) {
cout << "NO";
return;
}
memset(pos,-1,sizeof(pos));
for (int i = 1; i <= n; i++) cin >> a[i];
for (int i = 1; i <= n; i++) s[i] = s[i-1] + a[i];
for (int i = 1; i <= m; i++) {
cin >> b[i];
if (b[i] <= a[1]) ok[1<<i-1] = 1;
}
for (int state = 1; state < (1<<m); state++) {
for (int i = 0; i < m; i++) {
if ((state & (1<<i))==0) continue;
w[state] += b[i+1];
# | 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... |