Problem GSS
User JulianN
Submission Time 2025-05-21 17:00:00
Score 0
Max Time N/A
Max Memory N/A

Compile Error

GSS.cpp: In function ‘int main()’:
GSS.cpp:3:19: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’?
3 | int main() {int n;cin >> n;vector<int> prices(n);for (int i = 0; i < n; ++i) {cin >> prices[i];}sort(prices.rbegin(), prices.rend());int total = 0;for (int i = 0; i < n; ++i) {if ((i + 1) % 4 != 0) {total += prices[i];}}cout << total << endl;return 0;}
| ^~~
| std::cin
In file included from GSS.cpp:1:
/usr/include/c++/9/iostream:60:18: note: ‘std::cin’ declared here
60 | extern istream cin; /// Linked to standard input
| ^~~
GSS.cpp:3:28: error: ‘vector’ was not declared in this scope
3 | int main() {int n;cin >> n;vector<int> prices(n);for (int i = 0; i < n; ++i) {cin >> prices[i];}sort(prices.rbegin(), prices.rend());int total = 0;for (int i = 0; i < n; ++i) {if ((i + 1) % 4 != 0) {total +=