Problem photo
User 3lvian
Submission Time 2024-02-25 11:33:20
Score 0
Max Time N/A
Max Memory N/A

Compile Error

photo.cpp: In function ‘int solve(int, int, std::vector<std::vector<int> >&)’:
photo.cpp:64:11: error: ‘closest_height’ was not declared in this scope
64 | closest_height = heights[j][0];
| ^~~~~~~~~~~~~~
photo.cpp:66:11: error: ‘closest_height’ was not declared in this scope
66 | closest_height = heights[j][heights[j].size() - 1];
| ^~~~~~~~~~~~~~
photo.cpp:71:11: error: ‘closest_height’ was not declared in this scope
71 | closest_height = lower_diff < higher_diff ? heights[j][closest_height_index - 1] : heights[j][closest_height_index];
| ^~~~~~~~~~~~~~
photo.cpp:75:55: error: ‘closest_height’ was not declared in this scope
75 | min_diff = min(min_diff, abs(student_height - closest_height));
| ^~~~~~~~~~~~~~