Problem | fractional_knapsack |
---|---|
User | Tyx2019 |
Submission Time | 2023-02-08 14:08:49 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
fractional_knapsack.cpp: In function ‘int main()’:
fractional_knapsack.cpp:15:10: error: invalid operands of types ‘std::pair<long double, long double> [(int)N]’ and ‘long double’ to binary ‘operator+’
15 | sort(A,A+N,greater<pair<long double,int>>());
| ~^~
| | |
| | long double
| std::pair<long double, long double> [(int)N]
fractional_knapsack.cpp:18:12: error: invalid types ‘std::pair<long double, long double> [(int)N][long double]’ for array subscript
18 | if(W<=A[i].second){
| ^
fractional_knapsack.cpp:19:13: error: invalid types ‘std::pair<long double, long double> [(int)N][long double]’ for array subscript
19 | maks+=A[i].first*W;
| ^
fractional_knapsack.cpp:22:9: error: invalid types ‘std::pair<long double, long double> [(int)N][long double]’ for array subscript
22 | W-=A[i].second;<