Submission #294268

#TimeUsernameProblemLanguageResultExecution timeMemory
294268Muhammetali모임들 (IOI18_meetings)C++11
Compilation error
0 ms0 KiB
#include "meetings.h" #include <bits/stdc++.h> #define mp make_pair #define f first #define s second #define sz(x) (int)(x).size() #define rsz resize #define ins insert #define ft front() #define bk back() #define pf push_front #define pb push_back #define eb emplace_back #define lb lower_bound #define ub upper_bound using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pi; typedef pair<ll,ll> pl; typedef vector<int> vi; typedef vector<bool> vb; typedef vector<ll> vl; typedef vector<pi> vpi; typedef vector<pl> vpl; template<class T>bool tmin(T& a,T b){if(a>b){a=b;return 1;}return 0;} template<class T>bool tmax(T& a,T b){if(a<b){a=b;return 1;}return 0;} int tree[5000][5000],n; ll jem[5000][5000]; vl C; std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L,std::vector<int> R) { n=sz(H); for (int i=0;i<sz(H);i++) { int mx=0; for (int j=i;j>=0;j--) { mx=max(mx,H[j]); tree[i][j]=mx; } mx=0; for (int j=i;j<sz(H);j++) { mx=max(mx,H[j]); tree[i][j]=mx; } } for (int i=0;i<sz(H);i++) { jem[i][0]=tree[i][0]; for (int j=1;j<sz(H);j++) { jem[i][j]=jem[i][j-1]+tree[i][j]; } } for (int i=0;i<sz(L);i++) { ll res=INT_MAX; for (int j=L[i];j<=R[i];j++) { res=min(res,R[i]-L[i-1]); } C.pb(res); } return C; }

Compilation message (stderr)

meetings.cpp: In function 'std::vector<long long int> minimum_costs(std::vector<int>, std::vector<int>, std::vector<int>)':
meetings.cpp:62:27: error: no matching function for call to 'min(ll&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type)'
   62 |    res=min(res,R[i]-L[i-1]);
      |                           ^
In file included from /usr/include/c++/9/vector:60,
                 from meetings.h:3,
                 from meetings.cpp:1:
/usr/include/c++/9/bits/stl_algobase.h:198:5: note: candidate: 'template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)'
  198 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/9/bits/stl_algobase.h:198:5: note:   template argument deduction/substitution failed:
meetings.cpp:62:27: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   62 |    res=min(res,R[i]-L[i-1]);
      |                           ^
In file included from /usr/include/c++/9/vector:60,
                 from meetings.h:3,
                 from meetings.cpp:1:
/usr/include/c++/9/bits/stl_algobase.h:246:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  246 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/9/bits/stl_algobase.h:246:5: note:   template argument deduction/substitution failed:
meetings.cpp:62:27: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   62 |    res=min(res,R[i]-L[i-1]);
      |                           ^
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from meetings.cpp:2:
/usr/include/c++/9/bits/stl_algo.h:3444:5: note: candidate: 'template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)'
 3444 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/9/bits/stl_algo.h:3444:5: note:   template argument deduction/substitution failed:
meetings.cpp:62:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   62 |    res=min(res,R[i]-L[i-1]);
      |                           ^
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from meetings.cpp:2:
/usr/include/c++/9/bits/stl_algo.h:3450:5: note: candidate: 'template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)'
 3450 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/9/bits/stl_algo.h:3450:5: note:   template argument deduction/substitution failed:
meetings.cpp:62:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   62 |    res=min(res,R[i]-L[i-1]);
      |                           ^