fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. int fl=0;
  5. vector<int> v={1};
  6. int n=v.size();
  7. for(int i=0;i<n-1;i++){
  8. if(v[i]>v[i+1]){
  9. cout<<v[i]<<" "<<v[i+1]<<endl;
  10. fl=1;
  11. break;
  12. }
  13. }
  14. if(fl==1) cout<<"NO";
  15. else cout<<"YES";
  16.  
  17.  
  18.  
  19. // priority_queue<int,vector<int>,greater<int>> pq;
  20. // for(auto vl:v){
  21. // pq.push(vl);
  22. // }
  23. // vector<int> sort;
  24. // while(!pq.empty()){
  25. // sort.push_back(pq.top());
  26. // pq.pop();
  27. // }
  28. // if(v==sort) { cout<<"YES"; }
  29. // else { cout<<"NO"; }
  30. return 0;
  31. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
YES