제출 #1011596

#제출 시각아이디문제언어결과실행 시간메모리
1011596dimashhh순열 (APIO22_perm)C++17
0 / 100
1 ms348 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> ret,g; int hsb(ll x){ for(int i = 60;i >= 0;i--){ if((x >> i) & 1) return i; } } vector<int> construct_permutation(long long k) { int f = hsb(k); for(int i = 0;i < f;i++){ g.push_back(i); } for(int i = f - 1;i >= 0;i--){ if((k >> i) & 1){ for(int j = i;j < (int)g.size();j++){ g[j]++; } ret.push_back(g[i] - 1); } } for(int j:ret){ g.push_back(j); } return g; }

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

perm.cpp: In function 'int hsb(ll)':
perm.cpp:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...