Все задачи на 5.10.17 13:00

This commit is contained in:
2017-10-05 13:08:02 +03:00
parent 93746b05d7
commit ca2ca71f63
120 changed files with 2343 additions and 0 deletions

14
uts/uts_17_aut_py/1/A.py Normal file
View File

@@ -0,0 +1,14 @@
a, b, d = list(map(int, input().split()))
if a < b:
if a + d >= b:
print(b)
elif a + d < b:
print(a+d)
elif a > b:
if a - d <= b:
print(b)
elif a - d > b:
print(a-d)
else:
print(b)

7
uts/uts_17_aut_py/1/B.py Normal file
View File

@@ -0,0 +1,7 @@
n = int(input())
lastnum = n
otv = ''
print(1, end=' ')
while lastnum <= 10**9 and lastnum > 1:
print(lastnum, end=' ')
lastnum = lastnum * n

14
uts/uts_17_aut_py/1/C.py Normal file
View File

@@ -0,0 +1,14 @@
n = int(input())
def conNS(x, si1 ,si2):
x = int(str(x), si1)
b = ''
while x > 0:
b, x = str(x%si2)+b, x//si2
return b
n = conNS(n, 5, 7)
n = sum(list(map(int, str(n))))
n = conNS(n, 10, 3)
print(n)

8
uts/uts_17_aut_py/1/D.py Normal file
View File

@@ -0,0 +1,8 @@
l, r, d = list(map(int, input().split()))
cel = l // d + 1
cur = d * cel
if l % d == 0:
print(l, end=' ')
while cur <= r:
print(cur, end=' ')
cur += d

2
uts/uts_17_aut_py/1/E.py Normal file
View File

@@ -0,0 +1,2 @@
from collections import Counter
print(Counter(input()).most_common()[0][0])

5
uts/uts_17_aut_py/1/F.py Normal file
View File

@@ -0,0 +1,5 @@
s = input()
de = input()
for i in de:
s = s.replace(i, '')
print(s)

8
uts/uts_17_aut_py/1/G.py Normal file
View File

@@ -0,0 +1,8 @@
from collections import Counter
s = input()
k = int(input())
ss = []
for i in Counter(s).most_common():
if i[1] >= k:
ss.append(i[0])
print(*sorted(ss))

4
uts/uts_17_aut_py/1/H.py Normal file
View File

@@ -0,0 +1,4 @@
from collections import Counter
n = int(input())
mas = list(map(int, input().split()))
print(Counter(mas).most_common()[0][0])

5
uts/uts_17_aut_py/1/I.py Normal file
View File

@@ -0,0 +1,5 @@
ser = int(input())
mas = list(map(int, input().split()))
rem = mas[0]
mas.sort()
print(mas.index(rem) + 1)

11
uts/uts_17_aut_py/1/J.py Normal file
View File

@@ -0,0 +1,11 @@
ser = int(input())
mas = list(map(int, input().split()))
ind = ser // 2
mas1 = mas[:ind]
mas2 = mas[ind:]
mas1.sort()
mas2.sort(reverse=True)
for i in mas1:
print(i, end=' ')
for i in mas2:
print(i, end=' ')

8
uts/uts_17_aut_py/1/K.py Normal file
View File

@@ -0,0 +1,8 @@
ser = int(input())
mas = list(map(int, input().split()))
from collections import Counter
cer = Counter(mas).most_common()
for i in cer:
if i[1] == 1:
print(i[0])
break

9
uts/uts_17_aut_py/1/L.py Normal file
View File

@@ -0,0 +1,9 @@
ser = int(input())
mas = list(map(int, input().split()))
kek = 0
while True:
if kek in mas:
kek += 1
else:
print(kek)
break