Submission #1083598

#TimeUsernameProblemLanguageResultExecution timeMemory
1083598fv3Comparing Plants (IOI20_plants)C++17
5 / 100
54 ms9548 KiB
#include "plants.h" #include <bits/stdc++.h> using namespace std; int K, N; vector<int> ps; void init(int k, vector<int> r) { K = k; N = (int)r.size(); r.insert(r.end(), r.begin(), r.end()); ps = vector<int>(N*2|1); for (int i = 0; i < 2*N; i++) ps[i+1] = ps[i] + r[i]; } int compare_plants(int x, int y) { if (ps[y] - ps[x] == 0 || ps[x+N] - ps[y] == N + x - y) return 1; if (ps[y] - ps[x] == y - x || ps[x+N] - ps[y] == 0) return -1; return 0; } #ifdef TEST #include "grader.cpp" #endif
#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...