# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1105953 | Zero_OP | Catfish Farm (IOI22_fish) | C++17 | 160 ms | 44972 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> //uh may be changing style make it better ?
#ifndef LOCAL
#include <fish.h>
#endif // LOCAL
using namespace std;
#define sz(v) (int)v.size()
#define all(v) begin(v), end(v)
template<typename T> bool maximize(T& a, const T& b){
if(a < b) return a = b, true; return false;
}
long long max_weights(int sizeBoard, int nFishes, vector<int> column, vector<int> row, vector<int> weight){
vector<vector<pair<int, int>>> fishes(sizeBoard);
for(int i = 0; i < nFishes; ++i){
fishes[column[i]].emplace_back(row[i], weight[i]);
}
vector<vector<long long>> pref(sizeBoard);
vector<vector<long long>> up(sizeBoard), down(sizeBoard);
for(int i = 0; i < sizeBoard; ++i){
fishes[i].emplace_back(sizeBoard, 0);
sort(all(fishes[i]));
pref[i].resize(sz(fishes[i]));
for(int j = 0; j < sz(fishes[i]); ++j){
pref[i][j] = (j > 0 ? pref[i][j - 1] : 0) + fishes[i][j].second;
}
Compilation message (stderr)
# | 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... |