Submission #991032

# Submission time Handle Problem Language Result Execution time Memory
991032 2024-06-01T05:59:47 Z lalig777 Last supper (IOI12_supper) C++14
Compilation error
0 ms 0 KB
#include "advisor.h"
#include <iostream>
#include <vector>
#include <unordered_set>
#include <queue>
using namespace std;
void ComputeAdvice(vector<int>C, int N, int K, int M){
    vector<int>orden(N, 0);
    for (int i=0; i<N; i++) orden[C[i]]++;
    for (int i=0; i<K; i++){
        if (orden[i]==0) WriteAdvice(0);
        else WriteAdvice(1);
    }
    for (int i=0; i<N; i++){
        int x=C[i];
        orden[x]--;
        if (orden[x]==0) WriteAdvice(0);
        else WriteAdvice(1);
    }return;
}
#include "assistant.h"
#include <iostream>
#include <vector>
#include <unordered_set>
#include <queue>
using namespace std;
void Assist(vector<unsigned char>A, int N, int K, int R){
    queue<int>away;
    unordered_set<int>current;
    for (int i=0; i<K; i++){
        current.insert(i);
        if (A[i]=='0') away.push(i);
    }
    for (int i=0; i<N; i++){
        int follow=GetRequest();
        char x=A[i+K];
        if (!(current.find(follow)!=current.end())){
            int remov=-1;
            if (away.empty()) remov=*current.begin();
            else{
                remov=away.front();
                away.pop();
            }
            PutBack(remov);
            current.erase(remov);
            current.insert(follow);
        }if (x=='0') away.push(follow);
    }return;
}

Compilation message

/usr/bin/ld: /tmp/cc3T49jD.o: in function `main':
advisor_grader.cpp:(.text.startup+0xe6): undefined reference to `ComputeAdvice(int*, int, int, int)'
collect2: error: ld returned 1 exit status

/usr/bin/ld: /tmp/ccQhkIRq.o: in function `main':
assistant_grader.cpp:(.text.startup+0x21e): undefined reference to `Assist(unsigned char*, int, int, int)'
collect2: error: ld returned 1 exit status