Submission #101783

# Submission time Handle Problem Language Result Execution time Memory
101783 2019-03-20T08:12:16 Z daniel920712 Mechanical Doll (IOI18_doll) C++14
0 / 100
2 ms 204 KB
#include "doll.h"
#include <vector>
using namespace std;
int con[1000005]={0};
int This[1000005]={0};
vector < int > C,X,Y;
void create_circuit(int M, vector < int > A)
{
    int N=A.size(),now=1,i;
    for(i=1;i<=M;i++) C.push_back(i);
    for(i=0;i<N;i++) con[A[i]]++;
    A.push_back(0);
    for(i=0;i<M;i++)
    {
        if(con[A[i]]==1) C[A[i]]=A[i+1];
        else
        {
            if(This[A[i]]==0)
            {
                C[A[i]]=-now;
                now++;
                X.push_back(A[i+1]);
                Y.push_back(A[i+1]);
            }
            else
            {
                Y[-C[A[i]]]=A[i+1];
            }
            This[A[i]]++;

        }
    }
    answer(C,X,Y);

}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB Wrong Answer: wrong array length
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB Wrong Answer: wrong array length
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB Wrong Answer: wrong array length
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB Wrong Answer: wrong array length
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Wrong Answer: wrong array length
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Wrong Answer: wrong array length
2 Halted 0 ms 0 KB -