제출 #619560

#제출 시각아이디문제언어결과실행 시간메모리
619560Lobo순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#define<bits/stdc++.h> using namespace std; #define vi vector<int> vi construct_permutation(ll k) { if(k == 1) return {}; if(k == 2) return vi{0}; for(int i: {2, 3, 5, 7, 11, 13, 17, 19, 23, 29}) { if(k % i == 0 && k > i) { vi l = construct_permutation(k / i); vi r = construct_permutation(i); for(auto& x: r) x += l.size(); l.insert(l.end(), all(r)); return l; } } vi a = construct_permutation(k / 2); a.pb(a.size()); if(k & 1) a.insert(a.begin(), a.size()); return a; }

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

perm.cpp:1:8: error: macro names must be identifiers
    1 | #define<bits/stdc++.h>
      |        ^
perm.cpp:3:12: error: 'vector' does not name a type
    3 | #define vi vector<int>
      |            ^~~~~~
perm.cpp:4:1: note: in expansion of macro 'vi'
    4 | vi construct_permutation(ll k) {
      | ^~