# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1009330 | Muhammet | Knapsack (NOI18_knapsack) | 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 "wall.h"
#define ll long long
#define ff first
#define ss second
#define sz(s) (int)s.size()
using namespace std;
const ll N = 2000100;
pair<int,int> st[N];
vector <int> v;
void lz(int nd){
if(nd * 2 < N){
st[nd*2].ff = min(st[nd].ss,st[nd*2].ff);
st[nd*2].ff = max(st[nd].ff,st[nd*2].ff);
st[nd*2].ss = min(st[nd].ss,st[nd*2].ss);
st[nd*2].ss = max(st[nd].ff,st[nd*2].ss);
}
if(nd * 2 + 1 < N){
st[nd*2+1].ff = min(st[nd].ss,st[nd*2+1].ff);
st[nd*2+1].ff = max(st[nd].ff,st[nd*2+1].ff);
st[nd*2+1].ss = min(st[nd].ss,st[nd*2+1].ss);
st[nd*2+1].ss = max(st[nd].ff,st[nd*2+1].ss);
}
return;