Runs on other online ide but doesn't run on CodeChef ide. I don't understand why this is happening. What I can do to run it on the CodeChef ide?
#include <bits/stdc++.h>
#define REP(i,a,b) for(i=a;i<=b;i++)
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int tt;
int array [tt];
int key;
int i;
int p;
cin >> tt;
REP(i,1,tt) cin >> array[i-1];
REP(i,1,tt-1){
key = array[i];
p = i-1;
while(p>=0 && array[p]>key){
array[p+1]=array[p];
p--;
}
array[p+1] = key;
}
REP(i,1,tt) cout << array[i-1] << " ";
}