Submission #586198

#TimeUsernameProblemLanguageResultExecution timeMemory
586198messiuuuuuUnscrambling a Messy Bug (IOI16_messy)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include <messy.h> #define task "A" #define ll long long #define ld long double #define fi first #define se second #define pb push_back using namespace std; const int MAXN = 1e5 + 5; const ll INF = 1e18 + 5; int a[MAXN]; int n; void DNC(int l, int r) { if (l == r) { return; } int mid = (l + r) / 2; string s(n, '1'); for (int i = l; i <= r; i++) s[i] = '0'; for (int i = l; i <= mid; i++) { s[i] = '1'; add_element(s); s[i] = '0'; } DNC(l, mid); DNC(mid + 1, r); } vector<int> phan[4 * MAXN], res; void DNCAns(int id, int l, int r) { if (l == r) { res[phan[id].back()] = l; return; } string s(n, '1'); for (int i : phan[id]) { s[i] = '0'; } for (int i : phan[id]) { s[i] = '1'; if (check_element(s)) { phan[2 * id].pb(i); } else { phan[2 * id + 1].pb(i); } s[i] = '0'; } int mid = (l + r) / 2; DNCAns(2 * id, l, mid); DNCAns(2 * id + 1, mid + 1, r); } vector<int> restore_permutation(int N, int w, int r) { res.resize(N); n = N; DNC(0, n - 1); check_element(); for (int i = 0; i < n; i++) phan[1].pb(i); DNCAns(1, 0, n - 1); return res; }

Compilation message (stderr)

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:72:19: error: too few arguments to function 'bool check_element(std::string)'
   72 |     check_element();
      |                   ^
In file included from messy.cpp:2:
messy.h:7:6: note: declared here
    7 | bool check_element(std::string x);
      |      ^~~~~~~~~~~~~