# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
795992 | boyliguanhan | Comparing Plants (IOI20_plants) | C++17 | 66 ms | 11092 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;
#define N 200100
int n;
int pos[N], loc[N], cnt;
deque<int> R;
int info[200100][2];
void init2(vector<int> r) {
R.resize(n=r.size());
iota(R.begin(), R.end(), 0);
for(int i = 0; i < n; i++)
if(r[R.front()] == r[R.back()])
R.push_back(R.front()),R.pop_front();
else
break;
for(int i = 0; i < n; i++)
loc[R[i]] = i;
info[R.front()][0] = 0;
info[R.front()][1] = r[R.front()];
int prev = R.front();
R.pop_front();
for(int i = 1; i < n; i++) {
info[R.front()][1] = r[R.front()];
if(r[R.front()]!=r[prev]) {
info[R.front()][0] = ++cnt;
} else {
info[R.front()][0] = info[prev][0];
}
prev = R.front();
# | 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... |