Submission #436177

#TimeUsernameProblemLanguageResultExecution timeMemory
4361772qbingxuanNavigation 2 (JOI21_navigation2)C++17
37 / 100
892 ms848 KiB
#include "Anna.h" #include <bits/stdc++.h> using namespace std; namespace { } // namespace void Anna(int N, int K, std::vector<int> R, std::vector<int> C) { for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { int flag = 0; for (int k = 0; k < K; k++) { if ((i+j)%2 == 0 && R[k] <= i) flag |= 1 << k; if ((i+j)%2 == 1 && C[k] <= j) flag |= 1 << k; } flag = flag * 2 + ((i+j)%2); SetFlag(i, j, flag+1); } } }
#include "Bruno.h" #include <bits/stdc++.h> using namespace std; namespace { // int variable_example = 1; } // namespace std::vector<int> Bruno(int K, std::vector<int> value) { for (int &x: value) --x; int par = value[4] & 1; for (int &x: value) x >>= 1; std::vector<int> res(K); for (int i = 0; i < K; i++) { vector<int> cur(9); for (int j = 0; j < 9; j++) cur[j] = value[j] >> i & 1; int xdir = 0, ydir = 0; if (!par) { if (!cur[4]) { xdir = 1; } if (cur[0]) { xdir = -1; } if (!cur[1]) { ydir = 1; } if (cur[3]) { ydir = -1; } } else { if (!cur[3]) { xdir = 1; } if (cur[1]) { xdir = -1; } if (!cur[4]) { ydir = 1; } if (cur[0]) { ydir = -1; } } if (ydir == 1) { res[i] = 0; } else if (ydir == -1) { res[i] = 1; } else if (xdir == 1) { res[i] = 2; } else if (xdir == -1) { res[i] = 3; } else if (xdir == 0 && ydir == 0) { res[i] = 4; } else abort(); } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...