답안 #424111

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
424111 2021-06-11T16:51:32 Z A_D 자동 인형 (IOI18_doll) C++14
37 / 100
111 ms 13648 KB
#include "doll.h"
#include <bits/stdc++.h>
#define ii pair<int,int>
#define F first
#define S second
using namespace std;
const int NN=3e5+100;
vector<int> c,x,y,a;
int sz;
void build(int p,int l,int sum)
{
    if(sum*2>=sz){
        x[p-1]=a[l];
        y[p-1]=a[l+sum];
        return;
    }
    x[p-1]=(-(p*2));
    y[p-1]=(-(p*2+1));
    build(p*2,l,sum*2);
    build(p*2+1,l+sum,sum*2);
}
void create_circuit(int m,vector<int>A){
    a=A;
    sz=a.size();
    if(a.size()==1){
        c.push_back(a[0]);
        c.push_back(0);
        answer(c,x,y);
        return;
    }
    for(int i=0;i<=m;i++){
        c.push_back(-1);
    }
    sz++;
    a.push_back(-1);
    while(1){
        int u=log2(sz);
        int v=log2(sz-1);
        if(u>v){
            break;
        }
        sz++;
        a.push_back(-1);
    }
    a.pop_back();
    a.push_back(0);
    x.resize(sz*2);
    y.resize(sz*2);
    build(1,0,1);
    while(x.back()==y.back()&&x.back()==0){
        x.pop_back();
        y.pop_back();
    }
/*
    cout<<sz<<endl;
    for(auto x:c)cout<<x<<" ";cout<<endl;
    for(auto xx:x)cout<<xx<<" ";cout<<endl;
    for(auto x:y)cout<<x<<" ";cout<<endl;
*/
    answer(c,x,y);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 204 KB Output is partially correct
2 Partially correct 92 ms 11548 KB Output is partially correct
3 Partially correct 97 ms 11568 KB Output is partially correct
4 Partially correct 92 ms 12556 KB Output is partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 204 KB Output is partially correct
2 Partially correct 92 ms 11548 KB Output is partially correct
3 Partially correct 97 ms 11568 KB Output is partially correct
4 Partially correct 92 ms 12556 KB Output is partially correct
5 Partially correct 109 ms 13648 KB Output is partially correct
6 Partially correct 111 ms 13308 KB Output is partially correct
7 Partially correct 102 ms 13340 KB Output is partially correct
8 Partially correct 89 ms 13040 KB Output is partially correct
9 Partially correct 76 ms 11532 KB Output is partially correct
10 Partially correct 97 ms 12936 KB Output is partially correct
11 Partially correct 90 ms 12608 KB Output is partially correct
12 Partially correct 98 ms 11828 KB Output is partially correct
13 Partially correct 81 ms 12180 KB Output is partially correct
14 Partially correct 92 ms 12248 KB Output is partially correct
15 Partially correct 80 ms 12336 KB Output is partially correct
16 Partially correct 3 ms 716 KB Output is partially correct
17 Correct 46 ms 7796 KB Output is correct
18 Partially correct 86 ms 11700 KB Output is partially correct
19 Partially correct 83 ms 11740 KB Output is partially correct
20 Partially correct 104 ms 12788 KB Output is partially correct
21 Partially correct 89 ms 12608 KB Output is partially correct
22 Partially correct 92 ms 12672 KB Output is partially correct