Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Karatat007
Problemset: เธอ ๆ มันเรียงกันยังไงอะ
Language: cpp
Time: 0.002 second
Submitted On: 2026-10-11 11:06:04
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
int arr[n];
if(n >= 0 and n <= 1) cout << "sorted!";
else{
bool sorted = true;
for(int i = 0;i < n;++i){
cin >> arr[i];
}
for(int i = 1;i < n;++i){
if(arr[i] < arr[i-1]) sorted = false;
}
if(sorted)cout << "sorted!";
else cout << "un-sorted!";
}
}