# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
950781 | Dec0Dedd | Catfish Farm (IOI22_fish) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "fish.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int N = 3e5+10;
ll n, m, x[N], y[N], w[N], dp[N], cnt[N][N], p[N][N];
ll max_weights(int _n, int _m, vector<int> _x, vector<int> _y, vector<int> _w) {
n=_n, m=_m;
ll s=0;
for (int i=1; i<=m; ++i) {
x[i]=_x[i-1], y[i]=_y[i-1], w[i]=_w[i-1];
++x[i], ++y[i];
cnt[x[i]][y[i]]+=w[i];
s+=w[i];
} return s;
}