# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
461188 | 2021-08-09T13:45:19 Z | fskarica | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define fi first #define se second #define pii pair<int, int> int mat1[1000][20]; int mat2[1000][1000]; int bit(int mask) { int ret = 0; for (int i = 0; i < 12; i++) { if (mask & (1 << i)) ret++; } return ret; } int encoder(int n, int x, int y) { int pos = 1; for (int i = 1; i <= (1 << 12); i++) { if (bit(i) != 6) continue; for (int j = 0; j < 12; j++) { if (i & (1 << j)) { mat1[pos][j] = 1; } else { mat1[pos][j] = 0; } } pos++; } for (int i = 0; i < 1000; i++) { for (int j = 0; j < 1000; j++) { if (i == j) continue; for (int k = 0; k < 12; k++) { if (!mat1[i][k] && mat1[j][k]) { mat2[i][j] = k; } } } } return mat2[x][y]; }