답안 #816851

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
816851 2023-08-09T07:02:27 Z Jarif_Rahman 자동 인형 (IOI18_doll) C++17
47 / 100
73 ms 9940 KB
#include "doll.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;

const int inf = 1e9;

void create_circuit(int m, vector<int> A){
    int n = A.size();
    int k = 1;
    while(k < n) k*=2;

    vector<int> C(m+1, -1), X(k-1), Y(k-1);
    C[0] = A[0];

    for(int i = 1; i < k/2; i++) X[i-1] = -(2*i), Y[i-1] = -(2*i+1);
    for(int i = k; i < 2*k; i++){
        int j = i, pos = 0;
        while(j != 1){
            if(j&1) pos++;
            pos<<=1;
            j>>=1;
        }
        pos>>=1;
        if(pos == k-1){
            if(i&1) Y[i/2-1] = 0;
            else X[i/2-1] = 0;
        }
        else if(pos >= n-1){
            if(i&1) Y[i/2-1] = -1;
            else X[i/2-1] = -1;
        }
        else{
            if(i&1) Y[i/2-1] = A[pos+1];
            else X[i/2-1] = A[pos+1];
        }
    }

    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 Correct 1 ms 304 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 296 KB Output is correct
4 Correct 0 ms 300 KB Output is correct
5 Correct 0 ms 304 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 212 KB Output is partially correct
2 Correct 35 ms 5332 KB Output is correct
3 Partially correct 50 ms 8424 KB Output is partially correct
4 Partially correct 55 ms 9420 KB Output is partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 212 KB Output is partially correct
2 Correct 35 ms 5332 KB Output is correct
3 Partially correct 50 ms 8424 KB Output is partially correct
4 Partially correct 55 ms 9420 KB Output is partially correct
5 Partially correct 61 ms 9940 KB Output is partially correct
6 Partially correct 59 ms 9648 KB Output is partially correct
7 Partially correct 73 ms 9760 KB Output is partially correct
8 Partially correct 59 ms 9516 KB Output is partially correct
9 Partially correct 49 ms 8404 KB Output is partially correct
10 Partially correct 59 ms 9520 KB Output is partially correct
11 Partially correct 56 ms 9500 KB Output is partially correct
12 Partially correct 50 ms 8404 KB Output is partially correct
13 Correct 32 ms 5448 KB Output is correct
14 Partially correct 52 ms 8660 KB Output is partially correct
15 Partially correct 52 ms 8744 KB Output is partially correct
16 Partially correct 2 ms 596 KB Output is partially correct
17 Correct 30 ms 5332 KB Output is correct
18 Correct 31 ms 5336 KB Output is correct
19 Partially correct 50 ms 8404 KB Output is partially correct
20 Partially correct 65 ms 9556 KB Output is partially correct
21 Partially correct 56 ms 9392 KB Output is partially correct
22 Partially correct 57 ms 9516 KB Output is partially correct