Submission #448466

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4484662021-07-30 08:49:25nickyrioFinancial Report (JOI21_financial)C++17
5 / 100
373 ms14464 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 100;
int a[N], f[N], IT[N << 2], perm[N], kount[N], rightMost[N], leftMost[N];
void Update(int k, int l, int r, int u, int v) {
if (l == r) { IT[k] = v; return; }
int m = l + r >> 1;
if (u <= m) Update(k << 1, l, m, u, v);
else Update(k << 1 | 1, m + 1, r, u, v);
IT[k] = max(IT[k << 1], IT[k << 1 | 1]);
}
int Query(int k, int l, int r, int u, int v) {
if (l > v || r < u) return 0;
if (u <= l && r <= v) return IT[k];
int m = (l + r) >> 1;
return max(Query(k << 1, l, m, u, v), Query(k << 1 | 1, m + 1, r, u, v));
}
int root(int u) { return (kount[u] < 0 ? u : kount[u] = root(kount[u])); }
void Union(int u, int v) {
// cerr << "Union" << u << ' ' << v << '\n';
u = root(u), v = root(v);
if (u == v) return;
int t = kount[u] + kount[v];
if (kount[u] > kount[v]) swap(u, v);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In function 'void Update(int, int, int, int, int)':
Main.cpp:11:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   11 |     int m = l + r >> 1;
      |             ~~^~~
#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...