답안 #286359

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
286359 2020-08-30T10:24:59 Z Vimmer 자동 인형 (IOI18_doll) C++14
6 / 100
67 ms 5664 KB
#include "doll.h"
#include <bits/stdc++.h>
//#include "grader.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();

    if (m == 1)
    {
        c[0] = 1;

        c[1] = 0;

        for (int i = 1; i < n; i++)
        {
            x.pb(-1); y.pb(-1);

            if (i == 1) {c[1] = -1; x.back() = 1;}
              else {x.back() = -i + 1; y[i - 2] = -i;}
        }

        if (sz(y) != 0) y.back() = 0;

        answer(c, x, y);

        return;
    }

    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);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 22 ms 1972 KB Output is correct
3 Correct 17 ms 1580 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 16 ms 1356 KB Output is correct
6 Correct 46 ms 2228 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 22 ms 1972 KB Output is correct
3 Correct 17 ms 1580 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 16 ms 1356 KB Output is correct
6 Correct 46 ms 2228 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 65 ms 3784 KB Output is correct
9 Correct 41 ms 3528 KB Output is correct
10 Correct 65 ms 5544 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 22 ms 1972 KB Output is correct
3 Correct 17 ms 1580 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 16 ms 1356 KB Output is correct
6 Correct 46 ms 2228 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 65 ms 3784 KB Output is correct
9 Correct 41 ms 3528 KB Output is correct
10 Correct 65 ms 5544 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Incorrect 67 ms 5664 KB wrong motion
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 52 ms 4620 KB over 20000000 inversions
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 52 ms 4620 KB over 20000000 inversions
3 Halted 0 ms 0 KB -