Submission #243604

#TimeUsernameProblemLanguageResultExecution timeMemory
243604osaaateiasavtnlMeetings (JOI19_meetings)C++14
29 / 100
3085 ms4652 KiB
#include "meetings.h" #include<bits/stdc++.h> using namespace std; #define ii pair <int, int> #define app push_back #define all(a) a.begin(), a.end() #define bp __builtin_popcountll #define ll long long #define mp make_pair #define f first #define s second #define Time (double)clock()/CLOCKS_PER_SEC #define debug(x) std::cout << #x << ": " << x << '\n'; const int N = 2007; bool par[N][N]; //is j parent of i int sub[N]; int fath[N]; void Solve(int n) { for (int i = 1; i < n; ++i) for (int j = i + 1; j < n; ++j) { int x = Query(0, i, j); if (x == i) ++par[j][i]; else if (x == j) ++par[i][j]; } sub[0] = n; for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) sub[i] += par[j][i]; for (int i = 1; i < n; ++i) { fath[i] = 0; for (int j = 0; j < n; ++j) { if (par[i][j] && sub[j] < sub[fath[i]]) { fath[i] = j; } } int u = i, v = fath[i]; if (v < u) swap(u, v); Bridge(u, v); } }

Compilation message (stderr)

meetings.cpp: In function 'void Solve(int)':
meetings.cpp:24:27: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
                 ++par[j][i];
                           ^
meetings.cpp:26:27: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
                 ++par[i][j];
                           ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...