golf.cpp:13:9: error: 'int y1' redeclared as different kind of entity
13 | int x1, y1, x2, y2;
| ^~
In file included from /usr/include/features.h:461,
from /usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:518,
from /usr/include/c++/10/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
from golf.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:221:1: note: previous declaration 'double y1(double)'
221 | __MATHCALL (y1,, (_Mdouble_));
| ^~~~~~~~~~
golf.cpp: In function 'int main()':
golf.cpp:21:13: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'double (*)(double) noexcept' [-Wformat=]
21 | scanf("%d %d %d %d %d", &x1, &y1, &x2, &y2, &n);
| ~^ ~~~
| | |
| int* double (*)(double) noexcept
golf.cpp: In function 'void renumber()':
golf.cpp:34:53: error: no matching function for call to 'push_back(double (&)(double) noexcept)'
34 | vx.push_back(x1), vx.push_back(x2), vy.push_back(y1), vy.push_back(y2);
| ^
In file included from /usr/include/c++/10/vector:67,
from /usr/include/c++/10/functional:62,
from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from golf.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:1187: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)
1187 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1187:7: note: conversion of argument 1 would be ill-formed:
golf.cpp:34:51: error: invalid conversion from 'double (*)(double) noexcept' to 'std::vector<int>::value_type' {aka 'int'} [-fpermissive]
34 | vx.push_back(x1), vx.push_back(x2), vy.push_back(y1), vy.push_back(y2);
| ^~
| |
| double (*)(double) noexcept
In file included from /usr/include/c++/10/vector:67,
from /usr/include/c++/10/functional:62,
from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from golf.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]' (near match)
1203 | push_back(value_type&& __x)
| ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1203:7: note: conversion of argument 1 would be ill-formed:
golf.cpp:34:51: error: invalid conversion from 'double (*)(double) noexcept' to 'std::vector<int>::value_type' {aka 'int'} [-fpermissive]
34 | vx.push_back(x1), vx.push_back(x2), vy.push_back(y1), vy.push_back(y2);
| ^~
| |
| double (*)(double) noexcept
golf.cpp:47:5: error: assignment of function 'double y1(double)'
47 | y1 = lower_bound(vy.begin(), vy.end(), y1) - vy.begin() + 1;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
golf.cpp: In function 'void solve()':
golf.cpp:79:46: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
79 | for(int i=0; i<4; i++) dq.push_back(dat(x1, y1, i, 1));
| ^~
| |
| double (*)(double) noexcept
golf.cpp:60:17: note: initializing argument 2 of 'dat::dat(int, int, int, int)'
60 | dat(int x, int y, int dir, int dist): x(x), y(y), dir(dir), dist(dist){}
| ~~~~^
In file included from /usr/include/c++/10/bits/stl_algobase.h:71,
from /usr/include/c++/10/bits/specfun.h:45,
from /usr/include/c++/10/cmath:1927,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
from golf.cpp:1:
/usr/include/c++/10/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_less_val::operator()(_Iterator, _Value&) const [with _Iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Value = double(double) noexcept]':
/usr/include/c++/10/bits/stl_algobase.h:1324:14: required from '_ForwardIterator std::__lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&, _Compare) [with _ForwardIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Tp = double(double) noexcept; _Compare = __gnu_cxx::__ops::_Iter_less_val]'
/usr/include/c++/10/bits/stl_algobase.h:1359:32: required from '_ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Tp = double(double) noexcept]'
golf.cpp:47:43: required from here
/usr/include/c++/10/bits/predefined_ops.h:67:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
67 | { return *__it < __val; }
| ~~~~~~^~~~~~~
golf.cpp: In function 'int main()':
golf.cpp:21:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
21 | scanf("%d %d %d %d %d", &x1, &y1, &x2, &y2, &n);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
golf.cpp:23:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
23 | scanf("%d %d %d %d", &rects[i].xl, &rects[i].xr, &rects[i].yl, &rects[i].yr);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~