My code is clearing the sample test case but not clearing the submission test case
Link:
Why am I getting wrong answer
@shreyanshgupta
Your logic is correct but there are few mistakes in your code.
- Check line 64, Number of edges is m not n. Change the condition of loop to i<m
- Output should be in different line for each testcase. You have forget to move to next line. Simply write cout<<endl; after line no. 52
- Check line no. 17, why i<=4, it should be i<=n
I have made above changes in your code. Here is the updated code https://ide.codingblocks.com/s/234387
1 Like