Increasing decreasing sequence(hacker)

https://online.codingblocks.com/player/7408/content/7937/4801

For one test case it says time limit excedede

#include
using namespace std;
int main() {
int t;
cin>>t;
int n;
int p=1000000000;
while(t–){
cin>>n;
if(n>p){
p=n;
break;
}
p=n;
}
while(t–){
cin>>n;
if(n<p){
cout<<“false”;
return 0;}
p=n;
}
cout<<“true”;
return 0;
}