# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
693097 | horiseun | Selling RNA Strands (JOI16_selling_rna) | C++11 | 341 ms | 455048 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 <iostream>
#include <vector>
#include <tuple>
#include <string>
#include <algorithm>
using namespace std;
#define f first
#define s second
int n, m, nx[2][2000005][30], x[2000005], y[2000005], idx1, idx2;
vector<int> v[2000005];
string s[2000005];
void update1(string curr, int pos) {
int nd = 0;
for (int i = 0; i < curr.size(); i++) {
if (!nx[0][nd][curr[i] - 'A']) nx[0][nd][curr[i] - 'A'] = idx1++;
x[nd] = min(x[nd], pos);
y[nd] = max(y[nd], pos);
nd = nx[0][nd][curr[i] - 'A'];
}
x[nd] = min(x[nd], pos);
y[nd] = max(y[nd], pos);
}
void update2(string curr, int pos) {
int nd = 0;
for (int i = curr.size() - 1; i >= 0; i--) {
if (!nx[1][nd][curr[i] - 'A']) nx[1][nd][curr[i] - 'A'] = idx2++;
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... |