Submission #203356

#TimeUsernameProblemLanguageResultExecution timeMemory
203356t12345Meetings (JOI19_meetings)C++14
29 / 100
422 ms262148 KiB
#include "meetings.h" #include <algorithm> #include <vector> using namespace std; vector<int> tr[305]; int vt[305], dg[305]; void f(int p) { vt[p] = 1; for(auto x:tr[p]) dg[x]--; for(auto x:tr[p]) { if(!dg[x] && !vt[x]) { Bridge(min(x, p), max(x, p)); f(x); } } } void Solve(int N) { int i, j, re; for(i=1; i<N; i++) { tr[0].push_back(i); for(j=i+1; j<N; j++) { re = Query(0, i, j); if(re != i) tr[re].push_back(i); if(re != j) tr[re].push_back(j); } } for(i=0; i<N; i++) { sort(tr[i].begin(), tr[i].end()); tr[i].erase(unique(tr[i].begin(), tr[i].end()), tr[i].end()); for(auto x:tr[i]) dg[x]++; } f(0); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...