답안 #95742

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
95742 2019-02-02T08:41:08 Z rocketninja7 자동 인형 (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);
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 368 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 368 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 368 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -