제출 #709732

#제출 시각아이디문제언어결과실행 시간메모리
709732gun_gan순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; static long long MX=1e18; vector<int> construct_permutation(long long 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(k == 33) cout << i << " " << cur << '\n'; 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 - 1; j++) { ans.back().push_back(last + cur - j - 1); } last += cur - 1; } if(k == 33) { for(auto x : ans) { for(auto i : x) cout << i << " "; } cout << '\n'; } } vector<int> ret; for(auto x : ans) { for(auto i : x) ret.push_back(i); } return ret; } // long long count_increasing(vector<int>& v) { // vector<long long> dp(v.size() + 1, 0); // dp[0] = 1; // for (int x : v) // { // for (int i = 0; i <= x; i++) // { // dp[x+1] += dp[i]; // dp[x+1] = min(dp[x+1],MX+1); // } // } // long long result = 0; // for (int i = 0; i <= (int)v.size(); i++){ // result += dp[i]; // result = min(result,MX+1); // } // return result; // } int main() { cin.tie(0); ios_base::sync_with_stdio(0); // cout << (long long)(1LL << 55) * 24 - ((1LL << 59) + (1LL << 58)) << '\n'; // for(int i = 1; i <= 100; i++) { // auto v = construct_permutation(i); // if(count_increasing(v) != i) { // cout << i << '\n'; // for(auto x : v) cout << x << " "; // cout << '\n'; // break; // } // } }

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

perm.cpp:5:18: warning: 'MX' defined but not used [-Wunused-variable]
    5 | static long long MX=1e18;
      |                  ^~
/usr/bin/ld: /tmp/ccNOlo2v.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccpFj6ey.o:perm.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status