제출 #286336

#제출 시각아이디문제언어결과실행 시간메모리
286336Vimmer자동 인형 (IOI18_doll)C++14
6 / 100
79 ms5796 KiB
#include <bits/stdc++.h>
#include "doll.h"

//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("fast-math")
//#pragma GCC optimize("no-stack-protector")

#define F first
#define S second
#define sz(x) int(x.size())
#define pb push_back
#define pf push_front
#define N 100005
#define M ll(998244353)
#define inf 1e9 + 1e9

using namespace std;

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef short int si;
typedef array <ll, 3> a3;
typedef array <ll, 4> a4;


void create_circuit (int m, vector <int> a)
{
    int n = sz(a);

    vector <int> c(m + 1), x, y; x.clear(); y.clear();

    for (int i = 0; i <= m; i++) c[i] = 1e9;

    c[0] = a[0];

    for (int i = 0; i < n; i++)
        if (i + 1 == n) {if (c[a[i]] == 1e9) c[a[i]] = 0; else {x.pb(c[a[i]]); y.pb(0); c[a[i]] = -sz(x);}}
          else if (c[a[i]] == 1e9) c[a[i]] = a[i + 1]; else {x.pb(c[a[i]]); y.pb(a[i + 1]); c[a[i]] = -sz(x);}

    for (int i = 0; i <= m; i++) if (c[i] == 1e9) c[i] = 0;

    answer(c, x, y);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...