Submission #659138

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6591382022-11-16 18:21:14ajab_01Bank (IZhO14_bank)C++17
0 / 100
2 ms340 KiB
#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++){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...