Submission #391324

#TimeUsernameProblemLanguageResultExecution timeMemory
391324MlxaNavigation 2 (JOI21_navigation2)C++17
0 / 100
1 ms192 KiB
#include "Anna.h" #include <bits/stdc++.h> using namespace std; bool bit[8]; void smth(int i, int j) { int msk = 0; for (int i = 0; i < 8; ++i) { if (bit[i]) { msk |= (1 << i); } } SetFlag(i, j, msk + 1); } void Anna(int n, int k, vector<int> r, vector<int> c) { for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { bit[7] = (i + j) % 2; for (int t = 0; t < 7; ++t) { int x = r[t], y = c[t]; if (bit[7]) { bit[t] = i <= x; } else { bit[t] = j <= y; } } smth(i, j); } } }
#include "Bruno.h" #include <bits/stdc++.h> using namespace std; /* bit[7] = (i + j) % 2; for (int t = 0; t < 7; ++t) { int x = r[t], y = c[t]; if (bit[7]) { bit[t] = i <= x; } else { bit[t] = j <= y; } } */ bool bit(int m, int i) { --m; return (m >> i) & 1; } vector<int> Bruno(int k, vector<int> value) { vector<int> answer; if (bit(value[4], 7)) { for (int i = 0; i < 7; ++i) { if (!bit(value[0], i)) { answer.push_back(3); } else if (bit(value[8], i)) { answer.push_back(2); } else if (bit(value[5], i)) { answer.push_back(0); } else if (!bit(value[7], i)) { answer.push_back(1); } else { answer.push_back(4); } } } else { for (int i = 0; i < 7; ++i) { if (!bit(value[0], i)) { answer.push_back(1); } else if (bit(value[8], i)) { answer.push_back(0); } else if (bit(value[7], i)) { answer.push_back(2); } else if (!bit(value[5], i)) { answer.push_back(3); } else { answer.push_back(4); } } } return answer; }
#Verdict Execution timeMemoryGrader output
Fetching results...