Submission #1101357

# Submission time Handle Problem Language Result Execution time Memory
1101357 2024-10-16T07:03:50 Z blackslex Mechanical Doll (IOI18_doll) C++17
0 / 100
28 ms 4688 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> C(M + 1);
  int S = M;
  std::vector<int> X(S), Y(S);
  vector<int> cnt(M + 1);
  for (int i = 0; i < N; i++) cnt[A[i]]++;
  vector<bool> st(M + 1);
  C[0] = A[0]; C[A[N - 1]] = 0;
  for (int i = 0; i < N - 1; i++) {
    if (cnt[A[i]] == 1) {
      C[A[i]] = A[i + 1];
    } else {
      if (!st[A[i]]) {
        st[A[i]] = !st[A[i]];
        C[A[i]] = -A[i];
        X[A[i] - 1] = A[i + 1];
      } else {
        Y[A[i] - 1] = A[i + 1];
      }
    }
  }
  // C[0] = -1;
  for (int i = 1; i <= M; ++i) {
    // C[i] = 1;
  }
  for (int k = 0; k < S; ++k) {
    // X[k] = Y[k] = A[k];
  }
  answer(C, X, Y);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 28 ms 4688 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 28 ms 4688 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 28 ms 4688 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB wrong motion
2 Halted 0 ms 0 KB -