Submission #251492

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2514922020-07-21 13:26:12nvmdavaSky Walking (IOI19_walk)C++17
100 / 100
2063 ms156668 KiB
#include "walk.h"
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ll long long
#define ss second
const int N = 1000'005;
vector<int> br[N];
vector<pair<int, int> > adj[N];
int mx[N];
int n;
void build(vector<int>& h, int id, int l, int r){
if(l == r){
mx[id] = h[l];
return;
}
int m = (l + r) >> 1;
build(h, id << 1, l, m);
build(h, id << 1 | 1, m + 1, r);
mx[id] = max(mx[id << 1], mx[id << 1 | 1]);
}
int find_right(int id, int l, int r, int L, int R, int x){
if(L > r || R < l) return -1;
if(L <= l && r <= R){
if(mx[id] < x) return -1;
if(l == r) return r;
int m = (l + r) >> 1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

walk.cpp: In function 'long long int min_distance(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, int, int)':
walk.cpp:75:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0; i < l.size(); ++i){
                 ~~^~~~~~~~~~
walk.cpp:101:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while(i < sweep.size() && sweep[i].ff <= w.ff){
         ~~^~~~~~~~~~~~~~
#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...