Submission #795992

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7959922023-07-28 03:24:18boyliguanhanComparing Plants (IOI20_plants)C++17
5 / 100
66 ms11092 KiB
#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();
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...