Submission #934904

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9349042024-02-28 07:03:13IBoryNew Home (APIO18_new_home)C++17
47 / 100
5096 ms535808 KiB
#include <bits/stdc++.h>
#define pii pair<int, int>
using namespace std;
const int SZ = 1 << 20;
int P[SZ], S[SZ], X[SZ], ans[SZ];
multiset<int> CX[SZ];
struct Seg {
priority_queue<int> T[SZ << 1], E[SZ << 1];
int CL[SZ << 1], CR[SZ << 1];
void Update(int L, int R, int v, bool e) {
int sL = 1, sR = SZ, n = 1;
queue<tuple<int, int, int>> Q;
Q.emplace(1, SZ, 1);
while (!Q.empty()) {
auto [sL, sR, n] = Q.front(); Q.pop();
if (R < sL || sR < L) continue;
if (L <= sL && sR <= R) {
(e ? E[n] : T[n]).push(v);
continue;
}
int mid = (sL + sR) >> 1;
Q.emplace(sL, mid, n * 2);
Q.emplace(mid + 1, sR, n * 2 + 1);
}
}
int Query(int p) {
int sL = 1, sR = SZ, n = 1, ret = -1e9;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

new_home.cpp: In member function 'void Seg::Update(int, int, int, bool)':
new_home.cpp:14:7: warning: unused variable 'sL' [-Wunused-variable]
   14 |   int sL = 1, sR = SZ, n = 1;
      |       ^~
new_home.cpp:14:15: warning: unused variable 'sR' [-Wunused-variable]
   14 |   int sL = 1, sR = SZ, n = 1;
      |               ^~
new_home.cpp:14:24: warning: unused variable 'n' [-Wunused-variable]
   14 |   int sL = 1, sR = SZ, n = 1;
      |                        ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...