# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
645801 | slime | Mechanical Doll (IOI18_doll) | C++14 | 279 ms | 262144 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "doll.h"
#include "bits/stdc++.h"
using namespace std;
void create_circuit(int M, std::vector<int> A);
void answer(std::vector<int> C, std::vector<int> X, std::vector<int> Y);
int lg(int x) {
return 32 - __builtin_clz(x) - 1;
}
void create_circuit(int M, std::vector<int> A) {
int N = A.size();
int freq[M + 1];
for(int i=0; i<=M; i++) freq[i] = 0;
for(int i=0; i<N; i++) freq[A[i]]++;
freq[0]++;
vector<int> C(M + 1);
for(int i=0; i<=M; i++) C[i] = 0;
C[0] = A[0];
vector<int> sequence;
for(int i=0; i<N; i++) {
if(freq[A[i]] == 1) {
C[A[i]] = (i+1 == N ? 0 : A[i+1]);
}
else {
sequence.push_back((i+1 == N ? 0 : A[i+1]));
C[A[i]] = -1;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |