Submission #775232

# Submission time Handle Problem Language Result Execution time Memory
775232 2023-07-06T08:55:18 Z Baytoro Mechanical Doll (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);
}
# Verdict Execution time Memory 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
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 5000 KB wrong serial number
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4948 KB wrong serial number
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4948 KB wrong serial number
2 Halted 0 ms 0 KB -