Submission #585622

# Submission time Handle Problem Language Result Execution time Memory
585622 2022-06-29T06:30:03 Z LIF Mechanical Doll (IOI18_doll) C++14
16 / 100
76 ms 12568 KB
#include "doll.h"
#include<bits/stdc++.h>
using namespace std;
void create_circuit(int M, std::vector<int> A) {
  int N = A.size();
  std::vector<int> x,y;
  std::vector<int> c(M+1);
  int n = N;
  vector<int> node[100005];
  int tt = A[0];
  c[0] = tt;
  node[0].push_back(tt);
  for(int i=0; i<=n-2; i++)
  {
  	int xx = A[i];
  	int kk = A[i+1];
	node[xx].push_back(kk);  	
  }
  node[A[n-1]].push_back(0);
  int fir=0;
  for(int i=1;i<=M;i++)
  {
  	int sum = node[i].size();
  	if(sum==1)
  	{
  		c[i] = node[i][0];
	}
	if(sum==2)
	{
		fir++;
		c[i] = 0-fir;
		x.push_back(node[i][0]);
		y.push_back(node[i][1]);
	}
	if(sum == 3 || sum ==4)
	{
		fir++;
		int ff = fir;
		c[i] = 0-fir;
		x.push_back(-(fir+1));
		y.push_back(-(fir+2));
		if(sum == 3)
		{
			x.push_back(node[i][0]);
			x.push_back(node[i][1]);
			y.push_back(-ff);
			y.push_back(node[i][2]);
			fir+=2;
		}
		else
		{
			x.push_back(node[i][0]);
			x.push_back(node[i][1]);
			y.push_back(node[i][2]);
			y.push_back(node[i][3]);
			fir+=2;
		}
	}
  }
  
  
  answer(c,x,y);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2644 KB Output is correct
2 Correct 23 ms 6460 KB Output is correct
3 Correct 20 ms 6008 KB Output is correct
4 Correct 2 ms 2604 KB Output is correct
5 Correct 9 ms 3796 KB Output is correct
6 Correct 30 ms 7772 KB Output is correct
7 Correct 2 ms 2644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2644 KB Output is correct
2 Correct 23 ms 6460 KB Output is correct
3 Correct 20 ms 6008 KB Output is correct
4 Correct 2 ms 2604 KB Output is correct
5 Correct 9 ms 3796 KB Output is correct
6 Correct 30 ms 7772 KB Output is correct
7 Correct 2 ms 2644 KB Output is correct
8 Correct 44 ms 8152 KB Output is correct
9 Correct 53 ms 8768 KB Output is correct
10 Correct 65 ms 11328 KB Output is correct
11 Correct 2 ms 2644 KB Output is correct
12 Correct 2 ms 2644 KB Output is correct
13 Correct 2 ms 2644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2644 KB Output is correct
2 Correct 23 ms 6460 KB Output is correct
3 Correct 20 ms 6008 KB Output is correct
4 Correct 2 ms 2604 KB Output is correct
5 Correct 9 ms 3796 KB Output is correct
6 Correct 30 ms 7772 KB Output is correct
7 Correct 2 ms 2644 KB Output is correct
8 Correct 44 ms 8152 KB Output is correct
9 Correct 53 ms 8768 KB Output is correct
10 Correct 65 ms 11328 KB Output is correct
11 Correct 2 ms 2644 KB Output is correct
12 Correct 2 ms 2644 KB Output is correct
13 Correct 2 ms 2644 KB Output is correct
14 Correct 76 ms 11992 KB Output is correct
15 Correct 47 ms 8332 KB Output is correct
16 Correct 65 ms 11288 KB Output is correct
17 Correct 2 ms 2644 KB Output is correct
18 Correct 1 ms 2644 KB Output is correct
19 Correct 2 ms 2644 KB Output is correct
20 Correct 74 ms 12568 KB Output is correct
21 Correct 2 ms 2644 KB Output is correct
22 Correct 2 ms 2644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2644 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2588 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2588 KB wrong motion
2 Halted 0 ms 0 KB -