Submission #1010746

#TimeUsernameProblemLanguageResultExecution timeMemory
1010746gaurezzzComparing Plants (IOI20_plants)C++17
0 / 100
4054 ms2996 KiB
#include <bits/stdc++.h> #define F first #define S second #define ll long long #define nd '\n' using namespace std; vector <int> plants; ll n=0; void init (int k, vector <int> r){ plants = r; n = r.size(); } int compare_plants(int x, int y){ bool menor=1, mayor=1; if (x == y) return 0; for (ll i=x; i<y; i++){ if (plants[i] != 1) mayor=0; else menor=0; } if (mayor) return -1; else if (menor) return 1; mayor=1; menor=1; for (ll i=y; (i%n)!=x; i++){ if (i == n) i=0; if (plants[i] != 1) mayor=0; else menor=0; } if (mayor) return 1; else if (menor) 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...