Submission #424133

# Submission time Handle Problem Language Result Execution time Memory
424133 2021-06-11T17:08:54 Z A_D Mechanical Doll (IOI18_doll) C++14
37 / 100
116 ms 12128 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.resize(m+1);
        c[0]=a[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);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 204 KB Output is partially correct
2 Partially correct 76 ms 10648 KB Output is partially correct
3 Partially correct 80 ms 10560 KB Output is partially correct
4 Partially correct 82 ms 11072 KB Output is partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 204 KB Output is partially correct
2 Partially correct 76 ms 10648 KB Output is partially correct
3 Partially correct 80 ms 10560 KB Output is partially correct
4 Partially correct 82 ms 11072 KB Output is partially correct
5 Partially correct 89 ms 12128 KB Output is partially correct
6 Partially correct 116 ms 11792 KB Output is partially correct
7 Partially correct 94 ms 11940 KB Output is partially correct
8 Partially correct 100 ms 11548 KB Output is partially correct
9 Partially correct 77 ms 10604 KB Output is partially correct
10 Partially correct 85 ms 11524 KB Output is partially correct
11 Partially correct 85 ms 11148 KB Output is partially correct
12 Partially correct 77 ms 10908 KB Output is partially correct
13 Partially correct 82 ms 11188 KB Output is partially correct
14 Partially correct 79 ms 11280 KB Output is partially correct
15 Partially correct 83 ms 11444 KB Output is partially correct
16 Partially correct 3 ms 588 KB Output is partially correct
17 Correct 45 ms 6856 KB Output is correct
18 Partially correct 96 ms 10804 KB Output is partially correct
19 Partially correct 92 ms 10800 KB Output is partially correct
20 Partially correct 87 ms 11404 KB Output is partially correct
21 Partially correct 85 ms 11332 KB Output is partially correct
22 Partially correct 87 ms 11196 KB Output is partially correct