Submission #624310

# Submission time Handle Problem Language Result Execution time Memory
624310 2022-08-07T18:31:37 Z Icebear16 Mechanical Doll (IOI18_doll) C++14
0 / 100
1 ms 340 KB
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pf push_front
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),ra.end()
#define sz(a) a.size()
void create_circuit(int M, vector<int> A) {
  int N = A.size();
  vector<int> C(M + 1,0);
  vector<int> adj[N+1];
  for(int i=1;i<N;i++){
  	adj[A[i-1]].pb(A[i]);
  }
  adj[A[N-1]].pb(0);
  C[0]=A[0];
  int k=-1;
	vector<int> X, Y;
  for (int i = 1; i < N; i++) {
  	if(sz(adj[i])==2){
  		C[i]=k;
  		k--;
  		X.pb(adj[i][0]);
  		Y.pb(adj[i][1]);
	  }else C[i] = adj[i][0];
  }
//  for (int k = 0; k < N; ++k) {
//    X[k] = Y[k] = A[k];
//  }
  answer(C, X, Y);
}
# 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 -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -