I was solving this problem from Codeforces. Link
I'm using Sublime Text 3 as my code editor and Mingw as my compiler. When I used my Mingw to compile and run the code it gives my wrong answer whereas when I'm using https://ideone.com/ my answer is different and is correct.
MY CODE
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
int arr[4];
int ans = 0;
for (int i = 0; i < 4; ++i)
{
cin >> arr[i];
}
for (int i = 0; i < 4; ++i)
{
if (arr[i] == arr[i + 1] || arr[i] == arr[i + 2] || arr[i] == arr[i + 3]) {
ans++;
}
}
cout << ans;
}
Test-Case:1
INPUT:
4 4 4 4
MINGW OUTPUT:
4
IDEONE OUTPUT:
3
Test-Case:2
INPUT:
1 7 3 3
MINGW OUTPUT:
2
IDEONE OUTPUT:
1