Submission #775226

# Submission time Handle Problem Language Result Execution time Memory
775226 2023-07-06T08:53:13 Z Baytoro Mechanical Doll (IOI18_doll) C++17
2 / 100
37 ms 10424 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{
			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);
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 4948 KB Output is correct
2 Correct 22 ms 8716 KB Output is correct
3 Correct 18 ms 8356 KB Output is correct
4 Correct 3 ms 4948 KB Output is correct
5 Correct 10 ms 6100 KB Output is correct
6 Correct 27 ms 10020 KB Output is correct
7 Correct 3 ms 4948 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 4948 KB Output is correct
2 Correct 22 ms 8716 KB Output is correct
3 Correct 18 ms 8356 KB Output is correct
4 Correct 3 ms 4948 KB Output is correct
5 Correct 10 ms 6100 KB Output is correct
6 Correct 27 ms 10020 KB Output is correct
7 Correct 3 ms 4948 KB Output is correct
8 Incorrect 37 ms 10424 KB wrong motion
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 4948 KB Output is correct
2 Correct 22 ms 8716 KB Output is correct
3 Correct 18 ms 8356 KB Output is correct
4 Correct 3 ms 4948 KB Output is correct
5 Correct 10 ms 6100 KB Output is correct
6 Correct 27 ms 10020 KB Output is correct
7 Correct 3 ms 4948 KB Output is correct
8 Incorrect 37 ms 10424 KB wrong motion
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 4996 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4948 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4948 KB wrong motion
2 Halted 0 ms 0 KB -