Submission #286336

# Submission time Handle Problem Language Result Execution time Memory
286336 2020-08-30T09:58:09 Z Vimmer Mechanical Doll (IOI18_doll) C++14
6 / 100
79 ms 5796 KB
#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 time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 23 ms 1980 KB Output is correct
3 Correct 20 ms 1584 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 11 ms 1356 KB Output is correct
6 Correct 27 ms 2224 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 23 ms 1980 KB Output is correct
3 Correct 20 ms 1584 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 11 ms 1356 KB Output is correct
6 Correct 27 ms 2224 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 42 ms 3776 KB Output is correct
9 Correct 43 ms 3464 KB Output is correct
10 Correct 67 ms 5556 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
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 23 ms 1980 KB Output is correct
3 Correct 20 ms 1584 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 11 ms 1356 KB Output is correct
6 Correct 27 ms 2224 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 42 ms 3776 KB Output is correct
9 Correct 43 ms 3464 KB Output is correct
10 Correct 67 ms 5556 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 79 ms 5796 KB wrong motion
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB wrong motion
2 Halted 0 ms 0 KB -