# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
667032 | tatyam | Catfish Farm (IOI22_fish) | C++17 | 260 ms | 23208 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>
using namespace std;
using ll = long long;
void chmax(ll& a, ll b){ if(a < b) a = b; }
// range chmax・1 点取得 で O(M log N)
struct SegTree {
ll n;
vector<ll> seg;
SegTree(ll n): n(n), seg(n * 2) {}
void range_chmax(ll l, ll r, ll x) {
l += n;
r += n;
while(l < r){
if(l & 1) chmax(seg[l++], x);
if(r & 1) chmax(seg[--r], x);
l >>= 1; r >>= 1;
}
}
ll operator[](ll i) const {
i += n;
ll x = 0;
do chmax(x, seg[i]); while(i >>= 1);
return x;
}
};
ll max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) {
vector fish(N, vector<pair<ll, ll>>{});
for (ll i = 0; i < M; i++) {
fish[X[i]].emplace_back(Y[i], W[i]);
# | 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... |