Submission #611889

# Submission time Handle Problem Language Result Execution time Memory
611889 2022-07-29T08:22:18 Z Jomnoi Mechanical Doll (IOI18_doll) C++17
6 / 100
75 ms 12232 KB
#include <bits/stdc++.h>
#include "doll.h"
using namespace std;

const int MAX_M = 1e5 + 5;

vector <int> position[MAX_M];

void create_circuit(int M, vector <int> A) {
    int N = A.size(), S = 0;
    vector<int> C(M + 1), X, Y;

    A.push_back(0);
    for(int i = 0; i < N; i++) {
        position[A[i]].push_back(i);
    }

    C[0] = A[0];
    for(int i = 0; i < N; i++) {
        if(position[A[i]].size() == 2) {
            S++;
            C[A[i]] = -S;
            X.push_back(A[i + 1]);
            Y.push_back(A[position[A[i]].back() + 1]);
            position[A[i]].clear();
        }
        else if(position[A[i]].size() == 1) {
            C[A[i]] = A[i + 1];
        }
    }
    answer(C, X, Y);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2644 KB Output is correct
2 Correct 25 ms 6512 KB Output is correct
3 Correct 20 ms 6016 KB Output is correct
4 Correct 2 ms 2656 KB Output is correct
5 Correct 10 ms 3796 KB Output is correct
6 Correct 32 ms 7764 KB Output is correct
7 Correct 1 ms 2644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2644 KB Output is correct
2 Correct 25 ms 6512 KB Output is correct
3 Correct 20 ms 6016 KB Output is correct
4 Correct 2 ms 2656 KB Output is correct
5 Correct 10 ms 3796 KB Output is correct
6 Correct 32 ms 7764 KB Output is correct
7 Correct 1 ms 2644 KB Output is correct
8 Correct 44 ms 8672 KB Output is correct
9 Correct 48 ms 8928 KB Output is correct
10 Correct 75 ms 12232 KB Output is correct
11 Correct 2 ms 2648 KB Output is correct
12 Correct 1 ms 2644 KB Output is correct
13 Correct 2 ms 2644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2644 KB Output is correct
2 Correct 25 ms 6512 KB Output is correct
3 Correct 20 ms 6016 KB Output is correct
4 Correct 2 ms 2656 KB Output is correct
5 Correct 10 ms 3796 KB Output is correct
6 Correct 32 ms 7764 KB Output is correct
7 Correct 1 ms 2644 KB Output is correct
8 Correct 44 ms 8672 KB Output is correct
9 Correct 48 ms 8928 KB Output is correct
10 Correct 75 ms 12232 KB Output is correct
11 Correct 2 ms 2648 KB Output is correct
12 Correct 1 ms 2644 KB Output is correct
13 Correct 2 ms 2644 KB Output is correct
14 Incorrect 43 ms 7252 KB wrong motion
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2644 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2644 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2644 KB wrong motion
2 Halted 0 ms 0 KB -