Submission #848081

# Submission time Handle Problem Language Result Execution time Memory
848081 2023-09-11T09:52:28 Z urd05 Last supper (IOI12_supper) C++17
Compilation error
0 ms 0 KB
#include "assistant.h"
#include <bits/stdc++.h>
using namespace std;

bool save[100000];
bool isin[100000];
set<int> s;
int n,k,r;

void Assist(unsigned char *A, int N, int K, int R) {

  int i;
  n=N;
  k=K;
  r=R;
  for(int i=0;i<k;i++) {
    isin[i]=true;
    if (A[i]=='1') {
        save[i]=true;
    }
    else {
        s.insert(i);
    }
  }
  for (i = 0; i < N; i++) {
    int req = GetRequest();
    if (!isin[req]) {
        int now=*s.begin();
        s.erase(now);
        PutBack(now);
        isin[now]=false;
        isin[req]=true;
    }
    save[req]=(A[i+k]=='1');
    s.erase(req);
    if (!save[req]) {
        s.insert(req);
    }
  }

}
#include "assistant.h"
#include <bits/stdc++.h>
using namespace std;

bool save[100000];
bool isin[100000];
set<int> s;
int n,k,r;

void Assist(unsigned char *A, int N, int K, int R) {

  int i;
  n=N;
  k=K;
  r=R;
  for(int i=0;i<k;i++) {
    isin[i]=true;
    if (A[i]=='1') {
        save[i]=true;
    }
    else {
        s.insert(i);
    }
  }
  for (i = 0; i < N; i++) {
    int req = GetRequest();
    if (!isin[req]) {
        int now=*s.begin();
        s.erase(now);
        PutBack(now);
        isin[now]=false;
        isin[req]=true;
    }
    save[req]=(A[i+k]==1);
    s.erase(req);
    if (!save[req]) {
        s.insert(req);
    }
  }

}

Compilation message

/usr/bin/ld: /tmp/ccPL6NkD.o: in function `main':
advisor_grader.cpp:(.text.startup+0xe6): undefined reference to `ComputeAdvice(int*, int, int, int)'
/usr/bin/ld: /tmp/ccrk9UTz.o: in function `Assist(unsigned char*, int, int, int)':
advisor.cpp:(.text+0x42b): undefined reference to `GetRequest()'
/usr/bin/ld: advisor.cpp:(.text+0x460): undefined reference to `PutBack(int)'
collect2: error: ld returned 1 exit status