Submission #95840

#TimeUsernameProblemLanguageResultExecution timeMemory
95840JustInCasepopa (BOI18_popa)C++17
0 / 100
12 ms420 KiB
#include <bits/stdc++.h> #include "popa.h" #define int32_t int #define int64_t long long #define Solve solve #define Query query const int32_t MAX_N = 1000; int32_t Solve(int32_t n, int32_t *left, int32_t *right) { memset(left, -1, n * 4); memset(right, -1, n * 4); int32_t root; if(Query(0, 1, 0, 0)) { root = 0; right[0] = 1; } else { root = 1; left[1] = 0; } for(int32_t i = 2; i < n; i++) { if(Query(i - 1, i, i, i)) { left[i] = root; root = i; } else { right[i - 1] = i; } } return root; } /** int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); int32_t left[6], right[6]; int32_t ans = Solve(6, left, right); std::cout << ans << '\n'; for(int32_t i = 0; i < 6; i++) { std::cout << left[i] << " " << right[i] << '\n'; } } */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...