Submission #1242710

#TimeUsernameProblemLanguageResultExecution timeMemory
1242710mohamedboukerche55Split the Attractions (IOI19_split)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
using ll = long long ;

vector<int> finode_split(int n, int a, int b, int c, vector<int> p, vector<int> q) 
{
    vector<vector<int>>hello(n);

    for(int i = 0 ; i < p.size(); i++)
    {
        hello[p[i]].push_back(q[i]);
        hello[q[i]].push_back(p[i]);
    }

    vector<int> ans;

    int curr = 1; 
    int no = 0;
    int pz = -1;

    for(int i = 0 ;i < n ;i++)
    {
        if(hello[i].size() == 1)
        {
            no = i;
        }
    }
    for(int i = 0 ; i < n ; i++)
    {
        if(i == a + b || i == a)
        {
            curr++;
        }
    }
    ans[n] = curr++;

    for(auto i : hello[no])
    {
        if (i != pz)
        {
            pz = no;
            no = i;
            break;
        }
    }
   return ans;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccko4E8k.o: in function `main':
grader.cpp:(.text.startup+0x277): undefined reference to `find_split(int, int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status