Submission #166672

#TimeUsernameProblemLanguageResultExecution timeMemory
166672CaroLindaQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
Compilation error
0 ms0 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 isOn(int m, int bit) { return ((1<<bit)&m) != 0 ; } int main() { lp(i,1,(1<<12)) if( __builtin_popcount(i) == 6 ) v.pb( i ) ; scanf("%d%d%d", &type, &n, &t) ; while(t--) { scanf("%d%d", &a , &b ) ; if( type == 1 ) { for(int i = 0 ; i < 12 ; i++ ) if( isOn( v[a-1] , i ) && !isOn(v[b-1] , i) ) { printf("%d\n", i+1 ) ; continue ; } } else { if( isOn(v[a-1] , b-1) ) printf("yes\n") ; else printf("no\n") ; } } }

Compilation message (stderr)

encoder.cpp: In function 'int main()':
encoder.cpp:23:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d%d", &type, &n, &t) ;
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
encoder.cpp:27:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &a , &b ) ;
     ~~~~~^~~~~~~~~~~~~~~~~~
/tmp/ccF8OmcR.o: In function `main':
grader_encode.c:(.text.startup+0x0): multiple definition of `main'
/tmp/cc2262p3.o:encoder.cpp:(.text.startup+0x0): first defined here
/tmp/ccF8OmcR.o: In function `main':
grader_encode.c:(.text.startup+0x10a): undefined reference to `encode(int, int, int)'
collect2: error: ld returned 1 exit status

/tmp/ccmur9m2.o: In function `main':
grader_decode.c:(.text.startup+0x19f): undefined reference to `decode(int, int, int)'
collect2: error: ld returned 1 exit status