# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
431537 | saleh | Comparing Plants (IOI20_plants) | C++17 | 14 ms | 14400 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "plants.h"//
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200 * 1000 + 23;//, INF = 1e6;
int n, R[MAXN];
vector<int> v[MAXN], ps[MAXN], ind[MAXN];
void init(int k, vector<int> r) {
n = r.size();
if (k == 2) {
int tmp = -1;
for (int i = 1; i <= n; i++) if (r[i % n] != r[i - 1]) tmp = i;
int cnt = 0;
v[0].push_back(tmp);
ps[tmp].push_back(0);
ind[tmp].push_back(0);
R[0] = r[tmp];
for (int i = 1; i <= n; i++) if (r[(tmp + i - 1) % n] == r[(tmp + i) % n]) {
v[cnt].push_back((tmp + i) % n);
ps[(tmp + i) % n].push_back(cnt);
ind[(tmp + i) % n].push_back(v[cnt].size() - 1);
} else {
v[cnt].push_back((tmp + i) % n);
ps[(tmp + i) % n].push_back(cnt);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |