제출 #726646

#제출 시각아이디문제언어결과실행 시간메모리
726646vjudge1순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define all(fl) fl.begin(),fl.end() #define pb push_back #define fi first #define se second #define for1(i,j,k) for(int i=j;i<=k;i++) #define for2(i,j,k) for(int i=j;i>=k;i--) #define for3(i,j,k,l) for(int i=j;i<=k;i+=l) #define lb lower_bound #define ub upper_bound #define sz(a) (int)a.size() #define pii pair<int,int> #define pli pair<long long,int> #define gcd __gcd #define lcm(x,y) x*y/__gcd(x,y) #define lastbit(i) __builtin_ctz(i) int[] construct_permutation(long long k){ int num=0; vector<int>vcl; while (k){ for2(i,60,0){ if ((1ll<<i)-1<=k){ k-=(1ll<<i)-1; vcl.pb(i); num+=i; } } } vector<int>ans; for (auto v:vcl){ vector<int>hjhj; int dd=v; while (dd){ hjhj.pb(num--); } reverse(all(hjhj)); for (auto u:hjhj){ ans.pb(u); } } return ans; } /*signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); //freopen(".INP","r",stdin); //freopen(".OUT","w",stdout); }*/

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

perm.cpp:18:4: error: structured binding declaration cannot have type 'int'
   18 | int[] construct_permutation(long long k){
      |    ^~
perm.cpp:18:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
perm.cpp:18:4: error: empty structured binding declaration
perm.cpp:18:7: error: expected initializer before 'construct_permutation'
   18 | int[] construct_permutation(long long k){
      |       ^~~~~~~~~~~~~~~~~~~~~