Submission #1322770

#TimeUsernameProblemLanguageResultExecution timeMemory
1322770kargneqObstacles for a Llama (IOI25_obstacles)C++20
0 / 100
2094 ms5880 KiB
#include <bits/stdc++.h>
using namespace std;

vector<int> He;
int t;
int n, m;

void initialize(std::vector<int> T, std::vector<int> H) {
    t = T[0];
    He = H;
    n = T.size();
    m = H.size();
}

bool can_reach( int L, int R, int S, int D) { //
    if (S > D) {
        while (S > D) {
            S--;
            if (t <= He[S]) return false;
        }
        if (S == D) return true;
    } else if (S < D) {
        while (S < D) {
            S++;
            if (t <= He[S]) return false;
        }
        if (S == D) return true;
    }
    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...