#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 |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
14 ms |
856 KB |
Output is correct |
15 |
Correct |
11 ms |
856 KB |
Output is correct |
16 |
Correct |
10 ms |
856 KB |
Output is correct |
17 |
Correct |
11 ms |
856 KB |
Output is correct |
18 |
Correct |
11 ms |
856 KB |
Output is correct |
19 |
Correct |
11 ms |
856 KB |
Output is correct |
20 |
Correct |
9 ms |
756 KB |
Output is correct |
21 |
Correct |
10 ms |
608 KB |
Output is correct |
22 |
Correct |
10 ms |
820 KB |
Output is correct |
23 |
Correct |
13 ms |
1108 KB |
Output is correct |
24 |
Correct |
17 ms |
1112 KB |
Output is correct |
25 |
Correct |
16 ms |
1112 KB |
Output is correct |
26 |
Correct |
26 ms |
2452 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
14 ms |
856 KB |
Output is correct |
15 |
Correct |
11 ms |
856 KB |
Output is correct |
16 |
Correct |
10 ms |
856 KB |
Output is correct |
17 |
Correct |
11 ms |
856 KB |
Output is correct |
18 |
Correct |
11 ms |
856 KB |
Output is correct |
19 |
Correct |
11 ms |
856 KB |
Output is correct |
20 |
Correct |
9 ms |
756 KB |
Output is correct |
21 |
Correct |
10 ms |
608 KB |
Output is correct |
22 |
Correct |
10 ms |
820 KB |
Output is correct |
23 |
Correct |
13 ms |
1108 KB |
Output is correct |
24 |
Correct |
17 ms |
1112 KB |
Output is correct |
25 |
Correct |
16 ms |
1112 KB |
Output is correct |
26 |
Correct |
26 ms |
2452 KB |
Output is correct |
27 |
Incorrect |
1807 ms |
11352 KB |
Wrong Answer [2] |
28 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3051 ms |
3108 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |