UnDefined__Behavior's blog

By UnDefined__Behavior, history, 7 weeks ago, In English

Solving problems is my favorate way of practicing , however if i solve 3 problems or 100 problems a day the activity grid will be colored by dark green So I suggest to add a new color to the daily activity grid which doesn't appear if you didn't solve at least 10 or some number of problems . So if you solve 10 problems the grid will be black that's would motivate me and other users and it's easy to add to the website , so why not ?

Full text and comments »

By UnDefined__Behavior, history, 2 months ago, In English

Hi codeforces , I was arguing with my friend about which is the best type of functions , so we had to try every type of functions in c++ .

I tried all three types of functions on some recursion problems and I got the following result :

Time complexity :

  1. normal function : it was the fastest .
  2. lambda function : it was slower than the normal function by 20 ms .
  3. std function : it was slower than the previous two by 200 ms .

Memory complexity :

  1. std function : was the best .
  2. normal function : was worse than std function by 30000 kb (maybe that's because of changing the arrays' identification to a global scope with const length)
  3. lambda : was exactly the same as the normal function (without using global scope) .

this result was satisfying but when I tried on other problems a contradictory result appeared :

Time complexity :

  1. normal function : it was the fastest .
  2. std function : it was slower than the normal function by 100 ms .
  3. lambda function : it was slower than std by 30 ms .

Memory complexity :

  1. std function : was the best .
  2. lambda : was worse than std function by 100 kb (nothing) .
  3. normal function : was worse than std function by 6000 kb (maybe that's because of changing the arrays' identification to a global scope with const length) .

so I was wondering what is the best type of functions for time complexity and memory complexity (depending on assembly and how many additional assembly lines for every type) cause even reading the documentation wasn't useful .

thanks in advance .

the unexpected result submission links :

std : 363673434 lambda : 363682810 normal : 363673624

Full text and comments »

By UnDefined__Behavior, history, 3 months ago, In English

1. Is it allowed to use references and snippets in codeforces official rounds ?

Most of my friends uses references in the contests , so I was wondering if it's allowed to use a code that I wrote before such like segment tree implementation , or it's considered as cheating ?

2. Will using snippets affect on my performance in olympiads and other contests ?

I'm practicing for IOI and ICPC , and I'm afraid that using snippets will make it difficult for me to implement those codes which I used to use snippets for . So will that really affect my performance in olympiads if I used it well ?

Guide me please.. And Thank you

Full text and comments »