Advertisement
a53

sir_vale

a53
May 1st, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. unsigned long long v[1001],i,n,ma=1000000,p,ok=1;
  7. cin>>n;
  8. for(i=1;i<=n;i++)
  9. {
  10. cin>>v[i];
  11. if(v[i]<ma)
  12. {
  13. ma=v[i];
  14. p=i;
  15. }
  16. }
  17. if(p==1 || p==n)
  18. {
  19. cout<<"NU";
  20. return 0;
  21. }
  22. for(i=1;i<=p-1;i++)
  23. if(v[i]<=v[i+1])
  24. ok=0;
  25. for(i=p;i<=n-1;i++)
  26. if(v[i]>=v[i+1])
  27. ok=0;
  28. if(ok==1)
  29. cout<<"DA";
  30. else cout<<"NU";
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement