Submission #1138409

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11384092025-01-22 11:27:07duckindogFood Court (JOI21_foodcourt)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 250'000 + 10;
int n, m, q;
namespace IT1 {
vector<long long> lazy[N << 2];
void shrink(int s) {
while (lazy[s].size() >= 2) {
if (lazy[s].back() <= 0) {
lazy[s].end()[-2] += lazy[s].back();
lazy[s].pop_back();
continue;
}
if (lazy[s].back() > 0 && lazy[s].end()[-2] >= 0) {
lazy[s].end()[-2] += lazy[s].back();
lazy[s].pop_back();
continue;
}
break;
}
if (lazy[s].size() && lazy[s].back() == 0) lazy[s].pop_back();
}
void push(int s) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

foodcourt.cpp: In function 'void IT2::update(long long int, long long int, long long int, long long int, long long int)':
foodcourt.cpp:64:17: error: no matching function for call to 'max(long long int&, int)'
   64 |       f[s] = max(x, 0);
      |              ~~~^~~~~~
In file included from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from foodcourt.cpp:1:
/usr/include/c++/11/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++/11/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
foodcourt.cpp:64:17: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   64 |       f[s] = max(x, 0);
      |              ~~~^~~~~~
In file included from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from foodcourt.cpp:1:
/usr/include/c++/11/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++/11/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
foodcourt.cpp:64:17: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   64 |       f[s] = max(x, 0);
      |              ~~~^~~~~~
In file included from /usr/include/c++/11/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from foodcourt.cpp:1:
/usr/include/c++/11/bits/stl_algo.h:3461:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3461 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/11/bits/stl_algo.h:3461:5: note:   template argument deduction/substitution failed:
foodcourt.cpp:64:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   64 |       f[s] = max(x, 0);
      |              ~~~^~~~~~
In file included from /usr/include/c++/11/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from foodcourt.cpp:1:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/11/bits/stl_algo.h:3467:5: note:   template argument deduction/substitution failed:
foodcourt.cpp:64:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   64 |       f[s] = max(x, 0);
      |              ~~~^~~~~~