Submission #952834

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9528342024-03-25 02:01:56onepunchac168Rainforest Jumps (APIO21_jumps)C++14
100 / 100
1022 ms77940 KiB
#include "jumps.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mask(x) (1<<x)
typedef int ll;
typedef pair <ll,ll> ii;
const int N=2e5+5;
ll nxtb[N];
ll nxta[N];
int n;
ll a[N];
ll mx[20][N];
ll pos[N];
ll sa[N],sb[N];
ll nxt[N][20];
vector <ll> adj[N];
ll cha[N][20];
ll get(int u,int v)
{
ll kc=log2(v-u+1);
//cout<<u<<" "<<v<<" "<<kc<<" "<<mx[kc][u]<<" "<<mx[kc][v-mask(kc)+1]<<" "<<v<<" "<<mask(kc)<<'\n';
return max(mx[kc][u],mx[kc][v-mask(kc)+1]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

jumps.cpp: In function 'void init(int, std::vector<int>)':
jumps.cpp:111:53: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
  111 |             mx[i][j]=max(mx[i-1][j],mx[i-1][j+mask(i-1)]);
      |                                                    ~^~
jumps.cpp:11:21: note: in definition of macro 'mask'
   11 | #define mask(x) (1<<x)
      |                     ^
jumps.cpp: In function 'int minimum_jumps(int, int, int, int)':
jumps.cpp:155:36: warning: 'res' may be used uninitialized in this function [-Wmaybe-uninitialized]
  155 |         gmax=min(gmax,sb[bb]-sb[res]);
      |                              ~~~~~~^
#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...