Problem festival
User Xiaoyang
Submission Time 2025-08-07 23:27:56
Score 0
Max Time N/A
Max Memory N/A

Compile Error

festival.cpp: In lambda function:
festival.cpp:48:18: error: ‘T’ is not captured
48 | return (T[i]-1)*P[j]*T[j]<(T[j]-1)*P[i]*T[i];
| ^
festival.cpp:47:23: note: the lambda has no capture-default
47 | sort(ALL(non_one), [](const auto& i, const auto& j) {
| ^
festival.cpp:26:74: note: ‘std::vector<int> T’ declared here
26 | std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T) {
| ~~~~~~~~~~~~~~~~~^
festival.cpp:48:26: error: ‘P’ is not captured
48 | return (T[i]-1)*P[j]*T[j]<(T[j]-1)*P[i]*T[i];
| ^
festival.cpp:47:23: note: the lambda has no capture-default
47 | sort(ALL(non_one), [](const auto& i, const auto& j) {
| ^
festival.cpp:26:54: note: ‘std::vector<int> P’ declared he