Submission #713739

# Submission time Handle Problem Language Result Execution time Memory
713739 2023-03-23T01:33:42 Z LittleOrange Mechanical Doll (IOI18_doll) C++17
10 / 100
1 ms 304 KB
#include "doll.h"
#include<bits/stdc++.h>
using namespace std;
using ll = int;

void create_circuit(int M, std::vector<int> A) {
  int N = A.size();
  std::vector<int> C(M + 1);
  C[0] = A[0];
  for (int i = 1; i <= M; ++i) {
    C[i] = -1;
  }
  A.push_back(0);
  if (N == 1){
    for (int i = 1; i <= M; ++i) C[i] = 0;
    vector<int> X,Y; 
    answer(C, X, Y);
    return;
  }
  vector<int> X(N-1),Y(N-1);
  ll it = 0;
  function<ll(ll,ll,ll)> dfs;
  dfs = [&](ll cnt, ll st, ll lv){
    if (cnt==1){
        return A[st+1];
    }
    ll i = it++;
    X[i] = dfs(cnt-cnt/2,st,lv+1);
    Y[i] = dfs(cnt/2,st+(1<<lv),lv+1);
    return -1-i;
  };
  dfs(N,0,0);
  answer(C, X, Y);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB state 'Y'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB state 'Y'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB state 'Y'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 304 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB state 'Y'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB state 'Y'
2 Halted 0 ms 0 KB -