Submission #156645

#TimeUsernameProblemLanguageResultExecution timeMemory
156645a_playerGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define f first #define s second #define mp make_pair #define pb push_back using namespace std; typedef long long ll; int mas=0; ll vv[100]; int k=0; int N; void ric(ll a,ll b){ ll u,v; cout<<a<<" "<<b<<endl; cin>>u>>v; if(u==-1&&v==-1)return; if(u==v){vv[k++]=u; return;} ll pivot=(v-u)/(N-k); int ini=u; for(int i=0;i<N-k-1;i++){ pivot=(v-ini)/(N-k); ric(ini,ini+max(0LL,pivot-1)); ini+=pivot; } if(ini<v)ric(ini,v); } int findGap(int T,int N){ ::N=N; if(T==2){ ric(0LL,1000000000000000000LL); for(int i=0;i<N-1;i++)mas=max(mas,vv[i+1]-vv[i]); return mas; } return 0; }

Compilation message (stderr)

gap.cpp: In function 'int findGap(int, int)':
gap.cpp:35:49: error: no matching function for call to 'max(int&, ll)'
  for(int i=0;i<N-1;i++)mas=max(mas,vv[i+1]-vv[i]);
                                                 ^
In file included from /usr/include/c++/7/bits/char_traits.h:39:0,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from gap.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^~~
/usr/include/c++/7/bits/stl_algobase.h:219:5: note:   template argument deduction/substitution failed:
gap.cpp:35:49: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll {aka long long int}')
  for(int i=0;i<N-1;i++)mas=max(mas,vv[i+1]-vv[i]);
                                                 ^
In file included from /usr/include/c++/7/bits/char_traits.h:39:0,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from gap.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
/usr/include/c++/7/bits/stl_algobase.h:265:5: note:   template argument deduction/substitution failed:
gap.cpp:35:49: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll {aka long long int}')
  for(int i=0;i<N-1;i++)mas=max(mas,vv[i+1]-vv[i]);
                                                 ^
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from gap.cpp:1:
/usr/include/c++/7/bits/stl_algo.h:3462:5: note: candidate: template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)
     max(initializer_list<_Tp> __l)
     ^~~
/usr/include/c++/7/bits/stl_algo.h:3462:5: note:   template argument deduction/substitution failed:
gap.cpp:35:49: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  for(int i=0;i<N-1;i++)mas=max(mas,vv[i+1]-vv[i]);
                                                 ^
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from gap.cpp:1:
/usr/include/c++/7/bits/stl_algo.h:3468:5: note: candidate: template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
/usr/include/c++/7/bits/stl_algo.h:3468:5: note:   template argument deduction/substitution failed:
gap.cpp:35:49: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
  for(int i=0;i<N-1;i++)mas=max(mas,vv[i+1]-vv[i]);
                                                 ^