# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
330408 | 2020-11-25T07:14:46 Z | Azert | Type Printer (IOI08_printer) | C++14 | 74 ms | 117996 KB |
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; int nnode; int trie[N][30]; void add(string a) { int cur = 0; for (int i = 0; i < a.size(); i++) { if (trie[cur][a[i] - 'a'] == -1) { trie[cur][a[i] - 'a'] = ++nnode; } cur = trie[cur][a[i] - 'a']; } } int main() { int n, m = 0; scanf("%d", &n); string tmp; memset(trie, -1, sizeof(trie)); for (int i = 1; i <= n; i++) { cin >> tmp; m = max(m, (int)tmp.size()); add(tmp); } // cout << nnode << "\n"; printf("%d\n", 2 * nnode + n - m); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 64 ms | 117868 KB | Line "" doesn't correspond to pattern "[a-z\-P]{1}" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 64 ms | 117740 KB | Line "" doesn't correspond to pattern "[a-z\-P]{1}" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 65 ms | 117888 KB | Line "" doesn't correspond to pattern "[a-z\-P]{1}" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 64 ms | 117740 KB | Line "" doesn't correspond to pattern "[a-z\-P]{1}" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 62 ms | 117740 KB | Line "" doesn't correspond to pattern "[a-z\-P]{1}" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 62 ms | 117740 KB | Line "" doesn't correspond to pattern "[a-z\-P]{1}" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 63 ms | 117888 KB | Line "" doesn't correspond to pattern "[a-z\-P]{1}" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 66 ms | 117848 KB | Line "" doesn't correspond to pattern "[a-z\-P]{1}" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 71 ms | 117996 KB | Line "" doesn't correspond to pattern "[a-z\-P]{1}" |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 74 ms | 117996 KB | Line "" doesn't correspond to pattern "[a-z\-P]{1}" |
2 | Halted | 0 ms | 0 KB | - |