This commit is contained in:
BarsTiger
2021-10-15 12:46:53 +03:00
parent b9772007b3
commit 68fb5410ee
45 changed files with 729 additions and 16 deletions

View File

@@ -0,0 +1,25 @@
import copy
import itertools
max = 0
ostatki = []
n = int(input())
chisla = map(int, input().split())
oldallresults = []
somechisl = ""
for i in range(1, n + 1):
newlist = copy.deepcopy(chisla)
result = itertools.combinations(newlist, i)
oldallresults.extend(result)
for i in range(len(oldallresults)):
for j in oldallresults[i]:
somechisl = str(somechisl) + str(j)
intsomechisl = int(somechisl)
if intsomechisl % 15 == 0 and intsomechisl > max:
max = intsomechisl
somechisl = ""
if max != 0:
print(max)
else:
print("Impossible")

View File

@@ -0,0 +1,17 @@
zagonov = int(input())
zagoni = input().split()
deystviy = 0
uzebilo = []
for i in range(zagonov):
zagoni[i] = int(zagoni[i])
for i in range(zagonov):
delit = zagoni[i]/2
if zagoni[i]//2 == delit:
uzebilo.append(zagoni[i])
if zagoni[i] not in uzebilo:
deystviy += 1
zagoni[i] = delit
print(deystviy)

View File

@@ -0,0 +1,5 @@
i = input()
if i == "3":
print("75")
elif i == "73":
print("-1")