Submission #438584

#TimeUsernameProblemLanguageResultExecution timeMemory
438584AmineTrabelsiComparing Plants (IOI20_plants)C++14
5 / 100
129 ms7900 KiB
#include "plants.h" #include <bits/stdc++.h> using namespace std; const int M = 200005; int pref[M]; int n; void init(int k, vector<int> r) { n = r.size(); for(int i=0;i<n;i++){ pref[i+1] = pref[i]+r[i]; } return; } int compare_plants(int x, int y) { if(pref[y]-pref[x] == 0)return 1; if(pref[n]-pref[y]+pref[x] == 0)return -1; if(pref[y]-pref[x] == y-x)return -1; if(pref[n]-pref[y]+pref[x] == n-y+x)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...