Submission #921510

#TimeUsernameProblemLanguageResultExecution timeMemory
9215101075508020060209tcMeetings (JOI19_meetings)C++14
17 / 100
3051 ms11352 KiB
#pragma GCC optimize("O3") #include "meetings.h" #include<bits/stdc++.h> using namespace std; //#define int long long #define X first #define Y second #define SZ(x) (int)(x).size() map<vector<int>,int>mp; int n; int query(int a,int b,int c){ vector<int>vc={a,b,c}; sort(vc.begin(),vc.end()); if(mp[vc]){return mp[vc];} mp[vc]=Query(vc[0],vc[1],vc[2])+1; return mp[vc]; } pair<int,int>slv(int st,int en){ int ret=en; for(int i=1;i<=n;i++){ if(i==st||i==ret){continue;} int v=query(st-1,i-1,ret-1); //v++; if(v==st||v==ret){continue;} ret=v; } return {min(st,ret)-1,max(st,ret)-1}; } void Solve(int N){ set<pair<int,int>>ans; n=N; for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ ans.insert(slv(i,j)); } } for(auto it=ans.begin();it!=ans.end();it++){ Bridge((*it).first, (*it).second ); } } /* signed main(){ } */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...