We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55430b3 commit cb9b5dfCopy full SHA for cb9b5df
solutions/beecrowd/1548/1548.py
@@ -0,0 +1,17 @@
1
+import sys
2
+
3
+input = sys.stdin.readline
4
+output = sys.stdout.write
5
6
+n = int(input())
7
8
+for _ in range(n):
9
+ _ = input()
10
+ queue = list(map(int, input().split()))
11
12
+ count = 0
13
+ for q, q_sorted in zip(queue[::-1], sorted(queue)):
14
+ if q == q_sorted:
15
+ count += 1
16
17
+ output(f'{count}\n')
0 commit comments