Submission #728733

#TimeUsernameProblemLanguageResultExecution timeMemory
728733abcvuitunggioMemory 2 (JOI16_memory2)C++17
60 / 100
1 ms340 KiB
#include "Memory2_lib.h" #include <bits/stdc++.h> using namespace std; int n; void f(vector <int> v){ random_shuffle(v.begin(),v.end()); int j=v[v.size()/2]; vector <int> ve,a[51]; for (int i:v) if (i!=j) a[Flip(i,j)].push_back(i); for (int i=0;i<n;i++){ if (a[i].empty()) continue; if (a[i].size()<3){ if (a[i].size()==1) Answer(min(a[i][0],j),max(a[i][0],j),i); else Answer(a[i][0],a[i][1],i); continue; } a[i].push_back(j); f(a[i]); } } void Solve(int T, int N){ vector <int> v; n=N; for (int i=0;i<n*2;i++) v.push_back(i); f(v); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...