Submission #725544

# Submission time Handle Problem Language Result Execution time Memory
725544 2023-04-17T15:27:07 Z groshi CONSUL (info1cup19_consul) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "grader.h"
#define int long long

using namespace std;
bool bylo[2000];
/*void say_answer(int N)
{
    cout<<N<<"\n";
}
int kth(int x)
{
    cout<<"ile tu "<<x<<"\n";
    int co;
    cin>>co;
    return co;
}
int cnt(int x)
{
    cout<<"ile tego "<<x<<"\n";
    cin>>x;
    return x;
}*/
void solve(int N)
{
    for(int i=0;i<=N;i++)
        bylo[i]=0;
    srand(time(0));
    int pytan=0;
    while(pytan<50)
    {
        int gdzie=rand()%N;
        gdzie++;
        if(bylo[gdzie])
            continue;
        int ile=kth(gdzie);
        pytan++;
        int essa=cnt(ile);
        if(essa>N/3)
        {
            say_answer(ile);
            return;
        }
    }
    say_answer(-1);
}

Compilation message

/usr/bin/ld: /tmp/ccnnXymF.o: in function `main':
grader.cpp:(.text.startup+0xa8): undefined reference to `solve(int)'
collect2: error: ld returned 1 exit status