답안 #139409

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
139409 2019-07-31T16:16:17 Z Lawliet 자동 인형 (IOI18_doll) C++14
2 / 100
41 ms 3624 KB
#include <bits/stdc++.h>
#include "doll.h"

#define MAX 200010

using namespace std;

int N;

int tube[MAX];

vector<int> X;
vector<int> Y;
vector<int> nullVector;
vector<int> triggers;

/*void answer(vector<int> C, vector<int> xx, vector<int> yy)
{
	for(int g = 0 ; g < C.size() ; g++)
		printf("%d ",C[g]);

	printf("\n\n");

	for(int g = 0 ; g < X.size() ; g++)
		printf("%d %d\n",X[g],Y[g]);
}*/

void create_circuit(int M, vector<int> A)
{
	N = A.size();

	vector<int> aux;

	aux.push_back( 0 );
	//printf("oii\n");

	for(int g = 0 ; g < N ; g++)
		aux.push_back( A[g] );

	aux.push_back( 0 );

	memset(tube , -1 , sizeof(tube));

	for(int g = 1 ; g <= N ; g++)
		tube[ aux[g - 1] ] = aux[g];

	//trigger.push_back( 1 );

	for(int g = 0 ; g <= M ; g++)
	{
		if(tube[g] == -1) triggers.push_back( 0 );
		else triggers.push_back( tube[g] );
	}

	answer( triggers , nullVector , nullVector );
}

/*int main()
{
	int nn, mm;
	scanf("%d %d",&nn,&mm);

	vector<int> au(nn);

	for(int g = 0 ; g < nn ; g++)
		scanf("%d",&au[g]);

	create_circuit(mm , au);
}*/
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 972 KB Output is correct
2 Correct 23 ms 3144 KB Output is correct
3 Correct 27 ms 2632 KB Output is correct
4 Correct 2 ms 972 KB Output is correct
5 Correct 13 ms 2372 KB Output is correct
6 Correct 41 ms 3508 KB Output is correct
7 Correct 2 ms 972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 972 KB Output is correct
2 Correct 23 ms 3144 KB Output is correct
3 Correct 27 ms 2632 KB Output is correct
4 Correct 2 ms 972 KB Output is correct
5 Correct 13 ms 2372 KB Output is correct
6 Correct 41 ms 3508 KB Output is correct
7 Correct 2 ms 972 KB Output is correct
8 Incorrect 27 ms 3624 KB wrong motion
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 972 KB Output is correct
2 Correct 23 ms 3144 KB Output is correct
3 Correct 27 ms 2632 KB Output is correct
4 Correct 2 ms 972 KB Output is correct
5 Correct 13 ms 2372 KB Output is correct
6 Correct 41 ms 3508 KB Output is correct
7 Correct 2 ms 972 KB Output is correct
8 Incorrect 27 ms 3624 KB wrong motion
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 972 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 972 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 972 KB wrong motion
2 Halted 0 ms 0 KB -