제출 #1022229

#제출 시각아이디문제언어결과실행 시간메모리
1022229codefox질문 (CEOI14_question_grader)C++14
0 / 100
7071 ms344 KiB
#pragma GCC target("popcnt") #pragma GCC optimize("Ofast") #include<bits/stdc++.h> int encode(int n, int a, int b) { int ca = __builtin_popcount(a); int cb = __builtin_popcount(b); ca--; cb--; for (int j = 0; j < 3; j++) { if ((cb&(1<<j)) && ((a==b)||((ca&(1<<j))==0))) { return j+1; } } for (int j = 0; j < 10; j++) { if (((b&(1<<j))==0) && ((a==b)||((a&(1<<j))))) { return j+4; } } }
#pragma GCC optimize("popcnt") #pragma GCC optimize("Ofast") #include<bits/stdc++.h> int decode(int n, int q, int h) { int cq = __builtin_popcount(q); cq--; h--; if (h < 3) { if (cq&(1<<h)) return false; else return true; } else if (q &(1<<(h-3))) return true; else return false; }

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

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:25:5: warning: control reaches end of non-void function [-Wreturn-type]
   25 |     }
      |     ^

decoder.cpp:1:30: warning: bad option '-fpopcnt' to pragma 'optimize' [-Wpragmas]
    1 | #pragma GCC optimize("popcnt")
      |                              ^
decoder.cpp:5:31: warning: bad option '-fpopcnt' to attribute 'optimize' [-Wattributes]
    5 | int decode(int n, int q, int h)
      |                               ^
#Verdict Execution timeMemoryGrader output
Fetching results...