VeryGoodVeryGood's blog

By VeryGoodVeryGood, history, 4 years ago, In English

Hi CodeForces, I've been trying to solve this problem for a long time now but really don't get anything about it. I have read the editorial but I can't seem to understand what author means by saying cnt is multiple of x. How does that help solving the problem, could somebody provide an example of how it works or a better explanation. Thanks and sorry if this question is a bit dumb.

EDIT: I am very sorry for posting duplicate question (I have found a comment already discussing this problem) and not specifying the details. Will search next time.

Full text and comments »

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

By VeryGoodVeryGood, history, 4 years ago, In English

Hi, this is my first time writing here. I've recently gotten into algorithms (2.5-3 months ago) and I've started learning Floyd Warshall a few days ago. One problem I've found on CP Algorithms (regarding this topic) is Traveling Graph (21D) here on CF. I've done the FW for the shortest path and found a way to tell if there is no solution at all, but that's as far as I've gotten. I've been challenging myself for four days but after some research today I found out it is similar to Traveling Salesman problem — is this the write way to approach the problem or is there a way to do it using Floyd's algo, if so could you elaborate on it further? Thanks.

Problem Link: https://codeforces.me/problemset/problem/21/D

Full text and comments »