What is wrong in this code? need help

#include
#include <math.h>

using namespace std;

int main()
{
int n,x;cin>>n;
int score[n];
int player[n];
for(int i=0;i<n;i++){
int a,b;cin>>a>>b;
if(a>b){score[i]=a-b;
player[i]=1;}
else{score[i]=b-a;
player[i]=2;}
} int max = score[0];
for (int i = 1; i < n; i++) {
if (score[i] > max){
max = score[i];
//x=player[i];
}}
for(int i=0;i<n;i++){
if(max==score[i]){x=player[i];}
}
cout<< x<<" "<< max<<endl;

 return 0;

}
`

`

indent preformatted text by 4 spaces

`

`https://www.codechef.com/IARCSJUD/problems/LEADGAME

Problem link ?