Advertisement
Andur889

Ege

Oct 22nd, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.81 KB | None | 0 0
  1. N = int(input())
  2. maxNeg = -1000000
  3. multi = 1
  4. lis = []
  5. for i in range(N):
  6.     a = int(input())
  7.     if (a != 0):
  8.         if (a < 0):
  9.             if(a > maxNeg):
  10.                 maxNeg = a
  11.                 maxNegIndex = i
  12.         lis.append(i)
  13.         multi = multi * a
  14. if (multi < 0):
  15.     for i in range(len(lis)):
  16.         if lis[i] == maxNegIndex:
  17.             lis.remove(i)
  18.             break
  19. for i in range(len(lis)):
  20.     print(lis[i]+1)
  21.    
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. N = int(input())
  29. max5 = 0
  30. max2 = 0
  31. max10 = 0
  32. maxAll = 0
  33. for i in range(N):
  34.     a = int(input())
  35.     if a % 5 == 0:
  36.         max5 = max(a, max5)
  37.     elif a % 2 == 0:
  38.         max2 = max(a, max2)
  39.     elif a % 10 == 0:
  40.         max10 = max(a, max10)
  41.     maxAll - max(a, maxAll)
  42. max5_2 = max5*max2
  43. max10_1 = maxAll*max10
  44. controlValue = max(max5_2, max10_1)
  45. controlValueKeyboard = int(input())
  46. print("Получено чисел: ", N)
  47. print("Принятое Контрольное значение: ", controlValueKeyboard)
  48. print("Вычисленное Контрольное значение: ", controlValue)
  49. print(("Контроль пройден") if controlValue == controlValueKeyboard else ("Контроль не пройден"))
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. N = int(input())
  59. count = 0
  60. for i in range(N):
  61.     D = int(input())
  62.     K = int(input())
  63.     if (K % D != 0):
  64.         count += 1
  65. print(count)
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. N = int(input())
  75. minOdd = 1000000
  76. multi = 1
  77. lis = []
  78. for i in range(N):
  79.     a int(input())
  80.     if a != 0:
  81.         multi = multi * a
  82.         lis.append(i)
  83.         if a%2 == 1 and maxOdd > a:
  84.             minOdd = min(a, maxOdd)
  85.             minOddIndex = i
  86. if multi % 2 != 0:
  87.     for i in range(len(lis)):
  88.         if lis[i] == minOddIndex:
  89.             lis.remove(i)
  90.             break
  91. for i in range(len(lis)):
  92.     print(lis[i]+1)
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99. m1, m2, s = 0, 0, 0
  100. a = []
  101. for i in range(int(input())):
  102.     if i < 6:
  103.         a.append(int(input()))
  104.         continue
  105.     index = i % 6
  106.     old = a[index]
  107.     if old % 2 == 0: m2 = max(m2, old)
  108.     else: m1 = max(m1, old)
  109.     tmp = int(input())
  110.     a[index] = tmp
  111.     s = max(s, tmp + (m1 if tmp % 2 == 1 else m2))
  112. print(s)
  113.  
  114.  
  115.  
  116.  
  117. N = int(input())
  118. t = int(input())
  119. delta = 0
  120. deltamin = 0
  121. bsum = 0
  122. for i in range(N):
  123.     """Запомнить"""
  124.     a, b = map(int, input().split())
  125.     """! ! !"""
  126.     delta = delta + (a - b)
  127.     deltamin = min(delta, deltamin)
  128.     bsum += b
  129. answer = (deltamin + t + bsum)
  130. print(answer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement