# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
797942 | acatmeowmeow | Type Printer (IOI08_printer) | C++11 | 67 ms | 38936 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;
#define int long long
struct trie {
bool mark;
int height = 1;
trie *next[26];
void extend(int index) { if (!next[index]) next[index] = new trie(); }
void add(string&s, int index) {
if (s.size() - 1 == index) mark = true;
else {
char nextChar = s[index + 1];
extend(nextChar - 'a');
next[nextChar - 'a']->add(s, index + 1);
}
}
void query(vector<char>&ans) {
if (mark) ans.push_back('P');
for (int i = 0; i < 26; i++) {
if (!next[i]) continue;
ans.push_back(i + 'a');
next[i]->query(ans);
ans.push_back('-');
}
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... |
# | 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... |