# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
659138 | ajab_01 | Bank (IZhO14_bank) | C++17 | 2 ms | 340 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
const int N = 21;
vector<int> sub[N];
long long pre[N];
bool dp[(1 << N)];
int sm[(1 << N)] , a[N] , b[N] , n , m;
int main(){
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> n >> m;
for(int i = 0 ; i < n ; i++)
cin >> a[i];
for(int i = 0 ; i < n ; i++)
cin >> b[i];
pre[0] = a[0];
for(int i = 1 ; i < n ; i++)
pre[i] = pre[i - 1] + a[i];
for(int mask = 0 ; mask < (1 << m) ; mask++)
dp[mask] = 1;
for(int mask = 0 ; mask < (1 << m) ; mask++)
for(int i = 0 ; i < m ; i++)
if(mask & (1 << i))
sm[mask] += b[i];
for(int mask = 0 ; mask < (1 << m) ; mask++)
for(int i = 0 ; i < n ; i++)
if(sm[mask] == a[i])
sub[i].push_back(mask);
for(int i = 0 ; i < n ; i++){
# | 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... |