Submission #600872

#TimeUsernameProblemLanguageResultExecution timeMemory
600872PiejanVDCComparing Plants (IOI20_plants)C++17
0 / 100
2 ms1888 KiB
#include "plants.h" #include <bits/stdc++.h> using namespace std; vector<int>l(200005),h(200005), R; int N; void init(int k, vector<int>r) { R = r; N = r.size(); for(int i = 1 ; i < N ; i++) { if(r[i-1]) { h[i] = h[i-1]; l[i] = i; } else { h[i] = i; l[i] = l[i-1]; } } } int compare_plants(int x, int y) { if(h[y] == h[x]) return -1; if(l[y] == l[x]) return 1; if(h[N-1] == h[y] && h[x] == h[0] && R[N-1]) return 1; if(l[N-1] == l[y] && l[x] == l[0]) return -1; 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...