Submission #68459

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
684592018-08-17 07:30:20yusufakeBank (IZhO14_bank)C++98
100 / 100
222 ms14844 KiB
#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++)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bank.cpp: In function 'void f(int, int)':
bank.cpp:17:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(j=0;j<V[x].size();j++){
             ~^~~~~~~~~~~~
bank.cpp: In function 'int main()':
bank.cpp:24:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~
bank.cpp:25:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(i=0;i<n;i++) { scanf("%d",&A[i]); T[ A[i] ] = 1; }
                        ~~~~~^~~~~~~~~~~~
bank.cpp:26:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(i=0;i<m;i++) scanf("%d",&B[i]);
                      ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...