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,

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.

• -21

By Rock2000, 4 years ago,

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.

• 0

By Rock2000, history, 4 years ago,

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
• -18

By Rock2000, history, 4 years ago,

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?

Code 1
Code 2
• -18

By Rock2000, history, 4 years ago,
Tourist Code

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

• -2

By Rock2000, history, 4 years ago,

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

• -9

By Rock2000, history, 4 years ago,

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.