Submission #1252841

#TimeUsernameProblemLanguageResultExecution timeMemory
1252841an22inkleFestival (IOI25_festival)C++20
Compilation error
0 ms0 KiB
#include "festival.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

std::vector<int> max_coupons(int A, std::vector<ll> P, std::vector<ll> T) {
  int n = P.size();
  int mode = 0; // scan for increments
  vector<int> ans;
  vector<bool> ok(n);

  while (mode == 0) {
    mode = 1;
    int tgt = -1;
    for (int i = 0; i < n; i++) {
      if (ok[i] == 0) { //  && A >= (T[i]*P[i])/(T[i] - 1)))
        mode = 0;
        if (tgt == -1) {
          tgt = i;
        } else if (1LL*T[i]*(A - P[i]) > 1LL*T[tgt]*(A - P[tgt])) {
          tgt = i;
        }
      }
    }
    A = 1LL*T[tgt]*(A - P[tgt]);
    ok[tgt] = 1;
    ans.push_back(tgt);
  }

  return ans;
}

Compilation message (stderr)

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