제출 #118176

#제출 시각아이디문제언어결과실행 시간메모리
118176scanhexMeetings (JOI19_meetings)C++17
0 / 100
3011 ms9380 KiB
#include "meetings.h" //#include "grader.h" #include<bits/stdc++.h> using namespace std; map<vector<int>,int>mp; int que(int a,int b,int c){ vector<int>v={a,b,c}; sort(v.begin(),v.end()); if(mp.count(v))return mp[v]; return mp[v]=Query(v[0],v[1],v[2]); } using uint=unsigned int; uint seed=239239239; uint xrand(){ seed^=seed<<2; seed^=seed>>7; seed^=seed<<7; return seed; } void solve(vector<int>v){ // for(auto&x:v) // cerr<<x<<' '; // cerr<<'\n'; if(v.size()<=1)return; int kek=v[xrand()%v.size()]; int cur=v[0]==kek?v[1]:v[0]; vector<int>nw={cur}; for(int x:v){ if(x==cur||x==kek)continue; int mem=que(x,cur,kek); if(mem==kek) ; else if(mem==cur) nw.push_back(x); else nw.push_back(x),cur=mem; } Bridge(min(kek,cur),max(kek,cur)); solve(nw); vector<int>other; for(int x:v) if(!count(nw.begin(),nw.end(),x))other.push_back(x); solve(other); } void Solve(int n) { mp.clear(); vector<int>ord(n); iota(ord.begin(),ord.end(),0); solve(ord); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...