Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: cyblox_boi
Problemset: เธอ ๆ มันเรียงกันยังไงอะ
Language: cpp
Time: 0.004 second
Submitted On: 2026-01-01 00:29:51
#include <iostream>
#include <vector>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
bool isSorted = false;
if (n == 0 || n == 1)
{
isSorted = true;
}
vector<int> numbers(n);
for (int i = 0; i < n; i++)
{
cin >> numbers[i];
}
for (int i = 0; i < n - 1; i++)
{
if (numbers[i] <= numbers[i + 1])
{
isSorted = true;
}
else
{
isSorted = false;
break;
}
}
if (isSorted)
{
cout << "sorted!" << '\n';
}
else
{
cout << "un-sorted!" << '\n';
}
return 0;
}