Here is my code that got WA on test 1 but when I run it on my compiler (Dev c++ 4.9.9.2) it works correctly and it's output is exactly same as test 1 correct answer. Why that happend? may be judging problem? thank you.
Code
WA
Input
7 2
3 1 2 2 3 3 7
1 7
3 4
Output
1
0
Answer
3
1
You forgot to initialize
d
.