# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
531591 | erke | Type Printer (IOI08_printer) | C++11 | 136 ms | 120144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
struct Node {
bool isLeaf;
vector<Node*> adj;
int dep, far;
Node(): isLeaf(false), adj(26, nullptr), dep(0), far(-1) {}
};
struct Trie {
Node* root;
Trie() { root = new Node; }
void insert(Node* &node, int pos, string &s) {
if (node == nullptr) node = new Node;
if (pos == (int) s.size()) {
node->isLeaf = true;
return;
}
insert(node->adj[s[pos] - 'a'], pos + 1, s);
node->dep = max(node->dep, node->adj[s[pos] - 'a']->dep + 1);
if (node->far == -1 || node->adj[s[pos] - 'a']->dep > node->adj[node->far]->dep) {
node->far = s[pos] - 'a';
}
}
void insert(string &s) {
insert(root, 0, s);
}
};
# | 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... |
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |