답안 #775232

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
775232 2023-07-06T08:55:18 Z Baytoro 자동 인형 (IOI18_doll) C++17
2 / 100
42 ms 10372 KB
#include "doll.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
const int NN=2e5+5;
vector<int> g[NN];
vector<int> x,y;
#define pb push_back
void create_circuit(int m, vector<int> a) {
	int n=a.size();
	vector<int> c(m+1);
	c[0]=a[0];
	for(int i=0;i<n-1;i++){
		g[a[i]].push_back(a[i+1]);
		c[a[i]]=a[i+1];
	}
	int id=-1;
	for(int i=1;i<=m;i++){
		int sz=g[i].size();
		if(sz<=1) continue;
		c[i]=id--;
		if(sz==2){
			x.pb(g[i][0]);
			y.pb(g[i][1]);
		}
		else if(sz==3){
			x.pb(id--);
			y.pb(id--);
			x.pb(c[i]);
			y.pb(g[i][1]);
			x.pb(g[i][0]);
			y.pb(g[i][2]);
		}
		else if(sz==4){
			x.pb(id--);
			y.pb(id--);
			x.pb(g[i][0]);
			y.pb(g[i][2]);
			x.pb(g[i][1]);
			y.pb(g[i][3]);
		}
	}
	answer(c,x,y);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4948 KB Output is correct
2 Correct 20 ms 8660 KB Output is correct
3 Correct 17 ms 8276 KB Output is correct
4 Correct 2 ms 4948 KB Output is correct
5 Correct 10 ms 6100 KB Output is correct
6 Correct 28 ms 10004 KB Output is correct
7 Correct 3 ms 4948 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4948 KB Output is correct
2 Correct 20 ms 8660 KB Output is correct
3 Correct 17 ms 8276 KB Output is correct
4 Correct 2 ms 4948 KB Output is correct
5 Correct 10 ms 6100 KB Output is correct
6 Correct 28 ms 10004 KB Output is correct
7 Correct 3 ms 4948 KB Output is correct
8 Incorrect 42 ms 10372 KB wrong motion
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4948 KB Output is correct
2 Correct 20 ms 8660 KB Output is correct
3 Correct 17 ms 8276 KB Output is correct
4 Correct 2 ms 4948 KB Output is correct
5 Correct 10 ms 6100 KB Output is correct
6 Correct 28 ms 10004 KB Output is correct
7 Correct 3 ms 4948 KB Output is correct
8 Incorrect 42 ms 10372 KB wrong motion
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 5000 KB wrong serial number
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4948 KB wrong serial number
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4948 KB wrong serial number
2 Halted 0 ms 0 KB -