# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
788497 | Andrey | 자동 인형 (IOI18_doll) | C++14 | 109 ms | 21936 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "doll.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> haha[200001];
vector<int> idk(500001);
void create_circuit(int m, vector<int> bruh) {
vector<int> c(m+1);
c[0] = bruh[0];
int n = bruh.size();
bruh.push_back(0);
vector<int> x(0);
vector<int> y(0);
int br = 1,a,z = 0,b,p,d,e;
for(int i = 0; i < n; i++) {
haha[bruh[i]].push_back(bruh[i+1]);
}
for(int i = 0; i < 200001; i++) {
if(haha[i].empty()) {
continue;
}
if(haha[i].size() == 1) {
c[i] = haha[i][0];
}
else {
c[i] = -br;
z = 1;
b = 0;
while(z < haha[i].size()) {
z*=2;
b*=2;
b++;
}
for(int j = 0; j < b; j++) {
x.push_back(-(br+j*2+1));
y.push_back(-(br+j*2+2));
}
int p = haha[i].size()-z;
for(int j = 0; j < z; j++) {
d = br;
while(d-br < b/2) {
if((++idk[d])%2) {
d = -x[d-1];
}
else {
d = -y[d-1];
}
}
if(p >= 0) {
e = haha[i][p];
}
else {
e = -br;
}
if((++idk[d])%2) {
x[d-1] = e;
}
else {
y[d-1] = e;
}
p++;
}
br+=b;
}
}
answer(c,x,y);
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |