Submission #391509

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3915092021-04-19 05:45:02_eveHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
100 / 100
1865 ms104860 KiB
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = (int)1e6 + 10;
const int mod = 1e9 + 7;
const ll inf = 1e17 + 10;
int n, q, a[N], ans[N];
struct Q{
int l,k,id;
Q() {};
Q(int _l,int _k,int _id) : l(_l), k(_k), id(_id) {};
};
vector<Q> query[N];
ll t[N * 4];
void upd(int p,ll x,int u,int l,int r) {
if(l == r) {
t[u] = x;
return;
}
int m = l + r >> 1;
if(p <= m) upd(p,x,u << 1,l,m);
else upd(p,x,u << 1 | 1,m + 1,r);
t[u] = max(t[u << 1],t[u << 1 | 1]);
}
int get(int ql,int qr,int u,int l,int r) {
if(ql > r || l > qr) return -1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

sortbooks.cpp: In function 'void upd(int, long long int, int, int, int)':
sortbooks.cpp:24:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   24 |     int m = l + r >> 1;
      |             ~~^~~
sortbooks.cpp: In function 'int get(int, int, int, int, int)':
sortbooks.cpp:32:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   32 |     int m = l + r >> 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...