답안 #82013

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
82013 2018-10-28T12:20:54 Z gusagalover 자동 인형 (IOI18_doll) C++17
6 / 100
77 ms 6964 KB
#include "doll.h"
#include <bits/stdc++.h>

using namespace std;
typedef pair<int,int> pii;

void create_circuit(int M, std::vector<int> A)
{
    int N=A.size();
    vector<int> cnt(M+1),visit(M+1);
    for(int i=0;i<N;i++)
        cnt[A[i]]++;
    vector<int> C(M+1);
    vector<int> X,Y,SN(M+1);
    int bf=0,sc=0;
    C[0]=A[0];
    A.push_back(0);
    for(int i=0;i<N;i++)
    {
        int here=A[i];
        //int there=A[i+1];
        if(cnt[here]==2)
        {
            if(!visit[here])
            {
                SN[here]=++sc;
                X.push_back(0); Y.push_back(0);
                C[here]=-SN[here];
                X[SN[here]-1]=A[i+1];
                visit[here]=1;
            }
            else
            {
                Y[SN[here]-1]=A[i+1];
            }
        }
        else
            C[here]=A[i+1];
    }
    A.pop_back();
    //for(int i=0;i<C.size();i++)
    //  printf("%d ",C[i]);
    answer(C,X,Y);
}

Compilation message

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:15:9: warning: unused variable 'bf' [-Wunused-variable]
   15 |     int bf=0,sc=0;
      |         ^~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 21 ms 3144 KB Output is correct
3 Correct 17 ms 2248 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 12 ms 2636 KB Output is correct
6 Correct 31 ms 3396 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 21 ms 3144 KB Output is correct
3 Correct 17 ms 2248 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 12 ms 2636 KB Output is correct
6 Correct 31 ms 3396 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 49 ms 4400 KB Output is correct
9 Correct 48 ms 4656 KB Output is correct
10 Correct 77 ms 6964 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 21 ms 3144 KB Output is correct
3 Correct 17 ms 2248 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 12 ms 2636 KB Output is correct
6 Correct 31 ms 3396 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 49 ms 4400 KB Output is correct
9 Correct 48 ms 4656 KB Output is correct
10 Correct 77 ms 6964 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Incorrect 36 ms 3640 KB wrong motion
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 300 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 300 KB wrong motion
2 Halted 0 ms 0 KB -