I was solving the last question (1433G - Уменьшение стоимости доставки) of the last Div3 round, and I got TLE at test case 3
Here is a link to the TLE solution by me : link
Here is link to ACCEPTED solution by icecuber : link
I even followed his code, so as to make different changes and make our code similar, but still, all I have is TLE. Please HELP!!
Umm.. Because The url of icecuber code is missing, i can't see what exactly that code works.
But =Because of floid-warsher code Time Complexity, i think you get TLE
i suggest you to optimizate floid-warsher parts or use Dijkstrat ( TIme complextiy O(ElogV) )
Sorry, I have updated the link, he also used Floyd Warshall but it's working totally fine.
This is the link to the solution
Take out #define int long long and it might work. long long is slow...
Operations on long are costlier than int. Use long long only when needed, submission.
Also use \n rather than endl.
Shit, I didn't know that. Thanks a lot.