제출 #667029

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6670292022-11-30 08:02:57tatyam메기 농장 (IOI22_fish)C++17
9 / 100
222 ms20676 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void chmax(ll& a, ll b){ if(a < b) a = b; }
// range chmax1 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;
}
};
long long 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]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...