Submission #743890

# Submission time Handle Problem Language Result Execution time Memory
743890 2023-05-18T05:52:14 Z kxd Izvanzemaljci (COI21_izvanzemaljci) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define ld long double
#define pb push_back
#define p_q priority_queue
#define m_p make_pair
#define pii pair<int,int>
#define endl '\n'
#define INIT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define forn(i, n) for (int i = 0; i < n; i++)
#define forn1(i, n) for (int i = 1; i <= n; i++)
#define all(x) x.begin(),x.end()
#define ft first
#define sd second

using namespace std;
const int N = 1e5+5;
const int inf = 1e9;
const int INF = 1e18;
const int MOD = 1e9+7;

int a[N];

signed main() {
	INIT
	int n, k;
	cin >> n >> k;
	int x, y;
	int minx = INF, miny = INF, maxx = 0, maxy = 0;
	forn(i,n) {
		cin >> x >> y;
		minx = min(x,minx);
		miny = min(y,miny);
		maxx = max(x,maxx);
		maxy = max(y,maxy);
	}
	cout << minx << ' ' << miny << ' ' << max(1,max(maxx-minx,maxy-miny));
}

Compilation message

izvanzemaljci.cpp: In function 'int main()':
izvanzemaljci.cpp:39:70: error: no matching function for call to 'max(int, const long long int&)'
   39 |  cout << minx << ' ' << miny << ' ' << max(1,max(maxx-minx,maxy-miny));
      |                                                                      ^
In file included 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 izvanzemaljci.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
izvanzemaljci.cpp:39:70: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   39 |  cout << minx << ' ' << miny << ' ' << max(1,max(maxx-minx,maxy-miny));
      |                                                                      ^
In file included 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 izvanzemaljci.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
izvanzemaljci.cpp:39:70: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   39 |  cout << minx << ' ' << miny << ' ' << max(1,max(maxx-minx,maxy-miny));
      |                                                                      ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from izvanzemaljci.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
izvanzemaljci.cpp:39:70: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   39 |  cout << minx << ' ' << miny << ' ' << max(1,max(maxx-minx,maxy-miny));
      |                                                                      ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from izvanzemaljci.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
izvanzemaljci.cpp:39:70: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   39 |  cout << minx << ' ' << miny << ' ' << max(1,max(maxx-minx,maxy-miny));
      |                                                                      ^