# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1100406 | codexistent | Rima (COCI17_rima) | C++14 | 65 ms | 262144 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 ll long long
#define FOR(i, a, b) for(ll i = a; i <= b; i++)
struct Trie{
ll nx[26], ct = 0;
Trie () {
FOR(i, 0, 25) nx[i] = -1;
}
};
ll n, trie_idx = 1;
Trie trie[3000005];
int main(){
char c = 'b';
FOR(i, 1, 3000000){
ll ptr = 0;
if(trie[ptr].nx[c - 'a'] == -1){
trie[ptr].nx[c - 'a'] = trie_idx;
trie_idx++;
}
ptr = trie[ptr].nx[c - 'a'];
trie[ptr].ct++;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |