Submission #945005

#TimeUsernameProblemLanguageResultExecution timeMemory
945005dsyzChameleon's Love (JOI20_chameleon)C++17
0 / 100
14 ms596 KiB
#include <bits/stdc++.h> #include "chameleon.h" using namespace std; using ll = long long; #define MAXN (1000005) void Solve(int N) { vector<pair<ll,ll> > v; bool done[2 * N]; memset(done,0,sizeof(done)); for(ll i = 0;i < 2*N;i++){ if(done[i]) continue; for(ll j = i + 1;j < 2*N;j++){ if(done[i]) break; if(done[j]) continue; vector<int> p(2); p[0] = i + 1; p[1] = j + 1; ll colours = Query(p); if(colours == 1){ v.push_back({i,j}); done[i] = 1; done[j] = 1; break; } } } for(ll i = 0;i < N;i++){ Answer(v[i].first + 1,v[i].second + 1); } }
#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...