Problem sort2
User OSoverspike
Submission Time 2025-11-14 01:10:28
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sort2.cpp: In function ‘int main()’:
sort2.cpp:6:2: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’?
6 | cin >> n;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:75,
from sort2.cpp:1:
/usr/include/c++/9/iostream:60:18: note: ‘std::cin’ declared here
60 | extern istream cin; /// Linked to standard input
| ^~~
sort2.cpp:8:6: error: expected ‘(’ before ‘i’
8 | for i in range(0, n) {
| ^
| (
sort2.cpp:8:6: error: ‘i’ was not declared in this scope
sort2.cpp:11:18: error: request for member ‘begin’ in ‘input’, which is of non-class type ‘int [7500]’
11 | std::sort(input.begin(), input.begin()+n, std::greater<int>());
| ^~~~~
sort2.cpp:11:33: error: request for member ‘begin’ in ‘input’, which is of non-class type ‘int [7500]’
11 | std::sort