Submission #1339932

#TimeUsernameProblemLanguageResultExecution timeMemory
1339932Desh03Festival (IOI25_festival)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;

vector<int> max_coupons(int a, vector<int> p, vector<int> t) {
    int n = p.size();
    vector<int> id(n);
    iota(id.begin(), id.end(), 0);
    sort(id.begin(), id.end(), [&](const int &i, const int &j) {
        return ((long long) (x - p[i]) * t[i] - p[j]) * t[j] < ((long long) (x - p[j]) * t[j] - p[i]) * t[i];
    });
    return id;
}

Compilation message (stderr)

festival.cpp: In lambda function:
festival.cpp:10:30: error: 'x' was not declared in this scope
   10 |         return ((long long) (x - p[i]) * t[i] - p[j]) * t[j] < ((long long) (x - p[j]) * t[j] - p[i]) * t[i];
      |                              ^