Submission #743897

# Submission time Handle Problem Language Result Execution time Memory
743897 2023-05-18T05:55:13 Z beepbeepsheep Izvanzemaljci (COI21_izvanzemaljci) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef tree<long long, null_type, less_equal<>,
        rb_tree_tag, tree_order_statistics_node_update>
        ordered_set;
#define ll long long
#define ii pair<ll,ll>

#ifndef DEBUG
#define cerr if (0) cerr
#define endl '\n'
#endif

const ll inf=1e15;
const ll maxn=1e5+5;
const ll mod=1e9+7;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n,k,x,y,minx=inf,miny=inf,maxx=-inf,maxy=-inf;
	cin>>n>>k;
	assert(k==1);
	for (int i=1;i<=n;i++){
		cin>>x>>y;
		minx=min(minx,x);
		miny=min(miny,y);
		maxx=max(maxx,x);
		maxy=max(maxy,y);
	}
	cout<<minx<<' '<<miny<<' '<<max({maxx-minx,maxy-miny,1});
	return 0;
}

Compilation message

izvanzemaljci.cpp: In function 'int main()':
izvanzemaljci.cpp:37:57: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   37 |  cout<<minx<<' '<<miny<<' '<<max({maxx-minx,maxy-miny,1});
      |                                                         ^
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:37:57: note:   candidate expects 2 arguments, 1 provided
   37 |  cout<<minx<<' '<<miny<<' '<<max({maxx-minx,maxy-miny,1});
      |                                                         ^
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:37:57: note:   candidate expects 3 arguments, 1 provided
   37 |  cout<<minx<<' '<<miny<<' '<<max({maxx-minx,maxy-miny,1});
      |                                                         ^
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:37:57: note:   deduced conflicting types for parameter '_Tp' ('long long int' and 'int')
   37 |  cout<<minx<<' '<<miny<<' '<<max({maxx-minx,maxy-miny,1});
      |                                                         ^
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:37:57: note:   deduced conflicting types for parameter '_Tp' ('long long int' and 'int')
   37 |  cout<<minx<<' '<<miny<<' '<<max({maxx-minx,maxy-miny,1});
      |                                                         ^