Problem prefixsums
User Teeskit
Submission Time 2025-08-21 16:38:16
Score 0
Max Time N/A
Max Memory N/A

Compile Error

prefixsums.cpp: In function ‘int main()’:
prefixsums.cpp:20:19: error: redeclaration of ‘std::pair<int, int> j’
20 | pair<int, int>j(l, r);
| ^
prefixsums.cpp:17:10: note: ‘int j’ previously declared here
17 | for(int j = 0; j < Q; j ++) {
| ^
prefixsums.cpp:21:8: error: no match for ‘operator>>’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘int’)
21 | cout >> A[l] + A[r] >> "\n";
| ~~~~ ^~ ~~~~~~~~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
prefixsums.cpp:21:8: note: candidate: ‘operator>>(int, int)’ <built-in>
21 | cout >> A[l] + A[r] >> "\n";
| ~~~~~^~~~~~~~~~~~~~
prefixsums.cpp:21:8: note: no known conversion for argument 1 from ‘std::ostream’ {aka ‘std::basic_ostream<char>’} to ‘int’
In file