← Back to List

4589번: Gnome Sequencing ↗

Solutions

Python 3
367 B | 367 chars
"""
[4589: Gnome Sequencing](https://www.acmicpc.net/problem/4589)

Tier: ??
Category: ??
"""


def solution():
  tc = int(input())
  print("Gnomes:")

  for _ in range(tc):
    l = [*map(int, input().split())]

    if sorted(l) == l or sorted(l, reverse=True) == l:
      print("Ordered")
    else:
      print("Unordered")


if __name__ == '__main__':
  solution()