Войти
или
Зарегистрироваться
Курсы
Учебник
Учебник 2.0
ОГЭ/ЕГЭ
Олимпиады
Рубрикатор
Компилятор
Статья Автор:
Андреев Кирилл
z
#1 #ввод f = '27a' with open(f, 'r') as f: n = int(f.readline()) l = list(map(int, f.readlines())) #обработка k = 0 for i in range(n): for j in range(i + 1, n): a = int(str(l[i] * l[j])[-7:]) if a % 10 ** 6 == 0 and a != 0: k += 1 #вывод print(k)
×
#2 #ввод f = '27a' with open(f, 'r') as f: n = int(f.readline()) l = list(map(int, f.readlines())) #обработка k = 0 for i in range(n): for j in range(i + 1, n): a = l[i] * l[j] b = l[i] + l[j] if a % 2310 == 0 and b % 11 == 0: k += 1 #вывод print(k)
×
#3 #ввод f = '27a' with open(f, 'r') as f: n, k = map(int, f.readline().split()) l = list(map(int, f.readlines())) #обработка m = 0 for i in range(n - 2 * k - 1): p = sum(l[i:i + k]) for j in range(i + k + 1, n - k): h = sum(l[j:j + k]) if (p + h) % 68 == 0: m = max(m, p + h) #вывод print(m)
×
#4 #ввод f = 'input.txt' with open(f, 'r') as f: n, k, m = map(int, f.readline().split()) l = [list(map(int, x.split())) for x in f.readlines()] p = [] #обработка for i in range(n - 1): p.extend(range(l[i][0] + m, l[i + 1][0] - m + 1)) m = int(10e9) for i in p: s = 0 for x, letn in l: bcount = (letn + 19) // 20 r = min(abs(x - i), k - abs(x - i)) s += r * bcount if s < m: m = s res = i #вывод print(m)
×
#5 #ввод f = 'input.txt' with open(f, 'r') as f: n, m = map(int, f.readline().split( )) l = list(map(int, f.readlines())) #обработка p = [0] * (n + 1) for i in range(len(l)): p[i + 1] = p[i] + l[i] res = 0 for i in range(n): for j in range(i + 1, n + 1): if p[j] - p[i] <= m: res = max(j - i, res) #вывод print(res)
×
#6 #ввод f = 'input.txt' with open(f, 'r') as f: n = int(f.readline()) l = list(map(int, f.readlines())) #обработка const1 = 17 const2 = 7717 res = 0 for i in range(n - 2 * const1): for j in range(i + const1, n - const1): for h in range(j + const1, n): print(i, j, h) if (l[i] + l[j] + l[h]) % const2 == 0: res += 1 #вывод print(res)
×
#7 #ввод f = 'input.txt' with open(f, 'r') as f: n = int(f.readline()) l = list(map(int, f.readlines())) #обработка const1 = 25 const2 = 4 const3 = 9009 res = 0 for i in range(n - const1): for j in range(i + const1, n): if (l[i] + l[j]) % const2 == 0 and (l[i] * l[j]) % const3 == 0: res += 1 #вывод print(res)
×
#8 #ввод f = 'input.txt' with open(f, 'r') as f: n = int(f.readline()) l = [list(map(int, x.split())) for x in f.readlines()] #обработка m = int(10e9) for i, _ in l: s = 0 for x, cost in l: r = abs(x - i) s += r * cost if s < m: m = s res = i #вывод print(res, m)
×
Чтобы оставить комментарий нужна авторизация
Печать