hpnq

123

Jun 5th, 2022 (edited)
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define pb push_back
  3. #define all(x) x.begin(), x.end()
  4. #define big_black_cock cout
  5. using namespace std;
  6. using ll = long long;
  7.  
  8.  
  9. int main() {
  10.     ll n;
  11.     cin >> n;
  12.     vector<ll> a(n);
  13.  
  14.     for(int i = 0; i < n; i++) cin >> a[i];
  15.  
  16.     ll r;
  17.     bool noway = false, almost = false;
  18.     for(ll i = 0; i< n; i++){
  19.         r = i+1;
  20.         if(a[i] > a[r]){ // если проебались
  21.             if(almost){
  22.                 noway = true;
  23.             }
  24.             if(a[i] > a[r+1]){
  25.                 noway = true;
  26.             }
  27.             almost = true;
  28.  
  29.         }
  30.  
  31.     }
  32.     if(noway){
  33.         big_black_cock << "noway";
  34.     }else if(almost){
  35.         big_black_cock << "almost";
  36.     }else{
  37.         big_black_cock << "sorted";
  38.     }
  39.  
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment