Submission #1261571

#TimeUsernameProblemLanguageResultExecution timeMemory
1261571avighnaObstacles for a Llama (IOI25_obstacles)C++20
0 / 100
53 ms6468 KiB
#include "obstacles.h"

std::vector<int> h, t;
std::vector<int> psum;
int m;

bool b(int i, int j) {
  return t[i] > h[j];
}

void initialize(std::vector<int> T, std::vector<int> H) {
  h = H, t = T;
  m = h.size();
  psum.resize(m);
  psum[0] = b(0, 0);
  for (int j = 1; j < m; ++j) {
    psum[j] = psum[j - 1] + b(0, j);
  }
}

bool can_reach(int l, int r, int s, int d) {
  // int val = psum[d];
  // if (s != 0) {
  //   val -= psum[s - 1];
  // }
  // return val == d - s + 1;
  return true;
}
#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...