답안 #379423

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
379423 2021-03-18T08:20:08 Z autumn_eel 자동 인형 (IOI18_doll) C++14
37 / 100
178 ms 11220 KB
#include "doll.h"
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<int(n);i++)
using namespace std;

static vector<int>rec(vector<int>v){
	if(v.size()==2)return v;
	vector<int>a,b;
	rep(i,v.size()){
		if(i%2==0)a.push_back(v[i]);
		else b.push_back(v[i]);
	}
	a=rec(a);
	b=rec(b);
	for(int i:b)a.push_back(i);
	return a;
}

void create_circuit(int M, std::vector<int> A) {
	A.push_back(0);
	int N = A.size();
	
	int n=2;while(n<N)n<<=1;
	n>>=1;

	vector<int>C(M+1);
	vector<int>X(2*n-1),Y(2*n-1);

	vector<int>idxn(2*n);
	rep(i,2*n)idxn[i]=i;
	
	auto idx=rec(idxn);

	for(int i=1;i<=2*n-1;i++){
		if(i<=n-1){
			X[i-1]=-(i*2);
			Y[i-1]=-(i*2+1);
		}
		else{
			int d=i-n;
			int l=idx[2*d],r=idx[2*d+1];
			if(l<N-1||l==2*n-1){
				X[i-1]=A[l<N-1?l:N-1];
			}
			else X[i-1]=-1;
			
			if(r<N-1||r==2*n-1){
				Y[i-1]=A[r<N-1?r:N-1];
			}
			else Y[i-1]=-1;
		}
	}
	
	rep(i,M+1)C[i]=-1;

	answer(C,X,Y);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 204 KB Output is partially correct
2 Partially correct 129 ms 10528 KB Output is partially correct
3 Partially correct 148 ms 10524 KB Output is partially correct
4 Partially correct 141 ms 11036 KB Output is partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 204 KB Output is partially correct
2 Partially correct 129 ms 10528 KB Output is partially correct
3 Partially correct 148 ms 10524 KB Output is partially correct
4 Partially correct 141 ms 11036 KB Output is partially correct
5 Partially correct 146 ms 11220 KB Output is partially correct
6 Partially correct 149 ms 11184 KB Output is partially correct
7 Partially correct 178 ms 11140 KB Output is partially correct
8 Partially correct 140 ms 11040 KB Output is partially correct
9 Partially correct 133 ms 10500 KB Output is partially correct
10 Partially correct 141 ms 11064 KB Output is partially correct
11 Partially correct 149 ms 11036 KB Output is partially correct
12 Partially correct 130 ms 10576 KB Output is partially correct
13 Partially correct 177 ms 10564 KB Output is partially correct
14 Partially correct 131 ms 10528 KB Output is partially correct
15 Partially correct 132 ms 10556 KB Output is partially correct
16 Partially correct 5 ms 588 KB Output is partially correct
17 Correct 75 ms 6872 KB Output is correct
18 Partially correct 135 ms 10528 KB Output is partially correct
19 Partially correct 135 ms 10572 KB Output is partially correct
20 Partially correct 158 ms 11008 KB Output is partially correct
21 Partially correct 155 ms 11072 KB Output is partially correct
22 Partially correct 146 ms 11040 KB Output is partially correct