3 Commits e414cc8334 ... 4cb95ad100

Author SHA1 Message Date
  “stak” 4cb95ad100 Merge branch 'master' of https://notabug.org/stak/innopolis 2 years ago
  “stak” edb45d7c4c some new tasks added 2 years ago
  “stak” ac19c2dc2a new tasks added 2 years ago
4 changed files with 24 additions and 0 deletions
  1. 1 0
      tasks/sorting/sort_G.py
  2. 4 0
      tasks/sorting/sort_H.py
  3. 8 0
      tasks/sorting/sort_J.py
  4. 11 0
      tasks/sorting/sort_K.py

+ 1 - 0
tasks/sorting/sort_G.py

@@ -13,3 +13,4 @@ for i in range(n):
             print("no")
     if flag:
         print("yes")
+ .

+ 4 - 0
tasks/sorting/sort_H.py

@@ -0,0 +1,4 @@
+n = int(input())
+results = [list(map(int, input().split())) for i in range(n)]
+
+print(results)

+ 8 - 0
tasks/sorting/sort_J.py

@@ -0,0 +1,8 @@
+n, nums, count = int(input()), list(map(int, input().split())), 0
+
+for i, num in enumerate(nums):
+    for j, char in enumerate(nums):
+        if i < j and num > char:
+            count += 1
+
+print(count)

+ 11 - 0
tasks/sorting/sort_K.py

@@ -0,0 +1,11 @@
+from sort_A import simply_sort
+
+n, k = map(int, input().split())
+commands = list(map(int, input().split()))
+before = sum(commands)
+simply_sort(commands)
+
+for i in range(k):
+    commands[i] = int(str(commands[i]).replace("-", ""))
+
+print(sum(commands))