제출 #564823

#제출 시각아이디문제언어결과실행 시간메모리
564823RealSnakeQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
60 / 100
3063 ms24064 KiB
int encode(int n, int x, int y) { for(int i = 0; i < 10; i++) { if((x & (1 << i)) && !(y & (1 << i))) return i + 1; } x = __builtin_popcount(x); y = __builtin_popcount(y); for(int i = 0; i < 4; i++) { if(!(x & (1 << i)) && (y & (1 << i))) return i + 11; } return 0; }
int decode(int n, int q, int h) { if(h <= 10) return (q & (1 << (h - 1))) > 0; q = __builtin_popcount(q); return (q & (1 << (h - 11))) == 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...