Submission #779398

#TimeUsernameProblemLanguageResultExecution timeMemory
779398jasminComparing Plants (IOI20_plants)C++14
0 / 100
1 ms212 KiB
#include "plants.h" #include<bits/stdc++.h> using namespace std; vector<int> ps; //anzahl kleiner zeichen void init(int k, std::vector<int> r) { int n=r.size(); ps.assign(n+1, 0); for(int i=0; i<n; i++){ ps[i+1] = ps[i] + r[i]; } } int compare_plants(int x, int y) { if(x<y){ int ssum = ps[y] - ps[x]; if(ssum == y-x){ return -1; } return 0; } else{ int ssum = ps[x] - ps[y]; if(ssum == x-y){ return 1; } return 0; } 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...