Submission #481928

#TimeUsernameProblemLanguageResultExecution timeMemory
481928Lam_lai_cuoc_doiMeetings (JOI19_meetings)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.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:12:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |     register int c;
      |                  ^
meetings.cpp: In function 'void Recursive(std::vector<int>&)':
meetings.cpp:29:9: error: 'Bridge' was not declared in this scope
   29 |         Bridge(min(s[0], s[1]), max(s[0], s[1]));
      |         ^~~~~~
meetings.cpp:43:17: error: 'class std::vector<int>' has no member named 'pop'
   43 |             use.pop();
      |                 ^~~
meetings.cpp:47:17: error: 'Query' was not declared in this scope
   47 |         int z = Query(u, v, use.back());
      |                 ^~~~~
meetings.cpp:60:5: error: 'Bridge' was not declared in this scope
   60 |     Bridge(min(u, v), max(u, v));
      |     ^~~~~~