hell_hacker's blog

By hell_hacker, history, 4 months ago, In English,

The contest submissions aren't made public and there is no editorial so I am asking here about the approaches for these 2 problems:

Misha and Fibonacci numbers

Digit product

Thanks!

Read more »

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

By hell_hacker, history, 5 months ago, In English,

1218 Perfect Service

I wanted some insights on how to solve this problem.

My WA Approach: I thought all the non-leaf nodes in centroid decomposed tree would be the answer (with the exception of n = 1 where answer would be 1)

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By hell_hacker, history, 6 months ago, In English,

In order to study rotating calliper technique this website is listed at many places, but it is not working anymore.

http://cgm.cs.mcgill.ca/~orm/rotcal.html

Is it down temporarily or that resource is no more available?

Read more »

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

By hell_hacker, history, 7 months ago, In English,

In this problem Coprimes I saw some solutions using mobius function. Can anyone throw some light on how mobius function can be used in this problem. Thank you!

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By hell_hacker, history, 22 months ago, In English,

I had a vector of pairs. I wanted it sorted in descending according to the first value of the vector.

sort(a.begin(),a.end(),[](pair<int,int> &left, pair<int,int> &right){
         return left.first >= right.first;
});

This gave me TLE. Sorting it normally

sort(a.begin(),a.end());

and iterating from the end worked.

Why does the first sorting function give TLE? Do I have to implement it some other way?

Read more »

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

By hell_hacker, history, 2 years ago, In English,

Here is the problem

Here is my solution

I tried to solve it using treaps.

I keep on getting WA. In another attempt I tried to store values in map for checking duplicates(i won't insert when duplicates) but I got TLE. Can anyone help me in finding out the bug. Thanks.

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By hell_hacker, history, 3 years ago, In English,

I read that there are many great problems on POI. But the website is not loading. POI.Where can I find these problems ?

Thank You.

Read more »

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

By hell_hacker, history, 3 years ago, In English,

My approach for ChessMetric is to find all the positions reachable from position start, then put them in a queue of tuples where first and second elements are the co-ordinates and the third is number of moves. But it is giving Memory limit exceeded. Any idea how to make this efficient? I used unsigned short int for co-ordinates and number of moves.

Thank You.

Read more »

Tags dp
 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By hell_hacker, history, 3 years ago, In English,

In this question http://codeforces.com/contest/330/problem/B I want to ask why the star graph would give minimum number of paths. Thank You.

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it