Hello every body good day to you . I'm trying to solve this problem and this Is my approach solution for this E. Shortest Path problem
can any one help me to solve it. I Want the idea not the code. thank in advance :).
UPD: I have successfully manged to solve this problem but with the half of its prof i can't mange to make my code faster my final time is 2556 ms :)
The real question is why are you wasting your time trying to solve a 2100 rated div2 E as a gray? You won't improve a slightest bit doing that.
Lol. You sound like the vintage LanceTheDragonTrainer
I'm just honestly asking him to reflect on what he's doing for his own good. He clearly needs to listen to some advice since he's been gray for over a year.
You're right. Can't understand why some people can downvote you.
And you sound like an unrated :)))
Have you looked at this comment in the contest editorial? https://codeforces.me/blog/entry/1276?#comment-22691
If so, what other questions do you have about their solution?
Peace on You :D
just use "BFS" to get the answer and not take the third city that makes you walk at any "forbidden triplet" from the given input ,,
In queue
store the current city and previous one , and when you select a city to be the next check if these triple are "OK" , to check you need "Set Data Structure" to store forbidden triplet.