# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
398813 | nikatamliani | Selling RNA Strands (JOI16_selling_rna) | C++14 | 403 ms | 291656 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;
const int N = 2e5+10, p = 37, MOD = 1e9+7;
string s[N];
int n, m, P[N];
bool check(const string &a, const string &b) { // a >= b ? true : false
int mini = min((int)a.size(), (int)b.size());
for(int i = 0; i < mini; ++i) {
if(a[i] != b[i]) {
return a[i] > b[i];
}
}
return mini == (int)b.size();
}
bool is_prefix(const string &a, const string &b) {
if((int)a.size() > (int)b.size()) {
return false;
}
for(int i = 0; i < (int)a.size(); ++i) {
if(a[i] != b[i]) {
return false;
}
}
return true;
}
int find_first(const string &p) {
int l = 1, r = n, pos = n+1;
while(r >= l) {
int m = l + r >> 1;
if(check(s[m], p)) {
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... |