Submission #302228

#TimeUsernameProblemLanguageResultExecution timeMemory
302228arthurconmyComparing Plants (IOI20_plants)C++14
0 / 100
1 ms384 KiB
#include <bits/stdc++.h> using namespace std; #ifndef ARTHUR_LOCAL #include "plants.h" #endif using ll = long long; #define len(x) int((x).size()) #define ff first #define ss second // #ifdef ARTHUR_LOCAL vector<int> R; int n; void init(int k, vector<int> r) { R=r; n=len(R); return; } int compare_plants(int x, int y) { int i=x; bool isinc=0; bool isdec=0; while(1) { if(i==y) break; if(R[i]==1) isinc=1; else isdec=1; i++; i%=n; } if(!isinc) return -1; if(!isdec) return 1; isinc=0; isdec=0; i=y; while(1) { if(i==x) break; if(R[i]==1) isinc=1; else isdec=1; i++; i%=n; } if(!isinc) return 1; if(!isdec) 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...