This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "meetings.h"
#include<bits/stdc++.h>
using namespace std;
void Solve(int n) {
set<int> S[n];
for(int i=1;i<n;i++){
for(int j=i+1;j<n;j++){
int x=Query(0,i,j);
S[i].insert(x);
}
}
queue<int> q;
q.push(0);
vector<bool> used(n);
used[0]=true;
while(!q.empty()){
int x=q.front();
q.pop();
for(int i=0;i<n;i++){
if(used[i]) continue;
if(S[i].find(x)!=S[i].end()){
S[i].erase(x);
}
if(S[i].empty() or ((int)S[i].size()==1 and *S[i].begin()==i)){
used[i]=true;
q.push(i);
Bridge(min(x,i),max(x,i));
}
}
}
}
# | 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... |