제출 #980624

#제출 시각아이디문제언어결과실행 시간메모리
980624Nexus순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; const ll N=1e6+9,M=2e18+9,mod=1e9+7; ll a[66],q,k,x,y,z; vector<int>v; ll Po(ll X,ll Y) { if(!Y)return 1; if(Y&1)return X*Po(X,Y-1); ll ret=Po(X,Y/1); return ret*ret; } ll lo(ll k) { ll g=0; while(k>1)k/=2,++g; return g; } vector<int>construct_permutation(ll k) { x=lo(k); v.clear(); y=x-1;    k-=Po(2,x); for(ll i=62;i>=0;--i) {        if(k>=Po(2,i))k-=Po(2,i),a[i]=1,++y;else a[i]=0; } for(ll i=0;i<x;++i) { if(a[i])v.push_back(y),--y; v.push_back(i); } return v; }

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

perm.cpp:31:2: error: extended character   is not valid in an identifier
   31 |     k-=Po(2,x);
      |  ^
perm.cpp:31:5: error: extended character   is not valid in an identifier
   31 |     k-=Po(2,x);
      |    ^
perm.cpp:34:2: error: extended character   is not valid in an identifier
   34 |         if(k>=Po(2,i))k-=Po(2,i),a[i]=1,++y;else a[i]=0;
      |  ^
perm.cpp:34:5: error: extended character   is not valid in an identifier
   34 |         if(k>=Po(2,i))k-=Po(2,i),a[i]=1,++y;else a[i]=0;
      |    ^
perm.cpp:34:8: error: extended character   is not valid in an identifier
   34 |         if(k>=Po(2,i))k-=Po(2,i),a[i]=1,++y;else a[i]=0;
      |      ^
perm.cpp:34:11: error: extended character   is not valid in an identifier
   34 |         if(k>=Po(2,i))k-=Po(2,i),a[i]=1,++y;else a[i]=0;
      |        ^
perm.cpp: In function 'std::vector<int> construct_permutation(long long int)':
perm.cpp:31:2: error: '\U000000a0' was not declared in this scope
   31 |     k-=Po(2,x);
      |  ^
perm.cpp:34:4: error: expected ';' before '\U000000a0'
   34 |         if(k>=Po(2,i))k-=Po(2,i),a[i]=1,++y;else a[i]=0;
      |   ^~
      |   ;
perm.cpp:34:49: error: 'else' without a previous 'if'
   34 |         if(k>=Po(2,i))k-=Po(2,i),a[i]=1,++y;else a[i]=0;
      |                                             ^~~~