# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112233 | PagodePaiva | Fortune Telling 2 (JOI14_fortune_telling2) | C++17 | 3 ms | 8784 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 int long long
#define fr first
#define sc second
using namespace std;
const int N = 200010;
const int B = 200;
int v[N][2];
int blocks[N];
struct Segtree{
pair <int, int> tree[4*N]; int lazy[4*N];
pair <int, int> join(pair <int, int> a, pair <int, int> b){
return {max(a.fr, b.fr), max(a.sc, b.sc)};
}
void unlazy(int node, int l, int r){
if(lazy[node]%2) swap(tree[node].fr, tree[node].sc);
if(l != r){
lazy[2*node] += lazy[node];
lazy[2*node+1] += lazy[node];
}
lazy[node] = 0;
}
void build(int node, int l, int r){
lazy[node] = 0;
if(l == r){
tree[node] = {v[l][0], v[l][1]};
return;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |