# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
378114 | reymontada61 | Selling RNA Strands (JOI16_selling_rna) | C++14 | 942 ms | 35924 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 <bits/stdc++.h>
using namespace std;
int n, q;
const int MXN = 100005;
string arr[MXN];
vector<pair<string, int>> proc;
string pre, suf;
bool usep;
bool after(int x) {
if (usep) {
for (int i=0; i<min(pre.size(), arr[x].size()); i++) {
if (pre[i] < arr[x][i]) return true;
if (pre[i] > arr[x][i]) return false;
}
return arr[x].size() >= pre.size();
}
else {
for (int i=0; i<min(suf.size(), proc[x].first.size()); i++) {
if (suf[i] < proc[x].first[i]) return true;
if (suf[i] > proc[x].first[i]) return false;
}
return proc[x].first.size() >= suf.size();
}
}
int first() {
if (!after(n)) return n + 1;
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... |