Submission #879597

# Submission time Handle Problem Language Result Execution time Memory
879597 2023-11-27T17:02:55 Z andrei_boaca Mechanical Doll (IOI18_doll) C++17
6 / 100
49 ms 12576 KB
#include "doll.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
int n;
vector<int> vecini[100005];
vector<int> C,X,Y;
vector<int> v;
int s;
int build(int st,int dr)
{
    if(st==dr)
        return v[st];
    int mij=(st+dr)/2;
    int a=build(st,mij);
    int b=build(mij+1,dr);
    s++;
    X.push_back(a);
    Y.push_back(b);
    return -s;
}
void create_circuit(int M, std::vector<int> A)
{
    n=A.size();
    for(int i=0;i<A.size();i++)
    {
        int x=A[i];
        int nxt=0;
        if(i+1<A.size())
            nxt=A[i+1];
        vecini[x].push_back(nxt);
    }
    C.resize(M+1);
    C[0]=A[0];
    for(int i=1;i<=M;i++)
    {
        if(vecini[i].empty())
        {
            C[i]=0;
            continue;
        }
        else
        {
            v=vecini[i];
            C[i]=build(0,v.size()-1);
        }
    }
    answer(C,X,Y);
}

Compilation message

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:25:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |     for(int i=0;i<A.size();i++)
      |                 ~^~~~~~~~~
doll.cpp:29:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |         if(i+1<A.size())
      |            ~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2652 KB Output is correct
2 Correct 18 ms 6772 KB Output is correct
3 Correct 14 ms 6492 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 8 ms 3932 KB Output is correct
6 Correct 24 ms 8532 KB Output is correct
7 Correct 1 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2652 KB Output is correct
2 Correct 18 ms 6772 KB Output is correct
3 Correct 14 ms 6492 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 8 ms 3932 KB Output is correct
6 Correct 24 ms 8532 KB Output is correct
7 Correct 1 ms 2652 KB Output is correct
8 Correct 32 ms 9156 KB Output is correct
9 Correct 33 ms 9688 KB Output is correct
10 Correct 49 ms 12576 KB Output is correct
11 Correct 1 ms 2652 KB Output is correct
12 Correct 1 ms 2652 KB Output is correct
13 Correct 1 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2652 KB Output is correct
2 Correct 18 ms 6772 KB Output is correct
3 Correct 14 ms 6492 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 8 ms 3932 KB Output is correct
6 Correct 24 ms 8532 KB Output is correct
7 Correct 1 ms 2652 KB Output is correct
8 Correct 32 ms 9156 KB Output is correct
9 Correct 33 ms 9688 KB Output is correct
10 Correct 49 ms 12576 KB Output is correct
11 Correct 1 ms 2652 KB Output is correct
12 Correct 1 ms 2652 KB Output is correct
13 Correct 1 ms 2652 KB Output is correct
14 Incorrect 49 ms 12016 KB wrong motion
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2652 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2652 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2652 KB wrong motion
2 Halted 0 ms 0 KB -