Problem lunchbox
User Maskaphobia
Submission Time 2024-02-02 13:34:38
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lunchbox.cpp: In function ‘int main()’:
lunchbox.cpp:14:24: error: redeclaration of ‘std::set<int> empty_set’
14 | set <int, less <int>> empty_set;
| ^~~~~~~~~
lunchbox.cpp:8:12: note: ‘std::set<int> empty_set’ previously declared here
8 | set <int> empty_set;
| ^~~~~~~~~
lunchbox.cpp:16:21: error: no match for ‘operator[]’ (operand types are ‘std::set<int>’ and ‘int’)
16 | total += empty_set[i]
| ^
lunchbox.cpp:19:5: error: ‘else’ without a previous ‘if’
19 | } else {
| ^~~~
lunchbox.cpp:23:10: error: ‘maxSchools’ was not declared in this scope
23 | cout << maxSchools;
| ^~~~~~~~~~