diff --git a/solutions/python/2065A.py b/solutions/python/2065A.py new file mode 100644 index 0000000..3db3bfd --- /dev/null +++ b/solutions/python/2065A.py @@ -0,0 +1,8 @@ +t = int(input()) + +for _ in range(t): + w = input() + + w = w[0:len(w)-2] + + print(w+"i") diff --git a/solutions/python/2065B.py b/solutions/python/2065B.py new file mode 100644 index 0000000..19fe26b --- /dev/null +++ b/solutions/python/2065B.py @@ -0,0 +1,19 @@ +t = int(input()) + +for _ in range(t): + w = list(input()) + + adjacent = False + + for i in range(1, len(w)): + if w[i] == w[i-1]: + adjacent = True + + if len(w) <= 1: + break + + if not adjacent: + print(len(w)) + continue + + print("1") diff --git a/solutions/python/2065D.py b/solutions/python/2065D.py new file mode 100644 index 0000000..41d3cca --- /dev/null +++ b/solutions/python/2065D.py @@ -0,0 +1,24 @@ +t = int(input()) + +for _ in range(t): + n, m = map(int, input().split(' ')) + + a = [] + + for _ in range(n): + a.append(list(map(int, input().split(' ')))) + + a = sorted(a, key=lambda x: sum(x))[::-1] + + concat = [] + + for i in a: + for j in i: + concat.append(j) + + total = 0 + + for idx, i in enumerate(concat): + total += (n*m-idx)*i + + print(total)