This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |