# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
88128 | KCSC | Pinball (JOI14_pinball) | C++14 | 417 ms | 31772 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;
const int DIM = 300005;
struct Segment {
int lef, rig, pos, val; } seg[DIM];
pair<long long, long long> sgt[DIM << 2]; vector<int> lst;
void update(int tp, int nd, int le, int ri, int ps, long long vl) {
if (le == ri) {
!tp ? (sgt[nd].first = min(sgt[nd].first, vl)) :
(sgt[nd].second = min(sgt[nd].second, vl)); }
else {
int md = (le + ri) / 2;
(ps <= md) ? update(tp, nd << 1, le, md, ps, vl) :
update(tp, nd << 1 | 1, md + 1, ri, ps, vl);
sgt[nd] = make_pair(min(sgt[nd << 1].first, sgt[nd << 1 | 1].first),
min(sgt[nd << 1].second, sgt[nd << 1 | 1].second)); } }
pair<long long, long long> query(int nd, int le, int ri, int st, int en) {
if (st <= le and ri <= en) {
return sgt[nd]; }
else {
int md = (le + ri) / 2;
if (en <= md) {
return query(nd << 1, le, md, st, en); }
if (md < st) {
return query(nd << 1 | 1, md + 1, ri, st, en); }
auto lans = query(nd << 1, le, md, st, en),
# | 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... |