Submission #565352

#TimeUsernameProblemLanguageResultExecution timeMemory
565352katwamiawQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
100 / 100
3090 ms24276 KiB
#include<bits/stdc++.h> #define ll long long #define no cout << "NO\n" #define yes cout << "YES\n" #define endl '\n' #define pb push_back using namespace std ; //fflush(stdout) ; int a[13][940] ; int bits_co(int x){ int ans=0 ; for(int i=0 ; i<12 ; i++){ if(x&(1<<i)) ans++ ; } return ans ; } void make(){ int r=1 ; for(int i=1 ; i<(1<<12) ; i++){ if(bits_co(i)==6){ for(int j=0 ; j<12 ; j++){ if(i&(1<<j)) a[j][r]=1 ; else a[j][r]=0 ; } r++ ; } } } int encode (int n, int x, int y) { if(a[0][1]==0) make() ; for(int i=0 ; i<12 ; i++){ if(a[i][x]==1&&a[i][y]==0) return i+1 ; } return 1 ; }
#include<bits/stdc++.h> #define ll long long #define no cout << "NO\n" #define yes cout << "YES\n" #define endl '\n' #define pb push_back using namespace std ; //fflush(stdout) ; int a[13][940] ; int bits_co(int x){ int ans=0 ; for(int i=0 ; i<12 ; i++){ if(x&(1<<i)) ans++ ; } return ans ; } void make(){ int r=1 ; for(int i=1 ; i<(1<<12) ; i++){ if(bits_co(i)==6){ for(int j=0 ; j<12 ; j++){ if(i&(1<<j)) a[j][r]=1 ; else a[j][r]=0 ; } r++ ; } } } int decode (int n, int q, int h) { if(a[0][1]==0) make() ; h-- ; return a[h][q] ; }
#Verdict Execution timeMemoryGrader output
Fetching results...