답안 #911277

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
911277 2024-01-18T17:35:16 Z LuciferGoku 순열 (APIO22_perm) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>

using namespace std;
using ll = long long int;
#define int long long

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t;
    while(t--){
        int x;
        cin >> x;
        vector<int> ans;
        int j=0;
        while((1LL<<j)<=x) j++;
        j--;
        for(int i=1; i<=j; i++) ans.push_back(i);
        x-=(1LL<<j);
        // cout << x << endl;
        while(x!=0){
            j=0;
            while((1LL<<j)<=x) j++;
            ans.push_back(j);
            j--;
            x-=(1LL<<j);
        }
        cout << ans.size() << endl;
        for(auto i: ans){
            cout << i << " ";
        }
        cout << endl;
    }
    return 0;
}

Compilation message

/usr/bin/ld: /tmp/cc7eprNt.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc8vTVzv.o:perm.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc7eprNt.o: in function `main':
grader.cpp:(.text.startup+0x240): undefined reference to `construct_permutation(long long)'
collect2: error: ld returned 1 exit status