# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
730406 | jampm | Selling RNA Strands (JOI16_selling_rna) | C++17 | 244 ms | 243824 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;
using pii = pair<int, int>;
#define all(a) a.begin(), a.end()
const int Mxn = 6e6 + 1, mxn = 1e5 + 1;
int get(char c) {
if (c == 'A') return 0;
if (c == 'G') return 1;
if (c == 'U') return 2;
return 3;
}
struct Tnode {
Tnode * ch[4];
vector<int> vals;
int tin, tout;
Tnode() {
for (int i = 0; i < 4; i++) ch[i] = NULL;
}
bool exists(int x) {return ch[x] != NULL;}
void safe(int x) {if (!exists(x)) ch[x] = new Tnode;}
};
void insert(string s, int idx, Tnode * node) {
for (auto e : s) {
node->safe(get(e)); node = node->ch[get(e)];
}
node->vals.push_back(idx);
}
# | 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... |