답안 #756501

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
756501 2023-06-11T18:12:50 Z drdilyor 자동 인형 (IOI18_doll) C++17
37 / 100
551 ms 14356 KB
#include<bits/stdc++.h>
#include "doll.h"
using namespace std;
using ll = long long;

void create_circuit(int m, std::vector<int> arr) {
    vector<int> c(m+1);
    vector<int> x, y;
    auto add = [&](int a, int b){
        x.push_back(a), y.push_back(b);
        return -(int)x.size();
    };

    auto tree = [&](auto& tree, vector<int> nxt) {
        if (set<int>(nxt.begin(), nxt.end()).size()  == 1) {
            return nxt[0];
        }
        vector<int> odd, even;
        for (int i = 0; i < (int)nxt.size(); i += 2) {
            odd.push_back(nxt[i]);
            even.push_back(nxt[i+1]);
        }
        int t1 = tree(tree, odd);
        int t2 = tree(tree, even);
        return add(t1, t2);
    };

    arr.push_back(0);
    reverse(arr.begin(), arr.end());
    while (__builtin_popcount(arr.size()) > 1)
        arr.push_back(INT_MAX);
    reverse(arr.begin(), arr.end());

    c[0] = tree(tree, arr);

    for (int i = 0; i < (int)x.size(); i++) {
        if (x[i] == INT_MAX)
            x[i] = c[0];
        if (y[i] == INT_MAX)
            y[i] = c[0];
    }
    for (int i = 1; i <= m; i++)
        c[i] = c[0];
    answer(c, x, y);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 212 KB Output is partially correct
2 Partially correct 172 ms 11076 KB Output is partially correct
3 Partially correct 180 ms 11216 KB Output is partially correct
4 Correct 145 ms 11196 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 212 KB Output is partially correct
2 Partially correct 172 ms 11076 KB Output is partially correct
3 Partially correct 180 ms 11216 KB Output is partially correct
4 Correct 145 ms 11196 KB Output is correct
5 Partially correct 551 ms 14356 KB Output is partially correct
6 Partially correct 538 ms 12776 KB Output is partially correct
7 Partially correct 529 ms 12144 KB Output is partially correct
8 Partially correct 486 ms 13448 KB Output is partially correct
9 Partially correct 189 ms 10068 KB Output is partially correct
10 Partially correct 344 ms 11804 KB Output is partially correct
11 Partially correct 367 ms 11712 KB Output is partially correct
12 Partially correct 298 ms 11700 KB Output is partially correct
13 Partially correct 379 ms 11148 KB Output is partially correct
14 Partially correct 387 ms 13112 KB Output is partially correct
15 Partially correct 399 ms 13248 KB Output is partially correct
16 Partially correct 8 ms 596 KB Output is partially correct
17 Correct 220 ms 7720 KB Output is correct
18 Partially correct 281 ms 10660 KB Output is partially correct
19 Partially correct 290 ms 10196 KB Output is partially correct
20 Partially correct 460 ms 12180 KB Output is partially correct
21 Partially correct 350 ms 11180 KB Output is partially correct
22 Partially correct 387 ms 11516 KB Output is partially correct