Submission #724085

#TimeUsernameProblemLanguageResultExecution timeMemory
724085AlfaGenusPermutation (APIO22_perm)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;

// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

#define ll long long
#define str string

#define fastio ios::sync_with_stdio(0), cin.tie(0);
#define fs first
#define ss second
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define len(x) x.size()

#define ran(value, start, stop, step) for (int value = start; value < stop; value += step)
#define ran1(value, start, stop) ran(value, start, stop, 1)
#define ran2(value, stop) ran(value, 0, stop, 1)

#define print(a)          \
    for (auto &x : a)     \
        cout << x << " "; \
    cout << endl;

#define printmp(a)    \
    for (auto &x : a) \
        cout << x.fs << " " << x.ss << endl;

const ll mod = 1e9 + 7;
const ll INF = LLONG_MAX;
const ll NEG_INF = LLONG_MIN;

vector<int> construct_permutation(n){
    vector<int> ans(n);
    for(int i = 0; i < n; i ++)
        ans[i] = n - i - 1;
    return ans;
}

void solve()
{
    int q;
    cin>>q;
    for(int i = 0; i < q; i ++){
        int k;
        cin>>k;
        print(construct_permutation(n));
    }
}

signed main()
{
    fastio int t = 1;
    // cin>>t;
    while (t--)
    {
        solve();
    }
}

Compilation message (stderr)

perm.cpp:35:35: error: 'n' was not declared in this scope; did you mean 'yn'?
   35 | vector<int> construct_permutation(n){
      |                                   ^
      |                                   yn
perm.cpp:35:37: error: expected ',' or ';' before '{' token
   35 | vector<int> construct_permutation(n){
      |                                     ^
perm.cpp: In function 'void solve()':
perm.cpp:49:37: error: 'n' was not declared in this scope
   49 |         print(construct_permutation(n));
      |                                     ^
perm.cpp:23:20: note: in definition of macro 'print'
   23 |     for (auto &x : a)     \
      |                    ^