Submission #1035598

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10355982024-07-26 12:17:12May27_thFinancial Report (JOI21_financial)C++17
100 / 100
337 ms59560 KiB
#include<bits/stdc++.h>
using namespace std;
#define i64 long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
int N, D;
struct Tree{
int n;
vector<int64_t>lazy;
vector<int64_t>st;
Tree(int _n, int64_t _v): n(_n), st(_n * 4, _v), lazy(_n * 4, _v){};
void push(int id){
int64_t add = lazy[id];
lazy[id * 2] += add, st[id * 2] += add;
lazy[id * 2 + 1] += add, st[id * 2 + 1] += add;
lazy[id] = 0;
}
void update(int id, int l, int r, int u, int v, int64_t val){
if (v < l || u > r) return;
if (u <= l && r <= v) {
st[id] = val;
lazy[id] = val;
return;
}
// push(id);
int mid = (l + r)/2;
update(id * 2, l, mid, u, v, val);
update(id * 2 + 1, mid + 1, r, u, v, val);
st[id] = max(st[id * 2], st[id * 2 + 1]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In constructor 'Tree::Tree(int, int64_t)':
Main.cpp:11:18: warning: 'Tree::st' will be initialized after [-Wreorder]
   11 |   vector<int64_t>st;
      |                  ^~
Main.cpp:10:18: warning:   'std::vector<long int> Tree::lazy' [-Wreorder]
   10 |   vector<int64_t>lazy;
      |                  ^~~~
Main.cpp:12:3: warning:   when initialized here [-Wreorder]
   12 |   Tree(int _n, int64_t _v): n(_n), st(_n * 4, _v), lazy(_n * 4, _v){};
      |   ^~~~
#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...