Submission #83861

#TimeUsernameProblemLanguageResultExecution timeMemory
83861facelessQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
0 / 100
4424 ms79112 KiB
int numbit (int mask) { int ret = 0; while (mask) { mask -= mask & -mask; ret ++; } return ret; } int to[2000]; int encode (int n, int x, int y){ int tmp = 1; n = 12; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { for (int k = j + 1; k < n; k++) { for (int l = k + 1; l < n; l++) { for (int z = l + 1; z < n; z ++) { for (int x = z + 1; z < n; z ++) { to[tmp ++] = (1 << i) ^ (1 << j) ^ (1 << k) ^ (1 << l) ^ (1 << z) ^ (1 << x); } } } } } } for (int i = 0; i < 12; i++) { if (to[x] & (1 << i) and (to[y] & (1 << i)) == 0) return i + 1; } }
int numbit (int mask) { int ret = 0; while (mask) { mask -= mask & -mask; ret ++; } return ret; } int to[2000]; int decode (int n, int q, int h){ int tmp = 1; n = 12; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { for (int k = j + 1; k < n; k++) { for (int l = k + 1; l < n; l++) { for (int z = l + 1; z < n; z ++) { for (int x = z + 1; z < n; z ++) { to[tmp ++] = (1 << i) ^ (1 << j) ^ (1 << k) ^ (1 << l) ^ (1 << z) ^ (1 << x); } } } } } } int mask = to[q]; if (mask & (1 << (h - 1))) return 1; return 0; }

Compilation message (stderr)

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