Help me in solving AOCV208 problem

My issue

This code which I wrote seems correct, it is also able to pass all the custom test cases, why is it not accepted in the IDE, it always shows Wrong answer on submitting. I also tried one code in which I didn’t used array and solved it, and that too was able to pass all the test cases, that too wasn’t accepted, what is the issue, kindly check.
Do we need to type exactly same code?

My code

// Update your code below to solve the problem


#include <bits/stdc++.h>
using namespace std;

int main() 
{
	int t;
        cin >> t;
	
	while(t--){
	    int T1=0, T2=0;
	    int A[10];
	    for(int i = 0; i < 10; i++){
	        cin >> A[i];
	    }
	    
	    for(int i = 0; i<10; i++){
	        if(i<5){
	            if(A[i] == 1)
	            T1 = T1+1;
	        }
	        else{
	            if(A[i] == 1)
	            T2= T2+1;
	        }
	    }
	    
	    if(T1 == T2){
	        cout << 0 << endl;
	    }
	    else if(T1 > T2){
	        cout << 1 << endl;
	    }
	    else{
	        cout << 2 << endl;
	    }
    }
}

Learning course: C++ for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone

@prakharkamthan
Your code it not right the question says all odd index is in separate team and all even is in separate team .

If it shows WA (Wrong Answer) without any errors then there is no problem with the code. The only problem is with your logic. Since you said the sample cases are passing that means the logic is incorrect.
The question says that the teams make alternate shots. In your code you considered the first 5 shots are by team1 and the next 5 are by team2. But that is not the case.
The shots are done this way : team1 team2 team1 team2 …

So, try and correct the logic. And remember if it says WA (Wrong Answer) then it means that your logic is incorrect or you missed some edge cases.

ooh, Thanks
you are right
shots are given alternatively to both the teams.