Submission #203553

#TimeUsernameProblemLanguageResultExecution timeMemory
203553abra_stoneMeetings (JOI19_meetings)C++14
29 / 100
3080 ms2300 KiB
#include "meetings.h" #include <cstring> #include <vector> #include <algorithm> #define N 20005 using namespace std; bool v1[N], v2[N]; vector<int> gr[N]; void f(int p) { int i; if (v1[p]) return; v1[p] = 1; for (i = 0; i < gr[p].size(); i++) { f(gr[p][i]); } for (i = 0; i < gr[p].size(); i++) { int ne = gr[p][i]; if (!v2[ne]) { v2[ne] = 1; Bridge(min(p, ne), max(p, ne)); } } } void Solve(int n) { int i, j, t; for (i = 1; i < n; i++) gr[0].push_back(i); for (i = 1; i < n; i++) { for (j = i + 1; j < n; j++) { t = Query(0, i, j); if (t != i) gr[t].push_back(i); if (t != j) gr[t].push_back(j); } } for (i = 0; i < n; i++) { sort(gr[i].begin(), gr[i].end()); gr[i].erase(unique(gr[i].begin(), gr[i].end()), gr[i].end()); } f(0); }

Compilation message (stderr)

meetings.cpp: In function 'void f(int)':
meetings.cpp:15:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < gr[p].size(); i++) {
              ~~^~~~~~~~~~~~~~
meetings.cpp:18:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < gr[p].size(); 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...