Submission #567402

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5674022022-05-23 12:07:37Bill_00Rainforest Jumps (APIO21_jumps)C++14
27 / 100
1238 ms45556 KiB
#include "jumps.h"
#include <bits/stdc++.h>
#include <vector>
using namespace std;
int best[200005][25], rightt[200005][25], h[200005], n, tallest[2000000], L[200005];
void update(int id, int l, int r, int pos, int val){
if(h[val] > h[tallest[id]]){
tallest[id] = val;
}
if(l == r){
return;
}
int m = l + r >> 1;
if(m >= pos){
update(id * 2, l, m, pos, val);
}
else update(id * 2 + 1, m + 1, r, pos, val);
}
int query(int id, int l, int r, int lef, int rig){
if(lef > rig) return 200004;
if(r < lef || rig < l) return 200004;
if(lef <= l && r <= rig) return tallest[id];
int m = l + r >> 1;
int lll = query(id * 2, l, m, lef, rig);
int rrr = query(id * 2 + 1, m + 1, r, lef, rig);
return (h[lll] > h[rrr] ? lll : rrr);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

jumps.cpp: In function 'void update(int, int, int, int, int)':
jumps.cpp:14:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   14 |   int m = l + r >> 1;
      |           ~~^~~
jumps.cpp: In function 'int query(int, int, int, int, int)':
jumps.cpp:25:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   25 |   int m = l + r >> 1;
      |           ~~^~~
jumps.cpp: In function 'int minimum_jumps(int, int, int, int)':
jumps.cpp:92:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   92 |       int mmm = lll + rrr >> 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...
#Verdict Execution timeMemoryGrader output
Fetching results...