Войти
или
Зарегистрироваться
Курсы
Учебник
Учебник 2.0
ОГЭ/ЕГЭ
Олимпиады
Рубрикатор
Компилятор
Статья Автор:
Журавская Мария
моя тетрадь
#1 file = open('27-A(2).txt','r') v=[] sum_pair=0 n = int(file.readline()) for s in range(n): v.append(int(file.readline())) for i in range(n): a = v[i] for j in range(i+1,n): b=v[j] proisv = a*b if proisv%(10**6) == 0 and proisv%(10**7)!=0: sum_pair+=1 print(sum_pair)
×
#2 file = open('27-45792A.txt','r') v=[] sum_pair=0 n = int(file.readline()) for s in range(n): v.append(int(file.readline())) for i in range(n): a = v[i] for j in range(i+1,n): b=v[j] proisv = a*b summa = a+b if summa%11 == 0 and proisv%2310 == 0: sum_pair+=1 print(sum_pair)
×
#3 file = open('27-45782A.txt') v=[] max_summa = 0 n,k = map(int,file.readline().split()) for s in range(n): v.append(int(file.readline())) for i in range(n - 2*k): sum_a = sum(v[i:i+k+1]) for j in range(i+k, n - k): sum_b = sum(v[j:j+k+1]) summa = sum_a + sum_b if summa % 68 == 0: if summa > max_summa: max_summa = summa print(max_summa)
×
#5 file = open('27-45786A.txt') n,m = map(int,file.readline().split()) v = [] for s in file: v. append(int(file.readline())) max_kol_vo = 0 for i in range(n): summa = v[i] j = i + 1 while summa <= m: if j < n: summa += v[j] j+=1 else: break if summa > m and j < n: summa -= v[j] j = j - 1 if max_kol_vo < j - i: max_kol_vo = j - i print(max_kol_vo)
×
#6 file = open('27-45788A.txt') n = int(file.readline()) v = [] for s in range(n): v. append(int(file.readline())) kol_vo = 0 for i in range(n): a = v[i] for j in range(i + 17, n): b = v[j] for z in range(j + 17, n): c = v[z] summa = a + b + c if summa % 7717 == 0: kol_vo+=1 print(kol_vo)
×
#7 file = open('27-45790A.txt') n = int(file.readline()) v = [] for i in range(n): v. append(int(file.readline())) kol_vo = 0 for i in range(n): a = v[i] for j in range(i+25,n): b = v[j] summa = a + b proisv = a * b if summa % 4 == 0 and proisv % 9009 == 0: kol_vo +=1 print(kol_vo)
×
#8 file = open('27A_6638.txt') n = int(file.readline()) v = [[0 for j in range(2)] for i in range(n)] for i in range(n): v[i][0], v[i][1] = map(int,file.readline().split()) min_num = 0 for i in range(n): summa = 0 for j in range(n): summa += abs(v[j][0]-v[i][0])*v[j][1] if i == 0: min_sum = summa min_num = v[i][0] if summa == min_sum and v[i][0] < min_num: min_num = v[i][0] if summa < min_sum: min_sum = summa min_num = v[i][0] print(min_num, min_sum)
×
Чтобы оставить комментарий нужна авторизация
Печать