Submission #1100406

# Submission time Handle Problem Language Result Execution time Memory
1100406 2024-10-13T18:09:22 Z codexistent Rima (COCI17_rima) C++14
0 / 140
65 ms 262144 KB
#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
1 Runtime error 55 ms 262144 KB Execution killed with signal 9
2 Runtime error 55 ms 262144 KB Execution killed with signal 9
3 Runtime error 54 ms 262144 KB Execution killed with signal 9
4 Runtime error 61 ms 262144 KB Execution killed with signal 9
5 Runtime error 60 ms 262144 KB Execution killed with signal 9
6 Runtime error 54 ms 262144 KB Execution killed with signal 9
7 Runtime error 59 ms 262144 KB Execution killed with signal 9
8 Runtime error 62 ms 262144 KB Execution killed with signal 9
9 Runtime error 64 ms 262144 KB Execution killed with signal 9
10 Runtime error 65 ms 262144 KB Execution killed with signal 9