Submission #709725

#TimeUsernameProblemLanguageResultExecution timeMemory
709725gun_ganPermutation (APIO22_perm)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> construct_permutation(ll k) { int b = 63 - __builtin_clzll(k); vector<vector<int>> ans; int last = 0; for(int i = 59; i >= 0; i -= 5) { ll cur = 0; for(int j = i, z = 4; j > i - 5; j--, z--) { cur += (k >> j & 1) << z; } if(cur > 0) { ans.push_back({}); for(int j = 0; j < i - 4; j++) { ans.back().push_back(last); last++; } for(int j = 0; j < cur; j++) { ans.back().push_back(last + cur - j - 1); } last += cur; } } vector<int> ret; for(auto x : ans) { for(auto i : x) ret.push_back(i); } return ret; } int main() { cin.tie(0); ios_base::sync_with_stdio(0); }

Compilation message (stderr)

perm.cpp: In function 'std::vector<int> construct_permutation(ll)':
perm.cpp:6:6: warning: unused variable 'b' [-Wunused-variable]
    6 |  int b = 63 - __builtin_clzll(k);
      |      ^
/usr/bin/ld: /tmp/cc9L1YEI.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccqld6bJ.o:perm.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status