Submission #481929

#TimeUsernameProblemLanguageResultExecution timeMemory
481929Lam_lai_cuoc_doiMeetings (JOI19_meetings)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "meetings.h" using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; template <class T> void read(T &x) { x = 0; register int c; while ((c = getchar()) && (c > '9' || c < '0')) ; for (; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - '0'; } constexpr bool typetest = 0; constexpr int N = 2e3 + 5; bool ck[N]; void Recursive(vector<int> &s) { if (s.size() < 1) return; if (s.size() == 2) { Bridge(min(s[0], s[1]), max(s[0], s[1])); return; } int u = s[0], v = s[1]; vector<int> l, r, use; for (int i = 2; i < (int)s.size(); ++i) use.emplace_back(s[i]); while (!use.empty()) { if (ck[use.back()]) { use.pop(); continue; } int z = Query(u, v, use.back()); if (z == u) r.emplace_back(z); else if (z == v) l.emplace_back(z); else { l.emplace_back(use.back()); l.emplace_back(v); v = z; } } Bridge(min(u, v), max(u, v)); for (auto i : s) ck[i] = 0; l.emplace_back(v); r.emplace_back(u); Recursive(l); Recursive(r); } void Solve(int n) { vector<int> s; for (int i = 1; i <= n; ++i) s.emplace_back(i); Recursive(s); }

Compilation message (stderr)

meetings.cpp: In function 'void read(T&)':
meetings.cpp:13:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   13 |     register int c;
      |                  ^
meetings.cpp: In function 'void Recursive(std::vector<int>&)':
meetings.cpp:44:17: error: 'class std::vector<int>' has no member named 'pop'
   44 |             use.pop();
      |                 ^~~