fork(4) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. unsigned i,n,v,p=0;
  7. cin>>n>>p;
  8. for(i=1;(i<n)&&(cin>>v)&&(p<v);++i) p=v;
  9. for(i+=(p>v);(i<n)&&(p>v)&&(cin>>v);++i) p=v;
  10. cout<<(i<n?"NIE":"TAK")<<endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 3300KB
stdin
3
5 6 5
stdout
TAK