# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
565352 | katwamiaw | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 3090 ms | 24276 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>
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |