Why is this code not working?

Problem: ICPC16B
Code:
https://www.codechef.com/viewplaintext/44305492

Check this test-case.

1
4
2 3 1 4

Correct output is “no” but your code gives yes.
PS: Make sure you share formatted code or submission link instead of just copy-pasting the entire code here. It isn’t even compiling.

3 Likes

wait so a[k] cannot be equal to to a[i] or a[j]? because you have used 1,2 which when taken as a[i],a[j] also return as 2 as product…

Why can’t it ? Also there should be a 6 in the array too if we take a[i] and a[j] as 2 and 3 respectively.

1 Like