# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
113995 | 2019-05-29T13:18:15 Z | dndhk | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 1260 ms | 124544 KB |
#include <bits/stdc++.h> using namespace std; vector<int> v; int num = 0; int cnt = 0; void chk(int x){ if(x==13){ if(cnt==6){ v.push_back(num); } return; } num = num * 2; chk(x+1); num++; cnt++; chk(x+1); num/=2; cnt--; } int encode (int n, int x, int y) { if(v.empty()){ chk(1); sort(v.begin(), v.end()); } x = v[x-1], y = v[y-1]; int i = 1, two = 1; while(1){ if((x&two)>0 && (y&two)==0){ return i; } i++; two*=2; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1260 ms | 124528 KB | Output is correct - maxh = 12 |
2 | Correct | 1255 ms | 124544 KB | Output is correct - maxh = 12 |