Submission #1027658

#TimeUsernameProblemLanguageResultExecution timeMemory
1027658vjudge1Meetings (JOI19_meetings)C++17
0 / 100
1421 ms600 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; void Solve(int N) { int sz[N] = {}; int o[N] = {}; vector<int> chil[N]; sz[0] = N; for (int i = 1; i < N; i++) { for (int j = 1; j < N; j++) { if (i == j) continue; if (Query(0, i, j) == i) { sz[i]++; chil[i].push_back(j); } } o[i] = i; } sort(o, o + N, [&](int i, int j) { return sz[i] < sz[j]; }); bool us[N] = {}; for (int cur : o) { for (int v : chil[cur]) { if (us[v]) continue; us[v] = true; Bridge(cur, v); } } for (int i = 1; i < N; i++) if (!us[i]) Bridge(0, 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...