Submission #1251340

#TimeUsernameProblemLanguageResultExecution timeMemory
1251340pirhosigCatfish Farm (IOI22_fish)C++20
Compilation error
0 ms0 KiB
#include "fish.h"
#include <bits/stdc++.h>
#define  R(a) for (int i = 0; i < a; ++i)
#define RR(a) for (int j = 0; j < a; ++j)
using namespace std;
typedef long long ll;
typedef vector<int> vi;



ll max_weights(int N, int M, vi X, vi Y, vi W) {
    vector<vector<ll>> val(2, vector<ll>(N));
    R(N) val[X[i]][Y[i]] = W[i];
    partial_sum(val[0].begin(), val[0].end(), val[0].begin());
    partial_sum(val[1].rbegin(), val[1].rend(), val[1].rbegin());

    ll ans = val[1][0];
    R(N - 1) ans = max(ans, val[0][i], val[1][i + 1]);
    
    return ans;
}

Compilation message (stderr)

In file included from /usr/include/c++/11/vector:60,
                 from fish.h:1,
                 from fish.cpp:1:
/usr/include/c++/11/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
fish.cpp:18:23:   required from here
/usr/include/c++/11/bits/stl_algobase.h:303:17: error: '__comp' cannot be used as a function
  303 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~