Submission #1000252

#TimeUsernameProblemLanguageResultExecution timeMemory
1000252UnforgettableplChameleon's Love (JOI20_chameleon)C++17
4 / 100
20 ms456 KiB
#include <bits/stdc++.h> using namespace std; int Query(const std::vector<int> &p); void Answer(int a, int b); void Solve(int N) { int n = N; vector<bool> visited(2*n+1); for(int i=1;i<=2*n;i++){ if(visited[i])continue; visited[i]=true; int ans = 1; for(int jump=512;jump;jump/=2){ if(ans+jump>2*n)continue; vector<int> q; for(int j=1;j<ans+jump;j++)if(!visited[j])q.emplace_back(j); auto base = Query(q); q.emplace_back(i); if(Query(q)!=base)ans+=jump; } visited[ans]=true; Answer(i,ans); } }
#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...