Submission #164762

#TimeUsernameProblemLanguageResultExecution timeMemory
164762maruiiMeetings (JOI19_meetings)C++14
29 / 100
241 ms1144 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; vector<int> edge[2001]; int deg[301], vis[301]; void dfs(int x) { vis[x] = 1; for (auto i : edge[x]) deg[i]--; for (auto i : edge[x]) { if (deg[i] == 0 && vis[i] == 0) { Bridge(min(x, i), max(x, i)); dfs(i); } } } void Solve(int N) { if (N > 300) assert(0); for (int i = 1; i < N; ++i) { edge[0].push_back(i); for (int j = i + 1; j < N; ++j) { int x = Query(0, i, j); if (x != j) edge[x].push_back(j); if (x != i) edge[x].push_back(i); } } for (int i = 0; i < N; ++i) { sort(edge[i].begin(), edge[i].end()); edge[i].erase(unique(edge[i].begin(), edge[i].end()), edge[i].end()); for (auto j : edge[i]) deg[j]++; } dfs(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...