제출 #567264

#제출 시각아이디문제언어결과실행 시간메모리
567264600Mihnea질문 (CEOI14_question_grader)C++17
100 / 100
3302 ms24120 KiB
bool first = 1; int what[1 << 12]; int encode (int n, int x, int y) { if (first) { int id = 0; first = 0; for (int mask = 0; mask < (1 << 12); mask++) { if (__builtin_popcount(mask) == 6) { what[id++] = mask; } } } for (int bit = 0; bit < 12; bit++) { if (!!(what[x] & (1 << bit)) && !(what[y] & (1 << bit))) { return bit + 1; } } }
bool first2 = 1; int what2[1 << 12]; int decode (int n, int q, int h) { if (first2) { int id = 0; first2 = 0; for (int mask = 0; mask < (1 << 12); mask++) { if (__builtin_popcount(mask) == 6) { what2[id++] = mask; } } } return !!(what2[q] & (1 << (h - 1))); }

컴파일 시 표준 에러 (stderr) 메시지

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