Submission #760364

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7603642023-06-17 13:49:22danikoynovRainforest Jumps (APIO21_jumps)C++14
100 / 100
1090 ms44164 KiB
#include "jumps.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10, maxlog = 21;
int n, h[maxn], left_child[maxn], right_child[maxn];
int dp[maxlog][maxn], fp[maxlog][maxn];
bool sorted;
struct node
{
int mx, pos;
node(int _mx = 0, int _pos = 0)
{
mx = _mx;
pos = _pos;
}
};
node merge_node(node lf, node rf)
{
node nd;
if (lf.mx > rf.mx)
nd = lf;
else
nd = rf;
return nd;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

jumps.cpp: In function 'int walk(int, int, int, int, int, int)':
jumps.cpp:64:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   64 |     if (left > qright || right < qleft || tree[root].mx < val)
      |     ^~
jumps.cpp:66:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   66 |         if (left == right)
      |         ^~
jumps.cpp: In function 'void init(int, std::vector<int>)':
jumps.cpp:125:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  125 |     for (int j = 1; j < maxlog; j ++)
      |     ^~~
jumps.cpp:132:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  132 |         build_tree(1, 1, n);
      |         ^~~~~~~~~~
jumps.cpp: In function 'int minimum_jumps(int, int, int, int)':
jumps.cpp:223:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  223 |         if (pos == -1)
      |         ^~
jumps.cpp:225:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  225 |             int  ans = 0;
      |             ^~~
#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...