제출 #724088

#제출 시각아이디문제언어결과실행 시간메모리
724088AlfaGenus순열 (APIO22_perm)C++17
컴파일 에러
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(int 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; vector<int> ans = construct_permutation(k); for(int i = 0; i < k; i ++)cout<<ans[i]<<" "; cout<<endl; } } int main() { fastio int t = 1; // cin>>t; while (t--) { solve(); } }

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/ccQBNGzL.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccAZCalJ.o:perm.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccQBNGzL.o: in function `main':
grader.cpp:(.text.startup+0x240): undefined reference to `construct_permutation(long long)'
collect2: error: ld returned 1 exit status