제출 #1339932

#제출 시각아이디문제언어결과실행 시간메모리
1339932Desh03축제 (IOI25_festival)C++20
컴파일 에러
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;
}

컴파일 시 표준 에러 (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];
      |                              ^