#include using namespace std; int main(){ int i,x,max=0; cin>>x; int a[x]; for(i=0;i>a[i]; if
Avoid cin and cout, and use the C IO functions scanf and printf instead. You'll find they can be up to 5x faster than the slow c++ functions.