Submission #431058

#TimeUsernameProblemLanguageResultExecution timeMemory
431058MOUF_MAHMALATComparing Plants (IOI20_plants)C++14
0 / 100
1 ms256 KiB
#include "plants.h" #include<bits/stdc++.h> using namespace std; typedef int ll; vector<ll>v; ll k,a[200009],n; void init(int K, vector<int> r) { v=r,n=v.size(); for(ll i=0; i<n; i++) { if(v[i]) a[(i+1)%n]=a[i]-1; else a[(i+1)%n]=a[i]+1; } } int compare_plants(int x, int y) { if(a[x]==a[y]) return 0; if(a[x]>a[y]) return 1; return -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...