Submission #915630

#TimeUsernameProblemLanguageResultExecution timeMemory
915630guagua0407Meetings (JOI19_meetings)C++17
0 / 100
1669 ms712 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...