Submission #954853

# Submission time Handle Problem Language Result Execution time Memory
954853 2024-03-28T17:51:55 Z Trisanu_Das Mechanical Doll (IOI18_doll) C++17
47 / 100
64 ms 22348 KB
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
const int maxN=400010;
typedef vector<int> vec;
vec G[maxN];
int lv[maxN],no[maxN],tmp=-1;
int ln(int x){
	int cnt=1,s=0;
	while(x>cnt){cnt*=2;s++;}
	return s;
}
void create_circuit(int M, std::vector<int> A){
	int N=A.size(),K=ln(N),SW=(1<<K)-1;
	for(int i=N;i<(1<<K);i++)A.push_back(-1);
	A.push_back(0);
	if (SW<1)SW=1;
	vec C(M+1),X(SW),Y(SW);
	C[0]=A[0];X[0]=-1;Y[0]=0;
	for (int i=1;i<=M;i++)C[i]=-1;
	if (N>1){
		no[1]=1;lv[1]=0;
		for (int i=1;i<(1<<(K-1));i++){
			X[i-1]=-i*2;no[i*2]=no[i];lv[i*2]=lv[i]+1;
			Y[i-1]=-i*2-1;no[i*2+1]=no[i]+(1<<lv[i]);lv[i*2+1]=lv[i]+1;
		}
		for (int i=1<<(K-1);i<=SW;i++){
			X[i-1]=A[no[i]];
			Y[i-1]=A[no[i]+(1<<lv[i])];
		}
	}
	answer(C,X,Y);
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 12788 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 12788 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 12788 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 12636 KB Output is correct
2 Correct 4 ms 12636 KB Output is correct
3 Correct 3 ms 12636 KB Output is correct
4 Correct 3 ms 12632 KB Output is correct
5 Correct 3 ms 12636 KB Output is correct
6 Correct 3 ms 12636 KB Output is correct
7 Correct 3 ms 12636 KB Output is correct
8 Correct 3 ms 12636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 12636 KB Output is partially correct
2 Correct 31 ms 18516 KB Output is correct
3 Partially correct 49 ms 21336 KB Output is partially correct
4 Partially correct 54 ms 21928 KB Output is partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 12636 KB Output is partially correct
2 Correct 31 ms 18516 KB Output is correct
3 Partially correct 49 ms 21336 KB Output is partially correct
4 Partially correct 54 ms 21928 KB Output is partially correct
5 Partially correct 62 ms 22348 KB Output is partially correct
6 Partially correct 58 ms 22088 KB Output is partially correct
7 Partially correct 58 ms 22160 KB Output is partially correct
8 Partially correct 59 ms 22092 KB Output is partially correct
9 Partially correct 49 ms 21328 KB Output is partially correct
10 Partially correct 57 ms 21836 KB Output is partially correct
11 Partially correct 55 ms 21976 KB Output is partially correct
12 Partially correct 50 ms 21336 KB Output is partially correct
13 Correct 37 ms 19028 KB Output is correct
14 Partially correct 51 ms 21592 KB Output is partially correct
15 Partially correct 52 ms 21592 KB Output is partially correct
16 Partially correct 4 ms 13148 KB Output is partially correct
17 Correct 36 ms 18768 KB Output is correct
18 Correct 31 ms 18532 KB Output is correct
19 Partially correct 50 ms 21332 KB Output is partially correct
20 Partially correct 56 ms 21832 KB Output is partially correct
21 Partially correct 58 ms 21832 KB Output is partially correct
22 Partially correct 64 ms 21824 KB Output is partially correct