dualthread's blog

By dualthread, history, 2 months ago, In English

Hey guys, just wanna share my approach and wanna know your way of doing them!

Problem A: Walk the Line

Quite a famous puzzle, sorting the array and the traveller with min element always takes others to other end.

Problem B: Line by Line

lets say probability is x (p/100), for the n-1 lines, total prob. is x^(n-1) and lets say we have y as the increased prob. so y^n = x^(n-1) => y = x^(1-1/n). So our increase is p — y*100. (Use doubles)

Problem D1: Line of Delivery (Part 1)

As each of the stone can replace next stone and pass on the energy, the final positions will be the same as input energies. If 0 to i stones are thrown, the resulting positions will be sorted energies of 0 to i. So just sorting the array and indexing 1 from end works. Taking the upper or lower key with min difference for each G outputs ans.

Problem C: Fall in Line

Problem D2: Line of Delivery (Part 2)

If you guys solved problem C & D2, please let me know your approaches.

Full text and comments »

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

By dualthread, history, 18 months ago, In English

If anyone has experience with Union By Rank and Path Compression or knows of resources that provide clear examples and explanations, I would greatly appreciate your assistance.

Also problems on CF related to it (if any).

Full text and comments »

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

By dualthread, history, 21 month(s) ago, In English

Was waiting for the competitions! But found this, and now I'm disappointed. "After more than 10 years of Kick Start, it's time to say goodbye. While Kick Start and Coding Practice with Kick Start will not continue as planned, we invite you to participate in our Code Jam | Kick Start Farewell Round on Saturday, April 15 at 14:00 UTC.

The Farewell Round will consist of 4 concurrent rounds with Code Jam and Kick Start-style problems of different levels of difficulty." ye dukh kaahe khatam ni hota

Full text and comments »

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

By dualthread, history, 21 month(s) ago, In English

Which of the following offers better overall complexity in terms of both time and space (Java)

a). 2 ArrayDeque structures

or

b). a Single TreeMap ?

Can you provide some guidance on this?

I was trying to solve 1793C - Dora and Search in the Codeforces Round 852 (Div. 2) with both options, I passed all the test cases using a TreeMap, but it seems to have memory size of 15100 KB. Can you guys help in evaluating complexities and suggesting which of them is better?

Full text and comments »

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