Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define pb push_back
- #define all(x) x.begin(), x.end()
- #define big_black_cock cout
- using namespace std;
- using ll = long long;
- int main() {
- ll n;
- cin >> n;
- vector<ll> a(n);
- for(int i = 0; i < n; i++) cin >> a[i];
- ll r;
- bool noway = false, almost = false;
- for(ll i = 0; i< n; i++){
- r = i+1;
- if(a[i] > a[r]){ // если проебались
- if(almost){
- noway = true;
- }
- if(a[i] > a[r+1]){
- noway = true;
- }
- almost = true;
- }
- }
- if(noway){
- big_black_cock << "noway";
- }else if(almost){
- big_black_cock << "almost";
- }else{
- big_black_cock << "sorted";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment