Problem | gift |
---|---|
User | zyh255 |
Submission Time | 2023-01-09 12:33:31 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
gift.cpp: In function ‘int main()’:
gift.cpp:9:9: error: reference to ‘prev’ is ambiguous
9 | cin >> prev;
| ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
from /usr/include/c++/9/bits/specfun.h:45,
from /usr/include/c++/9/cmath:1927,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:41,
from gift.cpp:1:
/usr/include/c++/9/bits/stl_iterator_base_funcs.h:224:5: note: candidates are: ‘template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)’
224 | prev(_BidirectionalIterator __x, typename
| ^~~~
gift.cpp:4:14: note: ‘int prev’
4 | int n, k, x, prev, ans = 0;
| ^~~~
gift.cpp:12:11: error: reference to ‘prev’ is ambiguous
12 | if (x - prev >= k) an