# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
832438 | rnl42 | Catfish Farm (IOI22_fish) | C++17 | 1064 ms | 2097152 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 "fish.h"
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
#define int long long
using piii = pair<int,pair<int,int>>;
#ifdef DEBUG
#define dbg(x) cerr << "(" #x ") = " << x << '\n'
#define dbgln() cerr << '\n'
#else
#define dbg(x) void(0)
#define dbgln(x) void(0)
#endif
int max_weights(signed N, signed M, vector<signed> X, vector<signed> Y, vector<signed> W) {
vector<vector<int>> grid(N, vector<int>(N+2));
vector<vector<int>> cumulsum(N, vector<int>(N+2));
for (int i = 0; i < M; i++) grid[X[i]][Y[i]] = W[i];
for (int x = 0; x < N; x++) {
for (int y = 0; y <= N; y++) {
cumulsum[x][y+1] = cumulsum[x][y]+grid[x][y];
}
}
vector<vector<int>> best_asc(N, vector<int>(N+2)), best_desc(N, vector<int>(N+2));
for (int y = 0; y <= N+1; y++) {
best_asc[0][y] = cumulsum[0][y+1];
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |