답안 #999552

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
999552 2024-06-15T18:50:46 Z phoenix 자동 인형 (IOI18_doll) C++17
47 / 100
98 ms 13356 KB
#include "doll.h"
#include <bits/stdc++.h>

using namespace std;

int S = 0;
vector<int> X, Y;

int create_switch(int L, int R) {
    X.push_back(L);
    Y.push_back(R);
    S++;
    return -S;
}

int build(vector<int> v) {
    if ((int)v.size() == 1) {
        return v[0];
    }
    if (v[0] == -1 && v.back() == -1) {
        return -1;
    }
    int m = (int)v.size();
    int L, R;
    if (m & 1) {
        if (v.back()) {
            v.push_back(-1);
        } else {
            v.pop_back();
            v.push_back(-1);
            v.push_back(0);
        }
        m++;
    }
    vector<int> lv, rv;
    for (int i = 0; i < m; i++) {
        if (i & 1) rv.push_back(v[i]);
        else lv.push_back(v[i]);
    }

    L = build(lv);
    R = build(rv);
    return create_switch(L, R);
}

void create_circuit(int M, vector<int> A) {
    A.push_back(0);
    int t = A[0];
    A.erase(A.begin());

    create_switch(-1, -1);
    
    int root = build(A);
    Y[0] = root;
    vector<int> C(M + 1, root);
    C[0] = t;
    
    answer(C, X, Y);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 348 KB Output is partially correct
2 Correct 43 ms 6028 KB Output is correct
3 Partially correct 67 ms 11720 KB Output is partially correct
4 Partially correct 98 ms 11848 KB Output is partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 348 KB Output is partially correct
2 Correct 43 ms 6028 KB Output is correct
3 Partially correct 67 ms 11720 KB Output is partially correct
4 Partially correct 98 ms 11848 KB Output is partially correct
5 Partially correct 86 ms 12872 KB Output is partially correct
6 Partially correct 90 ms 13356 KB Output is partially correct
7 Partially correct 76 ms 12876 KB Output is partially correct
8 Partially correct 73 ms 12748 KB Output is partially correct
9 Partially correct 69 ms 12232 KB Output is partially correct
10 Partially correct 79 ms 12632 KB Output is partially correct
11 Partially correct 72 ms 12728 KB Output is partially correct
12 Partially correct 67 ms 11976 KB Output is partially correct
13 Correct 38 ms 6728 KB Output is correct
14 Partially correct 74 ms 12348 KB Output is partially correct
15 Partially correct 71 ms 12328 KB Output is partially correct
16 Partially correct 2 ms 604 KB Output is partially correct
17 Correct 37 ms 6424 KB Output is correct
18 Correct 48 ms 6220 KB Output is correct
19 Partially correct 72 ms 11972 KB Output is partially correct
20 Partially correct 75 ms 12024 KB Output is partially correct
21 Partially correct 72 ms 12104 KB Output is partially correct
22 Partially correct 71 ms 12224 KB Output is partially correct