Submission #288916

#TimeUsernameProblemLanguageResultExecution timeMemory
288916PeppaPigQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e3 + 5; int n, T; vector<int> vec = {0}; void A() { scanf("%d %d", &n, &T); for(int t = 1, a, b; t <= T; t++) { scanf("%d %d", &a, &b); a = vec[a], b = vec[b]; for(int i = 0; i < 12; i++) if((a >> i & 1) && !(b >> i & 1)) { printf("%d\n", i + 1); break; } } } void B() { scanf("%d %d", &n, &T); for(int t = 1, a, b; t <= T; t++) { scanf("%d %d", &a, &b); a = vec[a]; if(a >> (b - 1) & 1) printf("yes\n"); else printf("no\n"); } } int main() { for(int i = 0; i < (1 << 12); i++) if(__builtin_popcount(i) == 6) vec.emplace_back(i); scanf("%d", &n); n == 1 ? A() : B(); return 0; }

Compilation message (stderr)

encoder.cpp: In function 'void A()':
encoder.cpp:11:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   11 |  scanf("%d %d", &n, &T);
      |  ~~~~~^~~~~~~~~~~~~~~~~
encoder.cpp:13:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   13 |   scanf("%d %d", &a, &b);
      |   ~~~~~^~~~~~~~~~~~~~~~~
encoder.cpp: In function 'void B()':
encoder.cpp:23:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   23 |  scanf("%d %d", &n, &T);
      |  ~~~~~^~~~~~~~~~~~~~~~~
encoder.cpp:25:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   25 |   scanf("%d %d", &a, &b);
      |   ~~~~~^~~~~~~~~~~~~~~~~
encoder.cpp: In function 'int main()':
encoder.cpp:36:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   36 |  scanf("%d", &n);
      |  ~~~~~^~~~~~~~~~
/tmp/ccDegZVE.o: In function `main':
grader_encode.c:(.text.startup+0x0): multiple definition of `main'
/tmp/ccjyYthR.o:encoder.cpp:(.text.startup+0x0): first defined here
/tmp/ccDegZVE.o: In function `main':
grader_encode.c:(.text.startup+0x107): undefined reference to `encode(int, int, int)'
collect2: error: ld returned 1 exit status

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