Submission #982771

# Submission time Handle Problem Language Result Execution time Memory
982771 2024-05-14T17:38:49 Z mariaclara Mechanical Doll (IOI18_doll) C++17
6 / 100
77 ms 12616 KB
#include "doll.h"
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define mk make_pair
#define pb push_back
#define fr first
#define sc second

vector<int> S_x, S_y;
int create(vector<int> nodes) {
    if(sz(nodes) == 1) return nodes[0];
    vector<int> a, b;
    for(int i = 0; i < sz(nodes); i+=2) a.pb(nodes[i]);
    for(int i = 1; i < sz(nodes); i+=2) b.pb(nodes[i]);
    S_x.pb(create(a));
    S_y.pb(create(b));
    return -sz(S_x);
}

void create_circuit(int M, vector<int> A) {
    vector<vector<int>> edges(M+1);
    int N = sz(A);
    A.pb(0);

    for(int i = 0; i < N; i++)
        edges[A[i]].pb(A[i+1]);

    vector<int> ans = {A[0]};
    for(int i = 1; i <= M; i++)
        if(sz(edges[i])) ans.pb(create(edges[i]));
        else ans.pb(i);

    answer(ans, S_x, S_y);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 21 ms 6620 KB Output is correct
3 Correct 17 ms 5204 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 9 ms 3980 KB Output is correct
6 Correct 32 ms 8400 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 21 ms 6620 KB Output is correct
3 Correct 17 ms 5204 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 9 ms 3980 KB Output is correct
6 Correct 32 ms 8400 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 38 ms 8532 KB Output is correct
9 Correct 40 ms 9808 KB Output is correct
10 Correct 59 ms 12616 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 21 ms 6620 KB Output is correct
3 Correct 17 ms 5204 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 9 ms 3980 KB Output is correct
6 Correct 32 ms 8400 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 38 ms 8532 KB Output is correct
9 Correct 40 ms 9808 KB Output is correct
10 Correct 59 ms 12616 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Incorrect 77 ms 11364 KB state 'Y'
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -