Submission #1172196

#TimeUsernameProblemLanguageResultExecution timeMemory
1172196nicolo_010Machine (IOI24_machine)C++20
Compilation error
0 ms0 KiB
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll  = long long;
using pii = pair<int, int>;
#define rep(i, k, n) for (int i = k; i < n; i++)
#define print(vec) for (auto x : vec) cout << x << " "; cout << "\n"
#define input(vec) for (int i = 0; i < vec.size(); i++) cin >> vec[i]
template<typename T>
using v = vector<T>;
template<typename T>
using pq = priority_queue<T, vector<T>, greater<T>>;
const int MOD = 1e9+7;

v<int> find_permutation(int N) {
    int n = N;
    v<int> a(n, 0);
    v<int> aux = use_machine(a);
    int x = aux[0];
    v<int> ans(n);
    map<int, int> mp;
    rep(i, 0, n) {
        ans[i] = i;
        mp[i^x] = i; 
    }
    //print(ans);
    ans = use_machine(ans);
    //print(ans);
    v<int> toreturn(n);
    rep(i, 0, n) {
        toreturn[i] = mp[ans[i]];
    }
    return toreturn;
}

Compilation message (stderr)

machine.cpp: In function 'v<int> find_permutation(int)':
machine.cpp:18:18: error: 'use_machine' was not declared in this scope
   18 |     v<int> aux = use_machine(a);
      |                  ^~~~~~~~~~~