# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
788618 | WLZ | Match (CEOI16_match) | C++17 | 62 ms | 36756 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;
class trie {
private:
struct trie_node {
trie_node *parent;
vector<trie_node*> children;
vector<int> val;
} *cur;
string s;
public:
trie() {
cur = new trie_node{nullptr, vector<trie_node*>(26, nullptr), vector<int>(26, -1)};
s = "";
}
void update(char c, int x) {
cur->val[c - 'a'] = x;
}
int query(char c) {
return cur->val[c - 'a'];
}
void go_up() {
cur = cur->parent;
s.pop_back();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |