# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1105225 | vako_p | Measures (CEOI22_measures) | C++14 | 397 ms | 50248 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;
#define ll long long
#define pb push_back
const int mxN = 1e6 + 5;
ll n,a[mxN],b[mxN],d,n1,m,idx[mxN];
map<ll,ll> idx1;
set<ll> ss;
struct segtree{
vector<ll> v,p,s,cnt;
ll sz = 1;
void init(){
while(sz < n) sz *= 2;
v.assign(2 * sz, 0LL);
p.assign(2 * sz, -1e10);
s.assign(2 * sz, -1e10);
cnt.assign(2 * sz, 0LL);
}
void set(ll i, ll x, ll lx, ll rx){
if(rx - lx == 1){
s[x] = -idx[min(i + 1, n - 1)] + idx[i] + cnt[x] * d;
p[x] = cnt[x] * d;
v[x] = cnt[x] * d;
cnt[x]++;
// if(i == 2) cout << i << ' ' << lx << ' ' << rx << "---> " << p[x] << ' ' << s[x] << " : " << v[x] << '\n';
return;
# | 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... |