제출 #912362

#제출 시각아이디문제언어결과실행 시간메모리
912362huyngo순열 (APIO22_perm)C++17
0 / 100
0 ms348 KiB
#include "perm.h" std::vector<int> construct_permutation(long long k) { std::vector<int> a; long long l = 0, r = 0, dd = 0; auto work = [&](auto self, long long x) -> void { if (x & 1) { a.push_back(--l); dd = l; self(self, x - 1); } else { a.push_back(++r); self(self, x >> 1); } }; for (auto& x : a) x -= dd; return a; }

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

perm.cpp: In function 'std::vector<int> construct_permutation(long long int)':
perm.cpp:7:10: warning: variable 'work' set but not used [-Wunused-but-set-variable]
    7 |     auto work = [&](auto self, long long x) -> void {
      |          ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...