답안 #1055268

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1055268 2024-08-12T16:09:32 Z Ahmed57 자동 인형 (IOI18_doll) C++17
6 / 100
41 ms 12580 KB
#include "bits/stdc++.h"
#include "doll.h"

using namespace std;
int S = -1;
vector<int> X,Y,C;
vector<int> dc(vector<int> lol){
    if(lol.size()==1)return lol;
    int sz = lol.size();
    int add = (sz+1)/2;
    vector<int> ret;
    for(int j = 0;j+add<sz;j++){
        ret.push_back(S--);
        X.push_back(lol[j]);
        Y.push_back(lol[j+add]);
    }
    if(sz%2){
        int x = sz-add;
        X.push_back(S);
        Y.push_back(lol[x]);
        ret.push_back(S--);
    }
    return ret;
}
void create_circuit(int M, vector<int> A){
    vector<int> adj[M+1];
    int N = A.size();
    adj[0].push_back(A[0]);
    for(int i = 1;i<N;i++){
        adj[A[i-1]].push_back(A[i]);
    }
    adj[A[N-1]].push_back(0);
    for(int i = 0;i<=M;i++){
        if(adj[i].empty())adj[i].push_back(0);
        vector<int> x = dc(adj[i]);
        C.push_back(x[0]);
    }
    answer(C,X,Y);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 18 ms 7604 KB Output is correct
3 Correct 14 ms 5848 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 11 ms 7068 KB Output is correct
6 Correct 22 ms 8564 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 18 ms 7604 KB Output is correct
3 Correct 14 ms 5848 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 11 ms 7068 KB Output is correct
6 Correct 22 ms 8564 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 25 ms 8776 KB Output is correct
9 Correct 30 ms 10144 KB Output is correct
10 Correct 39 ms 12580 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
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 18 ms 7604 KB Output is correct
3 Correct 14 ms 5848 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 11 ms 7068 KB Output is correct
6 Correct 22 ms 8564 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 25 ms 8776 KB Output is correct
9 Correct 30 ms 10144 KB Output is correct
10 Correct 39 ms 12580 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 41 ms 11284 KB wrong motion
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -