foo.cc: In function 'int main()':
foo.cc:21:36: warning: format '%lld' expects argument of type 'long long int*', but argument 2 has type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type*' {aka 'int*'} [-Wformat=]
21 | for (i = 0; i < n; i++) scanf("%lld", &v[i]);
| ~~~^
| |
| long long int*
| %d
foo.cc:46:8: error: no match for 'operator[]' (operand types are 'std::map<std::map<int, int>, int>' and 'll' {aka 'long long int'})
46 | if(dp[l][r])
| ^
In file included from /usr/include/c++/9/map:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from foo.cc:1:
/usr/include/c++/9/bits/stl_map.h:490:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::map<int, int>; _Tp = int; _Compare = std::less<std::map<int, int> >; _Alloc = std::allocator<std::pair<const std::map<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::map<int, int>]'
490 | operator[](const key_type& __k)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_map.h:490:34: note: no known conversion for argument 1 from 'll' {aka 'long long int'} to 'const key_type&' {aka 'const std::map<int, int>&'}
490 | operator[](const key_type& __k)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_map.h:510:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::map<int, int>; _Tp = int; _Compare = std::less<std::map<int, int> >; _Alloc = std::allocator<std::pair<const std::map<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::map<int, int>]'
510 | operator[](key_type&& __k)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_map.h:510:29: note: no known conversion for argument 1 from 'll' {aka 'long long int'} to 'std::map<std::map<int, int>, int>::key_type&&' {aka 'std::map<int, int>&&'}
510 | operator[](key_type&& __k)
| ~~~~~~~~~~~^~~
foo.cc:57:6: error: no match for 'operator[]' (operand types are 'std::map<std::map<int, int>, int>' and 'll' {aka 'long long int'})
57 | dp[l][r]=ans;
| ^
In file included from /usr/include/c++/9/map:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from foo.cc:1:
/usr/include/c++/9/bits/stl_map.h:490:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::map<int, int>; _Tp = int; _Compare = std::less<std::map<int, int> >; _Alloc = std::allocator<std::pair<const std::map<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::map<int, int>]'
490 | operator[](const key_type& __k)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_map.h:490:34: note: no known conversion for argument 1 from 'll' {aka 'long long int'} to 'const key_type&' {aka 'const std::map<int, int>&'}
490 | operator[](const key_type& __k)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_map.h:510:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::map<int, int>; _Tp = int; _Compare = std::less<std::map<int, int> >; _Alloc = std::allocator<std::pair<const std::map<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::map<int, int>]'
510 | operator[](key_type&& __k)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_map.h:510:29: note: no known conversion for argument 1 from 'll' {aka 'long long int'} to 'std::map<std::map<int, int>, int>::key_type&&' {aka 'std::map<int, int>&&'}
510 | operator[](key_type&& __k)
| ~~~~~~~~~~~^~~
foo.cc:65:6: error: no match for 'operator[]' (operand types are 'std::map<std::map<int, int>, int>' and 'll' {aka 'long long int'})
65 | dp[l][r]=ans;
| ^
In file included from /usr/include/c++/9/map:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from foo.cc:1:
/usr/include/c++/9/bits/stl_map.h:490:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::map<int, int>; _Tp = int; _Compare = std::less<std::map<int, int> >; _Alloc = std::allocator<std::pair<const std::map<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::map<int, int>]'
490 | operator[](const key_type& __k)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_map.h:490:34: note: no known conversion for argument 1 from 'll' {aka 'long long int'} to 'const key_type&' {aka 'const std::map<int, int>&'}
490 | operator[](const key_type& __k)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_map.h:510:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::map<int, int>; _Tp = int; _Compare = std::less<std::map<int, int> >; _Alloc = std::allocator<std::pair<const std::map<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::map<int, int>]'
510 | operator[](key_type&& __k)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_map.h:510:29: note: no known conversion for argument 1 from 'll' {aka 'long long int'} to 'std::map<std::map<int, int>, int>::key_type&&' {aka 'std::map<int, int>&&'}
510 | operator[](key_type&& __k)
| ~~~~~~~~~~~^~~
foo.cc:73:6: error: no match for 'operator[]' (operand types are 'std::map<std::map<int, int>, int>' and 'll' {aka 'long long int'})
73 | dp[l][r]=ans;
| ^
In file included from /usr/include/c++/9/map:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:81,
from foo.cc:1:
/usr/include/c++/9/bits/stl_map.h:490:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::map<int, int>; _Tp = int; _Compare = std::less<std::map<int, int> >; _Alloc = std::allocator<std::pair<const std::map<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::map<int, int>]'
490 | operator[](const key_type& __k)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_map.h:490:34: note: no known conversion for argument 1 from 'll' {aka 'long long int'} to 'const key_type&' {aka 'const std::map<int, int>&'}
490 | operator[](const key_type& __k)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_map.h:510:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::map<int, int>; _Tp = int; _Compare = std::less<std::map<int, int> >; _Alloc = std::allocator<std::pair<const std::map<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::map<int, int>]'
510 | operator[](key_type&& __k)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_map.h:510:29: note: no known conversion for argument 1 from 'll' {aka 'long long int'} to 'std::map<std::map<int, int>, int>::key_type&&' {aka 'std::map<int, int>&&'}
510 | operator[](key_type&& __k)
| ~~~~~~~~~~~^~~
foo.cc:79:37: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} [-Wformat=]
79 | for (i = 0; i < q; i++) printf("%lld\n", cnt[i]);
| ~~~^
| |
| long long int
| %d
foo.cc:21:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
21 | for (i = 0; i < n; i++) scanf("%lld", &v[i]);
| ~~~~~^~~~~~~~~~~~~~~
foo.cc:24:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
24 | scanf("%lld%lld", &t[i].l, &t[i].r);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~