이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "fun.h"
#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 +5;
vector<int> createFunTour(int N, int Q) {
/*
int H = hoursRequired(0, N - 1);
int A = attractionsBehind(0, N - 1);
*/
int two = 2;
int p = 1;
vector<vector<int>> level;
vector<int> l,r;
while(p < N){
vector<int> curr;
for(int i=0;i<two;i++){
if(p >= N)break;
if(i < (two/2))l.push_back(p++);
else r.push_back(p++);
//curr.push_back(p++);
}
//level.push_back(curr);
two *= 2;
}
reverse(l.begin(),l.end());
reverse(r.begin(),r.end());
/*
for(auto i:l)cerr<<i<<" ";
cerr<<'\n';
for(auto i:r)cerr<< i <<" ";
cerr<<'\n';
*/
vector<int> res;
vector<bool> vis(N+1,0);
if(l.size() > r.size())swap(l,r);
for(int i=0;i<(int)l.size();i++){
//cout << r[i] <<" "<<l[i] <<" ";
res.push_back(r[i]);
res.push_back(l[i]);
vis[r[i]] = vis[l[i]] = 1;
}
if((int)l.size() < (int)r.size()){
res.push_back(r[(int)l.size()]);
vis[r[(int)l.size()]] = 1;
}
res.push_back(0);
vector<int> hard = {8,4,7,1,3};
for(int i=(int)l.size()+1;i<(int)r.size()-5;i++){
res.push_back(r[i]);
}
for(auto i:hard)if(!vis[i])res.push_back(i);
//for(auto i:res)cout<<i<<" ";
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |