stanislav.bezkorovainyi's blog

By stanislav.bezkorovainyi, history, 3 years ago, In English
Tutorial is loading...

C++ code: 46178226

Tutorial is loading...

C++ code: 46178084

Tutorial is loading...

C++ code: 46178118

Tutorial is loading...

C++ code: 46178228

Tutorial is loading...

C++ code: 46178239

Tutorial is loading...

C++ code: 46178244

Read more »

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

By stanislav.bezkorovainyi, history, 3 years ago, In English

I got two solutions for http://codeforces.com/contest/1036/problem/F

First one: 42893786 Second one: 42893945

First solution gets MLE, though it differs from second one only in line 81. On this line in first approach I try to use precalculated values from the array, instead of calculating them anew.

Can someone explain how a person can get MLE because of trying to get a value from an array?

Read more »

Tags mle
 
 
 
 
  • Vote: I like it
  • +5
  • Vote: I do not like it

By stanislav.bezkorovainyi, history, 3 years ago, In English

I tried to test perfomance of different approaches to build and use trie data structure.

I used 706D - Мультимножество Василия to test my versions of tries on it.

The question is: Why does approach with pointers takes 2 times more memory than one with static array? As I know, a pointer stores an address of a variable, so it shouldn't take that much memory.

Here are my submissions:

Pointer approach: 40063381

Static array approach: 40063561

Any suggestions are welcomed!

Read more »

 
 
 
 
  • Vote: I like it
  • -11
  • Vote: I do not like it