# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
68459 | yusufake | Bank (IZhO14_bank) | C++98 | 222 ms | 14844 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;
typedef long long ll;
const int N = 1e3+3;
#define pb push_back
vector < int > V[N];
bool H[20][1<<20];
int A[N],B[N],T[N*20],n,m,i,j,t,ans;
void f(int i, int m){
if(ans) return;
if(i == n) { ans = 1; return; }
if(H[i][m]) return;
H[i][m] = 1;
int j, x = A[i];
for(j=0;j<V[x].size();j++){
if((V[x][j] & m) == V[x][j])
f(i+1,(m^V[x][j]));
}
}
int main(){
scanf("%d%d",&n,&m);
for(i=0;i<n;i++) { scanf("%d",&A[i]); T[ A[i] ] = 1; }
for(i=0;i<m;i++) scanf("%d",&B[i]);
for(i=1;i<(1<<m);i++){
t = 0;
for(j=0;j<m;j++)
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... |