Submission #961578

#TimeUsernameProblemLanguageResultExecution timeMemory
961578Gr1senComparing Plants (IOI20_plants)C++17
0 / 100
1 ms600 KiB
#include "plants.h" #include<iostream> #include<vector> #include<algorithm> using namespace std; #define vi vector<int> #define vvi vector<vi> vi R; void init(int k, std::vector<int> r) { R = r; } int compare_plants(int x, int y) { int a = R[x+1]; bool q = 0; if (y < x) {swap(x, y); q = 1;} for (int i = x+2; i <= y; i++) { if (R[i] != a) return 0; } if (q) return (a ? -1 : 1); return (a ? 1 : -1); }
#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...