| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 311597 | amunduzbaev | 자동 인형 (IOI18_doll) | C++14 | 65 ms | 8012 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//#include "grader.cpp"
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int n,m;
vector<int> x, y;
int ind=1;
void solve(int l,int r,vector<int>v,char o){
if(o=='l'){
if(l!=r) x.push_back(-ind);
else {
x.push_back(v[l]);
return;
}
}else{
if(l!=r) y.push_back(-ind);
else {
y.push_back(v[l]);
return;
}
}
int m=(l+r)/2;
o='l';
ind++;
solve(l,m,v,o);
o='r';
ind++;
solve(m+1,r,v,o);
}
void fun(vector<int>v){
//cout<<ind<<" \n";
ind++;
int l=0,r=v.size()-1;
int m=(l+r)/2;
solve(l,m,v,'l');
ind++;
solve(m+1,r,v,'r');
}
void create_circuit(int M, vector<int> a) {
n=a.size();
m=M;
vector<int>c(m+1,0),ans(m,0),way[m+1];
way[0].push_back(a[0]);
c[0]=a[0];
for(int i=0;i<n-1;i++){
if(way[a[i]].size()){
ans[a[i]]=1;
}
way[a[i]].push_back(a[i+1]);
c[a[i]]=a[i+1];
}
for(int i=0;i<ans.size();i++){
if(ans[i]==1){
c[ans[i]]=-ind;
fun(way[ans[i]]);
}
}
/*
for(int i=0;i<c.size();i++)
cout<<c[i]<<" ";
cout<<"\n";
cout<<x.size()<<" "<<y.size()<<" s\n";
for(int i=0;i<x.size();i++)
cout<<x[i]<<" "<<y[i]<<" \n";
*/
answer(c,x,y);
}
/*
9 9
2 9 8 1 3 7 6 4 5
4 4
1 2 1 3
6 6
1 2 1 3 1 4
*/
컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
