# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
946509 | PagodePaiva | Mechanical Doll (IOI18_doll) | C++17 | 60 ms | 13456 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "doll.h"
#include<bits/stdc++.h>
using namespace std;
void create_circuit(int M, std::vector<int> A) {
vector <int> v;
v.push_back(0);
for(auto x : A) v.push_back(x);
int m = M;
int n = v.size();
vector <int> c, x, y;
vector <int> g[m+1];
v.push_back(0);
for(int i = 0;i < (int) (v.size()) - 1;i++){
int val = v[i], nx = v[i+1];
g[val].push_back(nx);
}
int tp = -1;
for(int i = 0;i <= m;i++){
if(g[i].size() == 0) {
c.push_back(0);
continue;
}
if(g[i].size() == 1){
c.push_back(g[i][0]);
continue;
}
if(g[i].size() == 2){
c.push_back(tp);
x.push_back(g[i][0]);
y.push_back(g[i][1]);
tp--;
continue;
}
if(g[i].size() == 3){
c.push_back(tp);
x.push_back(tp-1);
y.push_back(tp-2);
x.push_back(g[i][0]);
y.push_back(tp);
x.push_back(g[i][1]);
y.push_back(g[i][2]);
tp--;
tp--;
tp--;
continue;
}
if(g[i].size() == 4){
c.push_back(tp);
x.push_back(tp-1);
y.push_back(tp-2);
x.push_back(g[i][0]);
y.push_back(g[i][2]);
x.push_back(g[i][1]);
y.push_back(g[i][3]);
tp--;
tp--;
tp--;
continue;
}
}
// for(auto t : c){
// cout << t << ' ';
// }
answer(c, x, y);
return;
}
컴파일 시 표준 에러 (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... |