답안 #100292

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
100292 2019-03-10T09:21:50 Z Dr_Cow 자동 인형 (IOI18_doll) C++14
0 / 100
5 ms 4576 KB
#include <bits/stdc++.h>
#include "doll.h"
using namespace std;



void create_circuit(int M, std::vector<int> A) {
	int l=A.size();
	vector <int> C (M+1,0);
	vector <int> X,Y (263000,0);
int d[263000];
//  ##	create_tree
	for (int i=1;i<l;i++){
		X[i]=-2*i;Y[i]=-(2*i+1);
	}
//  ##  create_bot
	d[0]=1;int k=1;
	for (int i=1;i<l;i*=2)
	{
		k*=2;
		for (int j=0;j<i;j++)
		{
			d[j+i]=d[j]*2;
			d[j]=d[j]*2-1;
		}
	}
//	##	transfer_bot
	for (int i=0;i<k;i++)
		{
			if (l>d[i]-1) {
				if ((k+i)%2==0) X[(k+i)/2]=A[d[i]-1];
				else
				Y[(k+i)/2]=A[d[i]-1];
				C[d[i]-1]=-1;
			}	
		}
//	##	
	answer(C, X, Y);
	
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 4576 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 4576 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 4576 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 4 ms 4528 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 4520 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 4520 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -