답안 #704730

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
704730 2023-03-02T20:57:58 Z beaconmc 화성 (APIO22_mars) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")



typedef long long ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)

using namespace std;


vector<int> construct_permutation(long long k)
{
	ll imp = k;
	vector<ll> ops;
	deque<ll> sus;

	while (k>1){
		if (k%3==0){
			ops.push_back(3);
			k/=3;
			continue;
		}
		if (k%2==0){
			ops.push_back(2);
			k /= 2;
		}else{
			ops.push_back(1);
			k -= 1;
		}
	}
	ll cur = 0;
	reverse(ops.begin(), ops.end());
	for (auto&i : ops){
		if (i==1) sus.push_front(cur);
		else if (i==2) sus.push_back(cur);
		else if (i==3) {
			sus.push_back(cur+1);
			sus.push_back(cur);
			cur++;
		}
		cur++;
	}
	vector<int> ans;
	for (auto&i : sus) ans.push_back(i);
	return ans;




}

Compilation message

mars.cpp: In function 'std::vector<int> construct_permutation(long long int)':
mars.cpp:15:5: warning: unused variable 'imp' [-Wunused-variable]
   15 |  ll imp = k;
      |     ^~~
/usr/bin/ld: /tmp/ccM40f21.o: in function `main':
stub.cpp:(.text.startup+0x793): undefined reference to `process(std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >, int, int, int, int)'
collect2: error: ld returned 1 exit status