# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1039869 | parsadox2 | Comparing Plants (IOI20_plants) | C++17 | 40 ms | 6652 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>
#define F first
#define S second
using namespace std;
const int N = 2e5 + 10;
int n , k , f[2][N];
vector <int> a;
void init(int kk, vector<int> r) {
a = r;
k = kk;
n = r.size();
f[0][n - 1] = -1;
f[1][n - 1] = -1;
f[a[n - 1]][n - 1] = n - 1;
for(int i = n - 2 ; i >= 0 ; i--)
{
f[0][i] = f[0][i + 1];
f[1][i] = f[1][i + 1];
f[a[i]][i] = i;
}
for(int i = n - 1 ; i >= 0 ; i--)
{
if(f[0][i] == -1)
f[0][i] = f[0][0];
# | 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... |