Submission #800754

# Submission time Handle Problem Language Result Execution time Memory
800754 2023-08-01T19:57:39 Z biank Mechanical Doll (IOI18_doll) C++14
2 / 100
15 ms 3028 KB
#include "doll.h"
#include <bits/stdc++.h>

using namespace std;

#define SIZE(x) (int)x.size()

void create_circuit(int M, vector<int> A) {
  int N = SIZE(A);
  vector<int> C(M+1, -1), X(0), Y(0);
  int k = 0;
  for (int i=0; i<N; i++) {
	  C[k] = A[i];
	  k = A[i];
  }
  C[k] = 0;
  for (int i=0; i<=M; i++) {
	  if (C[i] == -1) {
		  C[i] = i;
	  }
  }
  /*for (int i=0; i<=M; i++) {
	  cerr << C[i] << " ";
  }
  cerr << endl;*/
  
  /*vector <int> C(M+1);
  vector <int> X(N-1), Y(N-1);
  C[0] = 1;
  if (N == 1) {
	  C[1] = 0;
	  answer(C,X,Y);
	  return;
	}
	
	if (N == 2) {
		C[1] = -1;
		X[0] = 1;
		Y[0] = 0;
		answer(C,X,Y);
		return;
	}
	
	C[1] = -1;
	X[0] = 1;
	Y[0] = -2;
	
	
	for (int i=1; i<N-2; i++) {
		X[i] = -i;
		Y[i] = -i-2;
		//cerr << X[i] << ' ' << Y[i] << endl;
	}
	
	X[N-2] = -N+2;
	Y[N-2] = 0;*/
  
  answer(C, X, Y);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 13 ms 2360 KB Output is correct
3 Correct 10 ms 1964 KB Output is correct
4 Correct 0 ms 300 KB Output is correct
5 Correct 8 ms 1364 KB Output is correct
6 Correct 15 ms 2928 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 13 ms 2360 KB Output is correct
3 Correct 10 ms 1964 KB Output is correct
4 Correct 0 ms 300 KB Output is correct
5 Correct 8 ms 1364 KB Output is correct
6 Correct 15 ms 2928 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Incorrect 15 ms 3028 KB wrong motion
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 13 ms 2360 KB Output is correct
3 Correct 10 ms 1964 KB Output is correct
4 Correct 0 ms 300 KB Output is correct
5 Correct 8 ms 1364 KB Output is correct
6 Correct 15 ms 2928 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Incorrect 15 ms 3028 KB wrong motion
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB wrong motion
2 Halted 0 ms 0 KB -