Submission #972497

#TimeUsernameProblemLanguageResultExecution timeMemory
972497sleepntsheepRainforest Jumps (APIO21_jumps)C++17
4 / 100
585 ms1984 KiB
#include "jumps.h" #include <vector> int subtask; void init(int N, std::vector<int> H) { if (N <= 200) subtask = 2; else if (N <= 2000) subtask = 3; int flag = 1; for (int i = 1; i < N; ++i) if (H[i] != H[i-1] + 1) flag = 0; if(flag) subtask = 1; } int minimum_jumps(int A, int B, int C, int D) { if (subtask == 1) { if (A > D) return -1; if (B >= C) return 0; return C - B; } return 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...