Problem fenwicktree
User xyz
Submission Time 2023-11-08 11:18:57
Score 0
Max Time N/A
Max Memory N/A

Compile Error

fenwicktree.cpp: In function ‘int main()’:
fenwicktree.cpp:11:24: error: no matching function for call to ‘push_back(int*)’
11 | arr.push_back(&curr);
| ^
In file included from /usr/include/c++/9/vector:67,
from fenwicktree.cpp:2:
/usr/include/c++/9/bits/stl_vector.h:1184:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]’ <near match>
1184 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1184:7: note: conversion of argument 1 would be ill-formed:
fenwicktree.cpp:11:19: error: invalid conversion from ‘int*’ to ‘std::vector<int>::value_type’ {aka ‘int’} [-fpermissive]
11 | arr.push_back(&curr);
| ^~~~~
| |
| int*