RubenAshughyan's blog

By RubenAshughyan, history, 5 years ago, In English

CodeJam is a great platform with interesting problems. But I think I'm not the only one who is annoyed because you can not filter all the participants from your country. That feature can help you to find your friends who are participating too, but you can find them if you know their username beforehand.

I have found a work-around solution for that.

  • Copy this
BLAHBLAH
  • Create a new bookmark on your browser with the above url.

  • Then visit CodeJam leaderboard page, e.g. 2020 CodeJam Qualification Round (you can do it even in incognito mode, if you are suspicious about the security).

  • When the page finished loading, click the bookmark you just added.

  • There will be a window — write the name of your country there e.g. ("Sweden", "Armenia", "India").

  • Open the browser console F12 — you'll see the list of participants from your country growing step by step.

  • The list will gradually increase in size with more pages parsed. Look for familiar people :)

  • If you are happy at some point and don't want to continue, type debugger in the console, and freely explore the list.

An example of output: (for "India").

Full text and comments »

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

By RubenAshughyan, history, 5 years ago, In English

This blog is to discuss the problems of Northwestern Russia Regional Contest round 2019 held on October 26.

The problems: https://neerc.ifmo.ru/archive/2019/northern/northwest-russia-2019-statements.pdf

What was your approach on problem B (Bad Treap) ?

Full text and comments »

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

By RubenAshughyan, history, 6 years ago, In English

Hi everyone. Today I encountered a data structures problem, which is a slight swist on standart segment tree problem.

You are given an array A of size N. N ≤ 10^5, A[i] ≤ 10^6, You need to process 3 types of queries

  1. Print the sum of all integers ai where L ≤ i ≤ R.

  2. Add x to each integer ai where L ≤ i ≤ R.

  3. For each integer A[i] where L ≤ i ≤ R, replace it with floor(sqrt(A[i])). Where sqrt(a) is the square root of a, and floor(b) is the integer value of b after removing everything on the right of the decimal point.

There can be Q≤20000 queries.

If we didn't have type 3 query, then we are left with standard lazy segment tree problem.

How to handle 3rd type queries?

Full text and comments »

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