Submission #1052769

# Submission time Handle Problem Language Result Execution time Memory
1052769 2024-08-10T20:50:38 Z wood Mechanical Doll (IOI18_doll) C++17
10 / 100
0 ms 348 KB
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
void create_circuit(int M, std::vector<int> A) {
	int N = A.size();
	vector<int> res(M+1,-1), x, y;
	res[0] = A[0];
	int logn = 1, size = 1;
	while(size<N){
		size*=2;
		logn++;
	}
	int size2 = size/2;
	for(int i = 1; i<size2; i++){
		x.pb(-2*i);
		y.pb(-2*i-1);
	}
	vector<int> list = {1};

	while(size2>0){
		int pp = list.size();
		for(int i = 0; i<pp; i++) list.pb(list[i]+size2);
		size2>>=1;
	}
	for(int i = 0; i<N-1; i++){
		if(i&1) y.pb(A[list[i]]);
		else x.pb(A[list[i]]);
	}
	for(int i = N-1; i<size-1; i++) {
		if(i&1) y.pb(-1);
		else x.pb(-1);
	}
	y.pb(0);
	answer(res,x,y);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB wrong motion
2 Halted 0 ms 0 KB -