Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define endl '\n'
- #define sz(x) int(x.size())
- #define all(x) x.begin(), x.end()
- int main() {
- ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
- int test;
- cin >> test;
- cout << "Lumberjacks:\n";
- while (test--) {
- vector<int> a(10);
- bool ascend = 1;
- bool descend = 1;
- for (int i = 0; i < 10; i++) {
- cin >> a[i];
- if (i > 0) {
- ascend &= (a[i] > a[i - 1]);
- descend &= (a[i] < a[i - 1]);
- }
- }
- cout << (ascend || descend ? "Ordered" : "Unordered") << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment