Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Rock2000's blog

By Rock2000, history, 4 years ago, In English

Can someone please tell me how to solve this problem? I saw the editorial but couldn't understand how to solve the subtask 7. Thanks in advance.

Full text and comments »

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

By Rock2000, 4 years ago, In English

I was solving this problem. I solved it with my intuition and the solution I thought was also given in the editorial. But I couldn't find proof of this solution anywhere. Can anyone please give me proof for the solution of this problem. Thanks in advance.

Full text and comments »

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

By Rock2000, history, 4 years ago, In English

I appeared for Flipkart coding test day before yesterday and got stuck on this problem:
You are given an undirected weighted graph with n vertices and m edges. In one move you can make any edge weight zero. You can perform atmost K moves. You have to tell what is the shortest path from a starting node A to an ending node B after performing atmost K moves.
1<=n<=1000
0<=K<n
1<=m<=10000
1<=w<=10^9 (weight of edge)
Can anybody please tell me how to approach this problem?
I found this problem on quora also but couldn't understand the approach clearly.
[UPD]: This problem has been solved thanks to ExplodingFreeze and _dobby_

Code

Full text and comments »

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

By Rock2000, history, 4 years ago, In English

The first code is giving correct answer while second code is giving wrong answer. The only difference between these two codes is:
In the first code the return value is -2*inf in the getmax function while it is -inf in the second code. Can anybody please help me figure out what is the problem?
Link to Problem

Code 1
Code 2

Full text and comments »

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

By Rock2000, history, 4 years ago, In English

Problem link

Tourist Code

What I do not understand is how after finding array b we get the correct answer.
Thanks in advance.

Full text and comments »

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

By Rock2000, history, 4 years ago, In English

Hello guys, I made a video for the Problem The Number of Products
Link to Video
I hope you like this video.

Full text and comments »

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

By Rock2000, history, 4 years ago, In English

Hello Codeforces, I recently started my YouTube Channel and started to create a Complete Dynamic Programming Course from beginner to advanced. And today I made a video on Flipping Game Problem which I find very interesting. In the video I explained how to reach from O(n^3) to O(n) time complexity.

Link to video

Please watch at 1.25x speed for better experience.
I hope you like the video.

Full text and comments »

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

By Rock2000, history, 4 years ago, In English
  • Vote: I like it
  • +28
  • Vote: I do not like it