# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
128961 | EntityIT | Bubble Sort 2 (JOI18_bubblesort2) | C++14 | 2142 ms | 89804 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
const int N = (int)5e5 + 5, Q = N, inf = (int)1e9 + 123;
int n, q, order_q[N], order_a[N];
struct It {
struct Node {
int cnt, mx, lz;
Node (int _cnt = 0, int _mx = -inf, int _lz = 0) : cnt(_cnt), mx(_mx), lz(_lz) {}
Node operator+ (const Node &_) const { return Node(cnt + _.cnt, max(mx, _.mx), 0); }
} node[N << 3];
void true_val (int nd, int Left, int Right) {
if (!node[nd].lz) return ;
node[nd].mx += node[nd].lz;
if (Left != Right) {
node[nd << 1].lz += node[nd].lz;
node[nd << 1 | 1].lz += node[nd].lz;
}
node[nd].lz = 0;
}
void upd_rep (int nd, int Left, int Right, int pos, int val_mx, int val_cnt) {
true_val(nd, Left, Right);
if (pos < Left || Right < pos) return ;
if (Left == Right) {
node[nd] = Node(val_cnt, val_mx, 0);
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... |