답안 #1095855

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1095855 2024-10-03T10:35:42 Z owoovo 자동 인형 (IOI18_doll) C++17
16 / 100
66 ms 19248 KB
#include "doll.h"
#include<bits/stdc++.h>
#define F first 
#define S second 
using namespace std;
int m,n,c[800010],x[800010],y[800010],now;
vector<int> e[200010];
vector<int> a;
void create_circuit(int M, std::vector<int> A) {
	now=0;
	n=A.size();
	m=M;
	a=A;
	a.push_back(0);
	for(int i=0;i<n;i++){
		//cout<<a[i]<<" "<<a[i+1]<<'\n';
		e[a[i]].push_back(a[i+1]);
	}
	c[0]=a[0];
	for(int i=1;i<=m;i++){
		int ne=e[i].size();
		if(ne==0)continue;
		if(ne==1){
			c[i]=e[i][0];
			continue;
		}
		if(ne==2){
			now--;
			c[i]=now;
			x[-now]=e[i][0];
			y[-now]=e[i][1];
			continue;
		}
		if(ne==3){
			now--;
			c[i]=now;
			x[-now]=now-1;
			y[-now]=now-2;
			now--;
			x[-now]=now+1;
			y[-now]=e[i][1];
			now--;
			x[-now]=e[i][0];
			y[-now]=e[i][2];
		}
		if(ne==4){
			now--;
			c[i]=now;
			x[-now]=now-1;
			y[-now]=now-2;
			now--;
			x[-now]=e[i][0];
			y[-now]=e[i][2];
			now--;
			x[-now]=e[i][1];
			y[-now]=e[i][3];
		}
	}
	vector<int> C,X,Y;
	C.resize(M+1);
	X.resize(-now);
	Y.resize(-now);
	for(int i=0;i<=m;i++)C[i]=c[i];
	for(int i=0;i<-now;i++){
		X[i]=x[i+1];
		Y[i]=y[i+1];
	}
	answer(C,X,Y);
	return;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4952 KB Output is correct
2 Correct 18 ms 9560 KB Output is correct
3 Correct 15 ms 9040 KB Output is correct
4 Correct 3 ms 4956 KB Output is correct
5 Correct 8 ms 6236 KB Output is correct
6 Correct 24 ms 11072 KB Output is correct
7 Correct 2 ms 4952 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4952 KB Output is correct
2 Correct 18 ms 9560 KB Output is correct
3 Correct 15 ms 9040 KB Output is correct
4 Correct 3 ms 4956 KB Output is correct
5 Correct 8 ms 6236 KB Output is correct
6 Correct 24 ms 11072 KB Output is correct
7 Correct 2 ms 4952 KB Output is correct
8 Correct 31 ms 12316 KB Output is correct
9 Correct 53 ms 12872 KB Output is correct
10 Correct 56 ms 16176 KB Output is correct
11 Correct 2 ms 4956 KB Output is correct
12 Correct 3 ms 4956 KB Output is correct
13 Correct 3 ms 4956 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4952 KB Output is correct
2 Correct 18 ms 9560 KB Output is correct
3 Correct 15 ms 9040 KB Output is correct
4 Correct 3 ms 4956 KB Output is correct
5 Correct 8 ms 6236 KB Output is correct
6 Correct 24 ms 11072 KB Output is correct
7 Correct 2 ms 4952 KB Output is correct
8 Correct 31 ms 12316 KB Output is correct
9 Correct 53 ms 12872 KB Output is correct
10 Correct 56 ms 16176 KB Output is correct
11 Correct 2 ms 4956 KB Output is correct
12 Correct 3 ms 4956 KB Output is correct
13 Correct 3 ms 4956 KB Output is correct
14 Correct 58 ms 19248 KB Output is correct
15 Correct 35 ms 13036 KB Output is correct
16 Correct 48 ms 17460 KB Output is correct
17 Correct 3 ms 4956 KB Output is correct
18 Correct 2 ms 5124 KB Output is correct
19 Correct 3 ms 4956 KB Output is correct
20 Correct 66 ms 18932 KB Output is correct
21 Correct 3 ms 4952 KB Output is correct
22 Correct 2 ms 4956 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4972 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4952 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4952 KB wrong motion
2 Halted 0 ms 0 KB -