Submission #411149

#TimeUsernameProblemLanguageResultExecution timeMemory
411149eagle30Comparing Plants (IOI20_plants)C++14
0 / 100
1 ms216 KiB
#include "plants.h" #include<bits/stdc++.h> using namespace std; int pref[1000000], n, tot=0; void init(int k, vector<int> r) { n=r.size(); for(int i=0; i<n; i++){ tot+=r[i]; pref[i+1]=pref[i]+r[i]; } return; } int compare_plants(int x, int y) { int u=pref[y]-pref[x]; if(u==y-x || tot==u) return -1; else if(u==0 || tot-u==y-x){ return 1; } else{ 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...