### Peace_789's blog

By Peace_789, 7 months ago,

DELETED

• -37

By Peace_789, history, 10 months ago,

Hey guys...

Recently I was solving this problem from CSES.

Here is what I have tried...

My idea

By implementing this idea , I am getting WA in one TC ( Out of 11 ).

You can find my code here.

code

So , can someone point out what am I doing wrong or any cases that I am missing.

UPD

As pwild sir pointed out , I was missing that cases.

To overcome that , I just added small logic to my code and it got ACCEPTED.

If you want to see code...

accepted code

• +6

By Peace_789, history, 10 months ago,

Hello guys , I am having trouble solving this problem

You can read problem statement here also.

Statement

So , any hint to solve this problem will be grateful.

• +3

By Peace_789, history, 10 months ago,

Hello everyone...

First of all sorry but I am writing the blog on same doubt again because there was some issues with code in last blog.

So , recently I was solving this problem ...

Problem statement

I am aware of solving this problem using Bellman Ford's Algorithm , But I am trying another approach which is giving me WA in 1 Test Case (total 13 is there) .

So , Can anyone point out whether this approach is correct or not ... and If it is correct then suggest me some modification else give some counter examples where this code might fail.

Code

Any kind of help will be appreciated.

**Feel free to downvote but help me if you know the answer ;) **

THANKS.

• 0

By Peace_789, history, 10 months ago,

Hello Everyone ...

Today I was solving this problem ... Problem statement : You are given a directed weighted graph, and your task is to find out if it contains a negative cycle, and also give an example of such a cycle.

I am aware of solving this problem using Bellman Ford's Algorithm , But I am trying another approach which is giving me WA in 1 Test Case (total 13 is there) .

So , Can anyone point out whether this approach is correct or not ... and If it is correct then suggest me some modification otherwise give some counter examples where this code might fail.

code

• -21

By Peace_789, history, 11 months ago,

Hey there ...

Today I was solving these problem click ... and I got tle verdict on TC 5. Here's a link to my solution click.

As much as I got , time complexity of my above solution is O(nlogn) where n can be upto 10^5.

So , I am not getting why it is giving tle verdict. So any help regarding this would be appreciated.

UPD ==================: Was getting TLE due to ( endl ).

• -9

By Peace_789, history, 12 months ago,

Can someone share some problems on Articulation Points and bridges in a graph ! Thanks in advance :)