[Help] How to optimize memory of Trie in 1625D — Binary Spiders

Правка en1, от simp_pro, 2023-12-08 21:20:47

Problem link: https://codeforces.me/contest/1625/problem/D

Sorry for necroposting, but I didn't find any solution for this in comments or anywhere

In problem D, The editorial solution uses a trie. if you use trie. Then there are at most nlogA vertices. If we implement using pointers then its memory would be nlogA*32 (32 if because of pointer address size in 32 bit compiler) = 3*10^5*30*30 = 2.7*10^8 ~ 2 GB. But memory limit is just 256 MB. How to solve this issue?

My MLE submission

Теги trie

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский simp_pro 2023-12-08 21:20:47 619 Initial revision (published)