Submission #1072783

#TimeUsernameProblemLanguageResultExecution timeMemory
1072783Double_SlashMinerals (JOI19_minerals)C++17
25 / 100
8 ms1112 KiB
#include "minerals.h" #include <bits/stdc++.h> using namespace std; using ll = long long; void dfs(int n, const vector<int> &a, const vector<int> &b) { if (n == 1) { Answer(a.front(), b.front()); return; } int m = (n + 1) >> 1; vector<int> al, ar, bl, br; for (int i = 0; i < m; ++i) { al.emplace_back(a[i]); Query(a[i]); } for (int i = m; i < n; ++i) { ar.emplace_back(a[i]); } for (int i = 0; i < n; ++i) { if (Query(b[i]) == m) { bl.emplace_back(b[i]); } else { br.emplace_back(b[i]); } Query(b[i]); } for (int i = 0; i < m; ++i) { Query(a[i]); } dfs(m, al, bl); dfs(n - m, ar, br); } void Solve(int N) { vector<int> a(N), b(N); iota(a.begin(), a.end(), 1); iota(b.begin(), b.end(), N + 1); dfs(N, a, b); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...