Submission #95742

# Submission time Handle Problem Language Result Execution time Memory
95742 2019-02-02T08:41:08 Z rocketninja7 Mechanical Doll (IOI18_doll) C++14
0 / 100
2 ms 368 KB
#include "doll.h"

void create_circuit(int M, std::vector<int> A) {
    int N = A.size();
    A.push_back(0);
    std::vector<int> times[M+1];
    for(int i=1;i<N;i++){
        times[A[i]].push_back(A[i+1]);
    }
    std::vector<int> C(M+1);
    std::vector<int> X, Y;
    C[0]=A[0];
    int switches=0;
    for(int i=1;i<M+1;i++){
        if(times[i].size()==1){
            C[i]=times[i][0];
        }
        else{
            C[i]=-switches-1;
            X[switches]=times[i][0];
            Y[switches]=times[i][1];
            switches++;
        }
    }
    answer(C, X, Y);
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 368 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 368 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 368 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -