Submission #166676

#TimeUsernameProblemLanguageResultExecution timeMemory
166676CaroLindaQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
100 / 100
1650 ms86056 KiB
#include <bits/stdc++.h> #define lp(i,a,b) for(int i=a;i<b;i++) #define ff first #define ss second #define pb push_back #define ll long long #define sz size() using namespace std ; int type , t , n , a , b ; vector<int> v ; bool ok = false ; bool isOn(int m, int bit) { return ((1<<bit)&m) != 0 ; } int encode(int n , int x , int y) { if(!ok) { lp(i,1,(1<<12)) if( __builtin_popcount(i) == 6 ) v.pb( i ) ; ok = true ; } lp(i,0,12) if( isOn(v[x-1],i) && !isOn(v[y-1], i) ) return i+1 ; }
#include <bits/stdc++.h> #define lp(i,a,b) for(int i=a;i<b;i++) #define ff first #define ss second #define pb push_back #define ll long long #define sz size() using namespace std ; vector<int> v ; bool ok = false ; bool isOn(int m, int bit) { return ((1<<bit)&m) != 0 ; } bool decode(int n, int q, int h) { if(!ok) { lp(i,1,(1<<12)) if( __builtin_popcount(i) == 6 ) v.pb(i) ; ok = true ; } if( isOn(v[q-1],h-1) ) return true ; return false ; }

Compilation message (stderr)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:32:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...