# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
641958 | eyangch | Sjeckanje (COCI21_sjeckanje) | C++17 | 363 ms | 42912 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>
#define endl '\n'
#define eat cin
#define moo cout
#define int long long
using namespace std;
struct segtree{
int a[800005][2][2];
int b[800005];
void init(){
for(int i = 0; i < 800005; i++){
for(int j = 0; j < 2; j++){
for(int k = 0; k < 2; k++){
a[i][j][k] = 0;
}
}
b[i] = 0;
}
}
void upd(int i, int x, int l=0, int r=200000, int v=1){
if(i < l || i > r) return;
if(l == r){
b[v] += x;
a[v][0][0] = a[v][0][1] = a[v][1][0] = a[v][1][1] = 0;
if(b[v] > 0){
a[v][0][0] = b[v];
}else{
a[v][1][1] = -b[v];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |