# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1068208 | Sir_Ahmed_Imran | Mechanical Doll (IOI18_doll) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
///~~~LOTA~~~///
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define append push_back
#define add insert
#define nl '\n'
#define ff first
#define ss second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(x) (x).begin(),(x).end()
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define terminator main
#define N 100001
vector<int> p[N];
void create_circuit(int m,vector<int> a){
vector<int> c,x,y;
c.append(a[0]);
a.append(0);
int o=-1;
for(int i=0;i<a.size();i++)
p[a[i]].append(i+1);
for(int i=1;i<=m;i++){
c.append(0);
if(p[i].size()==1)
c[i]=a[p[i][0]];
if(p[i].size()>1){
c[i]=o;
o--;
x.append(a[p[i][0]]);
y.append(a[p[i][1]]);
}
}
answer(c,x,y);
}