Submission #461192

#TimeUsernameProblemLanguageResultExecution timeMemory
461192fskaricaQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
0 / 100
7046 ms4220 KiB
#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 encode(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 + 1; } } } } return mat2[x][y]; }
#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 bit(int mask) { int ret = 0; for (int i = 0; i < 12; i++) { if (mask & (1 << i)) ret++; } return ret; } int decode(int n, int q, int h) { 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++; } return mat1[q][h - 1]; }
#Verdict Execution timeMemoryGrader output
Fetching results...