m.cpp's blog

By m.cpp, 9 months ago, In English

Hi!

I'm practicing coding in the new Rust language and today I'm struggling while solving this problem: 557E - Аня и полупалиндром. The main idea is to build a trie that contains all the suffixes of a binary string $$$s$$$ having a maximum length of $$$5000$$$.

I was able to code in C++ and get an AC, but when I switched to Rust, I got MLE verdict on test 9. Though both solutions have the same approach.

I think the main issue is that my $$$trie$$$ array contains too many elements and there are differences in the data storage mechanisms between C++ and Rust.

I'm new to this language anyway so any suggestions are appreciated. Thanks in advance!

Full text and comments »

  • Vote: I like it
  • +20
  • Vote: I do not like it