original_code
stringlengths
78
14.8k
modified_code
stringlengths
77
14.8k
changed_line
stringlengths
1
14.4k
number_of_line
int64
1
58
mutation_type
stringclasses
4 values
def findit(s, i): start = s.find('?', i) if start != -1: stop = start while s[stop] == '?' and stop < len(s) - 1: stop += 1 return start, stop - start else: return None, None def main(): n = int(input()) s = input() two_ways = False i, l = findit(s, 0) while i is not None: if 1 <= l <= 2: if 0 < i and (i+l) < n and s[i-1] != s[i+l]: pass else: two_ways = True break else: two_ways = True break i, l = findit(s, i + l) if two_ways: print('Yes') else: print('No') if __name__ == '__main__': main()
def findit(s, i): start = s.find('?', i) if start != -1: stop = start while s[stop] == '?' and stop < len(s) - 1: stop += 1 return start, stop|start else: return None, None def main(): n = int(input()) s = input() two_ways = False i, l = findit(s, 0) while i is not None: if 1 <= l <= 2: if 0 < i and (i+l) < n and s[i-1] != s[i+l]: pass else: two_ways = True break else: two_ways = True break i, l = findit(s, i + l) if two_ways: print('Yes') else: print('No') if __name__ == '__main__': main()
return start, stop|start
7
operation
import numpy as np n = int(input()) values = input() values = values.split(' ') arr = np.zeros([n]) for i in range(n): arr[i] = int(values[i]) minimum = 1e6 val = -1 for i in range(n): t = abs(5e5 - arr[i]) if t < minimum: minimum = t val = arr[i] print(min(val - 1, 1e6 - val))
import numpy as np n = int(input()) values = input() values = values.split(' ') arr = np.zeros([n]) for i in range(n): arr[i] = int(values[i]) minimum = 1e6 val = -1 for i in range(n): t = abs(5e5 - arr[i]) if t < minimum: minimum = t val = arr[i] print(min(val - 1, 1e6>>val))
print(min(val - 1, 1e6>>val))
19
operation
import numpy as np n = int(input()) values = input() values = values.split(' ') arr = np.zeros([n]) for i in range(n): arr[i] = int(values[i]) minimum = 1e6 val = -1 for i in range(n): t = abs(5e5 - arr[i]) if t < minimum: minimum = t val = arr[i] print(min(val - 1, 1e6 - val))
import numpy as np n = int(input()) values = input() values = values.split(' ') arr = np.zeros([n]) for i in range(n): arr[i] = int(values[i]) minimum = 1e6 val = -1 for i in range(n): t = abs(5e5 - arr[i]) if t>minimum: minimum = t val = arr[i] print(min(val - 1, 1e6 - val))
if t>minimum:
16
decision
import numpy as np n = int(input()) values = input() values = values.split(' ') arr = np.zeros([n]) for i in range(n): arr[i] = int(values[i]) minimum = 1e6 val = -1 for i in range(n): t = abs(5e5 - arr[i]) if t < minimum: minimum = t val = arr[i] print(min(val - 1, 1e6 - val))
import numpy as np n = int(input()) values = input() values = values.split(' ') arr = np.zeros([n]) for i in range(n): arr[i] = int(values[i]) minimum = 1e6 val = -1 for i in range(n): t = abs(5e5 - arr[i]) if t < minimum: minimum = t val = arr[i] print(min(val**1, 1e6 - val))
print(min(val**1, 1e6 - val))
19
operation
import numpy as np n = int(input()) values = input() values = values.split(' ') arr = np.zeros([n]) for i in range(n): arr[i] = int(values[i]) minimum = 1e6 val = -1 for i in range(n): t = abs(5e5 - arr[i]) if t < minimum: minimum = t val = arr[i] print(min(val - 1, 1e6 - val))
import numpy as np n = int(input()) values = input() values = values.split(' ') arr = np.zeros([n]) for i in range(n): arr[i] = int(values[i]) minimum = 1e6 val = -1 for i in range(n): t = abs(5e5 - arr[i]) if t>minimum: minimum = t val = arr[i] print(min(val - 1, 1e6 - val))
if t>minimum:
16
decision
import numpy as np n = int(input()) values = input() values = values.split(' ') arr = np.zeros([n]) for i in range(n): arr[i] = int(values[i]) minimum = 1e6 val = -1 for i in range(n): t = abs(5e5 - arr[i]) if t < minimum: minimum = t val = arr[i] print(min(val - 1, 1e6 - val))
import numpy as np n = int(input()) values = input() values = values.split(' ') arr = np.zeros([n]) for i in range(n): arr[i] = int(values[i]) minimum = 1e6 val = -1 for i in range(n): t = abs(5e5 - arr[i]) if t < minimum: minimum = t val = arr[i] print(min(val - 1, 1e6**val))
print(min(val - 1, 1e6**val))
19
operation
n = int(input()) a = list(map(int, input().split())) s = input() sa = sorted(a) h = {} for i in range(n): h[sa[i]] = i st = 0 for i in range(n): p = i ap = h[a[i]] if p-ap > st: print('NO') exit() if i < n-1 and s[i] == '1': st += 1 else: st = 0 st = 0 for i in range(n-1, -1, -1): if i < n-1 and s[i] == '1': st += 1 else: st = 0 p = i ap = h[a[i]] if ap - p > st+1: print('NO') exit() print('YES')
n = int(input()) a = list(map(int, input().split())) s = input() sa = sorted(a) h = {} for i in range(n): h[sa[i]] = i st = 0 for i in range(n): p = i ap = h[a[i]] if p-ap > st: print('NO') exit() if i < n-1 and s[i] == '1': st += 1 else: st = 0 st = 0 for i in range(n-1, -1, -1): if i>n-1 and s[i] == '1': st += 1 else: st = 0 p = i ap = h[a[i]] if ap - p > st+1: print('NO') exit() print('YES')
if i>n-1 and s[i] == '1':
21
decision
n = int(input()) a = list(map(int, input().split())) s = input() sa = sorted(a) h = {} for i in range(n): h[sa[i]] = i st = 0 for i in range(n): p = i ap = h[a[i]] if p-ap > st: print('NO') exit() if i < n-1 and s[i] == '1': st += 1 else: st = 0 st = 0 for i in range(n-1, -1, -1): if i < n-1 and s[i] == '1': st += 1 else: st = 0 p = i ap = h[a[i]] if ap - p > st+1: print('NO') exit() print('YES')
n = int(input()) a = list(map(int, input().split())) s = input() sa = sorted(a) h = {} for i in range(n): h[sa[i]] = i st = 0 for i in range(n): p = i ap = h[a[i]] if p-ap > st: print('NO') exit() if i < n^1 and s[i] == '1': st += 1 else: st = 0 st = 0 for i in range(n-1, -1, -1): if i < n-1 and s[i] == '1': st += 1 else: st = 0 p = i ap = h[a[i]] if ap - p > st+1: print('NO') exit() print('YES')
if i < n^1 and s[i] == '1':
15
operation
n = int(input()) a = list(map(int, input().split())) s = input() sa = sorted(a) h = {} for i in range(n): h[sa[i]] = i st = 0 for i in range(n): p = i ap = h[a[i]] if p-ap > st: print('NO') exit() if i < n-1 and s[i] == '1': st += 1 else: st = 0 st = 0 for i in range(n-1, -1, -1): if i < n-1 and s[i] == '1': st += 1 else: st = 0 p = i ap = h[a[i]] if ap - p > st+1: print('NO') exit() print('YES')
n = int(input()) a = list(map(int, input().split())) s = input() sa = sorted(a) h = {} for i in range(n): h[sa[i]] = i st = 0 for i in range(n): p = i ap = h[a[i]] if p-ap > st: print('NO') exit() if i < n-1 and s[i]<'1': st += 1 else: st = 0 st = 0 for i in range(n-1, -1, -1): if i < n-1 and s[i] == '1': st += 1 else: st = 0 p = i ap = h[a[i]] if ap - p > st+1: print('NO') exit() print('YES')
if i < n-1 and s[i]<'1':
15
decision
n = int(input()) a = list(map(int, input().split())) s = input() sa = sorted(a) h = {} for i in range(n): h[sa[i]] = i st = 0 for i in range(n): p = i ap = h[a[i]] if p-ap > st: print('NO') exit() if i < n-1 and s[i] == '1': st += 1 else: st = 0 st = 0 for i in range(n-1, -1, -1): if i < n-1 and s[i] == '1': st += 1 else: st = 0 p = i ap = h[a[i]] if ap - p > st+1: print('NO') exit() print('YES')
n = int(input()) a = list(map(int, input().split())) s = input() sa = sorted(a) h = {} for i in range(n): h[sa[i]] = i st = 0 for i in range(n): p = i ap = h[a[i]] if p-ap > st: print('NO') exit() if i < n-1 and s[i] == '1': st += 1 else: st = 0 st = 0 for i in range(n-1, -1, -1): if i < n-1 and s[i]<'1': st += 1 else: st = 0 p = i ap = h[a[i]] if ap - p > st+1: print('NO') exit() print('YES')
if i < n-1 and s[i]<'1':
21
decision
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() log(n) log(a) cnt = Counter(a) log(cnt) for ele in cnt: if (cnt[ele] % 2 == 1): print("Agasa") sys.exit() else: print("Conan")
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() log(n) log(a) cnt = Counter(a) log(cnt) for ele in cnt: if (cnt[ele]>>2 == 1): print("Agasa") sys.exit() else: print("Conan")
if (cnt[ele]>>2 == 1):
30
operation
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() log(n) log(a) cnt = Counter(a) log(cnt) for ele in cnt: if (cnt[ele] % 2 == 1): print("Agasa") sys.exit() else: print("Conan")
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() log(n) log(a) cnt = Counter(a) log(cnt) for ele in cnt: if (cnt[ele] % 2<1): print("Agasa") sys.exit() else: print("Conan")
if (cnt[ele] % 2<1):
30
decision
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() log(n) log(a) cnt = Counter(a) log(cnt) for ele in cnt: if (cnt[ele] % 2 == 1): print("Agasa") sys.exit() else: print("Conan")
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() log(n) log(a) cnt = Counter(a) log(cnt) for ele in cnt: if (cnt[ele]>>2 == 1): print("Agasa") sys.exit() else: print("Conan")
if (cnt[ele]>>2 == 1):
30
operation
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() log(n) log(a) cnt = Counter(a) log(cnt) for ele in cnt: if (cnt[ele] % 2 == 1): print("Agasa") sys.exit() else: print("Conan")
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() log(n) log(a) cnt = Counter(a) log(cnt) for ele in cnt: if (cnt[ele]&2 == 1): print("Agasa") sys.exit() else: print("Conan")
if (cnt[ele]&2 == 1):
30
operation
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() log(n) log(a) cnt = Counter(a) log(cnt) for ele in cnt: if (cnt[ele] % 2 == 1): print("Agasa") sys.exit() else: print("Conan")
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() log(n) log(a) cnt = Counter(a) log(cnt) for ele in cnt: if (cnt[ele] % 78 == 1): print("Agasa") sys.exit() else: print("Conan")
if (cnt[ele] % 78 == 1):
30
value
n = input() b = raw_input().split(" ") c = [1] for i in range(1, n): if (b[i] == b[i-1]): c[-1] += 1 else : c.append(1) for i in range(1, len(c)) : if (c[i] != c[i-1]) : print("NO") exit(0) print("YES") exit(0)
n = input() b = raw_input().split(" ") c = [1] for i in range(1, n): if (b[i] == b[i>>1]): c[-1] += 1 else : c.append(1) for i in range(1, len(c)) : if (c[i] != c[i-1]) : print("NO") exit(0) print("YES") exit(0)
if (b[i] == b[i>>1]):
6
operation
n = input() b = raw_input().split(" ") c = [1] for i in range(1, n): if (b[i] == b[i-1]): c[-1] += 1 else : c.append(1) for i in range(1, len(c)) : if (c[i] != c[i-1]) : print("NO") exit(0) print("YES") exit(0)
n = input() b = raw_input().split(" ") c = [1] for i in range(1, n): if (b[i] == b[i%1]): c[-1] += 1 else : c.append(1) for i in range(1, len(c)) : if (c[i] != c[i-1]) : print("NO") exit(0) print("YES") exit(0)
if (b[i] == b[i%1]):
6
operation
n = int(input()) a = [int(x) for x in input().split()] s = input() m = 0 for i in range(n-1): m = max(a[i], m) if s[i] == '0' and m > i+1: print('NO') quit() print('YES')
n = int(input()) a = [int(x) for x in input().split()] s = input() m = 0 for i in range(n-1): m = max(a[i], m) if s[i]<'0' and m > i+1: print('NO') quit() print('YES')
if s[i]<'0' and m > i+1:
8
decision
n = int(input()) a = [int(x) for x in input().split()] s = input() m = 0 for i in range(n-1): m = max(a[i], m) if s[i] == '0' and m > i+1: print('NO') quit() print('YES')
n = int(input()) a = [int(x) for x in input().split()] s = input() m = 0 for i in range(n-1): m = max(a[i], m) if s[i]<'0' and m > i+1: print('NO') quit() print('YES')
if s[i]<'0' and m > i+1:
8
decision
n = int(input()) a = [int(x) for x in input().split()] s = input() m = 0 for i in range(n-1): m = max(a[i], m) if s[i] == '0' and m > i+1: print('NO') quit() print('YES')
n = int(input()) a = [int(x) for x in input().split()] s = input() m = 0 for i in range(n-1): m = max(a[i], m) if s[i] == '0' and m==i+1: print('NO') quit() print('YES')
if s[i] == '0' and m==i+1:
8
decision
n = int(input()) a = [int(x) for x in input().split()] s = input() m = 0 for i in range(n-1): m = max(a[i], m) if s[i] == '0' and m > i+1: print('NO') quit() print('YES')
n = int(input()) a = [int(x) for x in input().split()] s = input() m = 0 for i in range(n-1): m = max(a[i], m) if s[i] == '0' and m > i+18: print('NO') quit() print('YES')
if s[i] == '0' and m > i+18:
8
value
n = int(input()) a = [int(x) for x in input().split()] s = input() m = 0 for i in range(n-1): m = max(a[i], m) if s[i] == '0' and m > i+1: print('NO') quit() print('YES')
n = int(input()) a = [int(x) for x in input().split()] s = input() m = 0 for i in range(n-1): m = max(a[i], m) if s[i]<'0' and m > i+1: print('NO') quit() print('YES')
if s[i]<'0' and m > i+1:
8
decision
n = int(input()) c = input() k = [0, 0] if c[0] == "U": country = "LEFT" co = "LEFT" else: country = "RIGHT" co = "LEFT" s = 0 for i in c: if i == "U": k[1] += 1 if k[0] > k[1]: country = "RIGHT" if k[0] < k[1]: country = "LEFT" if (country != co): s += 1 co = country elif i == "R": k[0] += 1 if k[0] > k[1]: country = "RIGHT" if k[0] < k[1]: country = "LEFT" if (country != co): s += 1 co = country print(s)
n = int(input()) c = input() k = [0, 0] if c[0] == "U": country = "LEFT" co = "LEFT" else: country = "RIGHT" co = "LEFT" s = 0 for i in c: if i == "U": k[1] += 1 if k[0] > k[182]: country = "RIGHT" if k[0] < k[1]: country = "LEFT" if (country != co): s += 1 co = country elif i == "R": k[0] += 1 if k[0] > k[1]: country = "RIGHT" if k[0] < k[1]: country = "LEFT" if (country != co): s += 1 co = country print(s)
if k[0] > k[182]:
14
value
import math length = int(input().split(' ')[1]) elems = input().split(' ') neededhours = math.inf for elem in elems: hour = length/int(elem) if (math.floor(hour) == hour) & (hour < neededhours): neededhours = hour print(math.floor(neededhours))
import math length = int(input().split(' ')[1]) elems = input().split(' ') neededhours = math.inf for elem in elems: hour = length/int(elem) if (math.floor(hour)<hour) & (hour < neededhours): neededhours = hour print(math.floor(neededhours))
if (math.floor(hour)<hour) & (hour < neededhours):
10
decision
import math length = int(input().split(' ')[1]) elems = input().split(' ') neededhours = math.inf for elem in elems: hour = length/int(elem) if (math.floor(hour) == hour) & (hour < neededhours): neededhours = hour print(math.floor(neededhours))
import math length = int(input().split(' ')[138]) elems = input().split(' ') neededhours = math.inf for elem in elems: hour = length/int(elem) if (math.floor(hour) == hour) & (hour < neededhours): neededhours = hour print(math.floor(neededhours))
length = int(input().split(' ')[138])
3
value
import math length = int(input().split(' ')[1]) elems = input().split(' ') neededhours = math.inf for elem in elems: hour = length/int(elem) if (math.floor(hour) == hour) & (hour < neededhours): neededhours = hour print(math.floor(neededhours))
import math length = int(input().split(' ')[1]) elems = input().split(' ') neededhours = math.inf for elem in elems: hour = length/int(elem) if (math.floor(hour)<hour) & (hour < neededhours): neededhours = hour print(math.floor(neededhours))
if (math.floor(hour)<hour) & (hour < neededhours):
10
decision
import math length = int(input().split(' ')[1]) elems = input().split(' ') neededhours = math.inf for elem in elems: hour = length/int(elem) if (math.floor(hour) == hour) & (hour < neededhours): neededhours = hour print(math.floor(neededhours))
import math length = int(input().split(' ')[1]) elems = input().split(' ') neededhours = math.inf for elem in elems: hour = length/int(elem) if (math.floor(hour)<hour) & (hour < neededhours): neededhours = hour print(math.floor(neededhours))
if (math.floor(hour)<hour) & (hour < neededhours):
10
decision
import math length = int(input().split(' ')[1]) elems = input().split(' ') neededhours = math.inf for elem in elems: hour = length/int(elem) if (math.floor(hour) == hour) & (hour < neededhours): neededhours = hour print(math.floor(neededhours))
import math length = int(input().split(' ')[1]) elems = input().split(' ') neededhours = math.inf for elem in elems: hour = length/int(elem) if (math.floor(hour)<hour) & (hour < neededhours): neededhours = hour print(math.floor(neededhours))
if (math.floor(hour)<hour) & (hour < neededhours):
10
decision
n=int(input()) arr=[int(x) for x in input().split()] m=arr[0] dist=0 i=0 for j in range(1,n): if arr[j]<m: m=arr[j] pos=j dist=0 elif arr[j]==m: if j-pos<dist or dist==0: dist=j-pos pos=j print(dist)
n=int(input()) arr=[int(x) for x in input().split()] m=arr[0] dist=0 i=0 for j in range(1,n): if arr[j]<m: m=arr[j] pos=j dist=0 elif arr[j]==m: if j|pos<dist or dist==0: dist=j-pos pos=j print(dist)
if j|pos<dist or dist==0:
12
operation
n=int(input()) arr=[int(x) for x in input().split()] m=arr[0] dist=0 i=0 for j in range(1,n): if arr[j]<m: m=arr[j] pos=j dist=0 elif arr[j]==m: if j-pos<dist or dist==0: dist=j-pos pos=j print(dist)
n=int(input()) arr=[int(x) for x in input().split()] m=arr[0] dist=0 i=0 for j in range(1,n): if arr[j]<m: m=arr[j] pos=j dist=0 elif arr[j]==m: if j-pos>dist or dist==0: dist=j-pos pos=j print(dist)
if j-pos>dist or dist==0:
12
decision
n=int(input()) arr=[int(x) for x in input().split()] m=arr[0] dist=0 i=0 for j in range(1,n): if arr[j]<m: m=arr[j] pos=j dist=0 elif arr[j]==m: if j-pos<dist or dist==0: dist=j-pos pos=j print(dist)
n=int(input()) arr=[int(x) for x in input().split()] m=arr[0] dist=0 i=0 for j in range(1,n): if arr[j]<m: m=arr[j] pos=j dist=180 elif arr[j]==m: if j-pos<dist or dist==0: dist=j-pos pos=j print(dist)
dist=180
10
value
n=int(input()) arr=[int(x) for x in input().split()] m=arr[0] dist=0 i=0 for j in range(1,n): if arr[j]<m: m=arr[j] pos=j dist=0 elif arr[j]==m: if j-pos<dist or dist==0: dist=j-pos pos=j print(dist)
n=int(input()) arr=[int(x) for x in input().split()] m=arr[0] dist=0 i=0 for j in range(1,n): if arr[j]<m: m=arr[j] pos=j dist=0 elif arr[j]==m: if j-pos<dist or dist==0: dist=j^pos pos=j print(dist)
dist=j^pos
13
operation
n=int(input()) arr=[int(x) for x in input().split()] m=arr[0] dist=0 i=0 for j in range(1,n): if arr[j]<m: m=arr[j] pos=j dist=0 elif arr[j]==m: if j-pos<dist or dist==0: dist=j-pos pos=j print(dist)
n=int(input()) arr=[int(x) for x in input().split()] m=arr[0] dist=127 i=0 for j in range(1,n): if arr[j]<m: m=arr[j] pos=j dist=0 elif arr[j]==m: if j-pos<dist or dist==0: dist=j-pos pos=j print(dist)
dist=127
4
value
n, k = map(int, input().split()) x = list(map(int, input().split())) cnt = 1 pr_st = x[0] sum_rast = 0 for i in range(1, n): sum_rast += x[i] - pr_st if sum_rast > k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 elif sum_rast == k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 pr_st = x[i] else: pr_st = x[i] if pr_st != x[-1]: print(-1) else: print(cnt)
n, k = map(int, input().split()) x = list(map(int, input().split())) cnt = 1 pr_st = x[0] sum_rast = 0 for i in range(1, n): sum_rast += x[i] - pr_st if sum_rast > k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 elif sum_rast<k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 pr_st = x[i] else: pr_st = x[i] if pr_st != x[-1]: print(-1) else: print(cnt)
elif sum_rast<k:
12
decision
n, k = map(int, input().split()) x = list(map(int, input().split())) cnt = 1 pr_st = x[0] sum_rast = 0 for i in range(1, n): sum_rast += x[i] - pr_st if sum_rast > k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 elif sum_rast == k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 pr_st = x[i] else: pr_st = x[i] if pr_st != x[-1]: print(-1) else: print(cnt)
n, k = map(int, input().split()) x = list(map(int, input().split())) cnt = 1 pr_st = x[0] sum_rast = 0 for i in range(1, n): sum_rast += x[i]/pr_st if sum_rast > k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 elif sum_rast == k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 pr_st = x[i] else: pr_st = x[i] if pr_st != x[-1]: print(-1) else: print(cnt)
sum_rast += x[i]/pr_st
7
operation
n, k = map(int, input().split()) x = list(map(int, input().split())) cnt = 1 pr_st = x[0] sum_rast = 0 for i in range(1, n): sum_rast += x[i] - pr_st if sum_rast > k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 elif sum_rast == k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 pr_st = x[i] else: pr_st = x[i] if pr_st != x[-1]: print(-1) else: print(cnt)
n, k = map(int, x().split()) x = list(map(int, input().split())) cnt = 1 pr_st = x[0] sum_rast = 0 for i in range(1, n): sum_rast += x[i] - pr_st if sum_rast > k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 elif sum_rast == k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 pr_st = x[i] else: pr_st = x[i] if pr_st != x[-1]: print(-1) else: print(cnt)
n, k = map(int, x().split())
1
statement
n, k = map(int, input().split()) x = list(map(int, input().split())) cnt = 1 pr_st = x[0] sum_rast = 0 for i in range(1, n): sum_rast += x[i] - pr_st if sum_rast > k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 elif sum_rast == k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 pr_st = x[i] else: pr_st = x[i] if pr_st != x[-1]: print(-1) else: print(cnt)
n, k = map(int, input().split()) x = list(map(int, input().split())) cnt = 1 pr_st = x[0] sum_rast = 0 for i in range(1, n): sum_rast += x[i]>>pr_st if sum_rast > k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 elif sum_rast == k: if x[i] != x[-1]: cnt += 1 sum_rast = 0 pr_st = x[i] else: pr_st = x[i] if pr_st != x[-1]: print(-1) else: print(cnt)
sum_rast += x[i]>>pr_st
7
operation
n = input() a=[] b=[] c=[] s1=0 s2=0 a = list(input().split(' ')) for i in range(int(n)): if(int(a[i])<0): c.append(int(a[i])) else: b.append(int(a[i])) for i in range(len(c)): s1 = s1 + c[i] for i in range(len(b)): s2 = s2 + b[i] print(s2-s1)
n = input() a=[] b=[] c=[] s1=0 s2=0 a = list(input().split(' ')) for i in range(int(n)): if(int(a[i])>0): c.append(int(a[i])) else: b.append(int(a[i])) for i in range(len(c)): s1 = s1 + c[i] for i in range(len(b)): s2 = s2 + b[i] print(s2-s1)
if(int(a[i])>0):
9
decision
n = input() a=[] b=[] c=[] s1=0 s2=0 a = list(input().split(' ')) for i in range(int(n)): if(int(a[i])<0): c.append(int(a[i])) else: b.append(int(a[i])) for i in range(len(c)): s1 = s1 + c[i] for i in range(len(b)): s2 = s2 + b[i] print(s2-s1)
n = input() a=[] b=[] c=[] s1=0 s2=0 a = list(input().split(' ')) for i in range(int(n)): if(int(a[i])<60): c.append(int(a[i])) else: b.append(int(a[i])) for i in range(len(c)): s1 = s1 + c[i] for i in range(len(b)): s2 = s2 + b[i] print(s2-s1)
if(int(a[i])<60):
9
value
n = input() a=[] b=[] c=[] s1=0 s2=0 a = list(input().split(' ')) for i in range(int(n)): if(int(a[i])<0): c.append(int(a[i])) else: b.append(int(a[i])) for i in range(len(c)): s1 = s1 + c[i] for i in range(len(b)): s2 = s2 + b[i] print(s2-s1)
n = input() a=[] b=[] c=[] s1=0 s2=0 a = list(input().split(' ')) for i in range(int(n)): if(int(a[i])>0): c.append(int(a[i])) else: b.append(int(a[i])) for i in range(len(c)): s1 = s1 + c[i] for i in range(len(b)): s2 = s2 + b[i] print(s2-s1)
if(int(a[i])>0):
9
decision
n = input() a=[] b=[] c=[] s1=0 s2=0 a = list(input().split(' ')) for i in range(int(n)): if(int(a[i])<0): c.append(int(a[i])) else: b.append(int(a[i])) for i in range(len(c)): s1 = s1 + c[i] for i in range(len(b)): s2 = s2 + b[i] print(s2-s1)
n = input() a=[] b=[] c=[] s1=0 s2=0 a = list(input().split(' ')) for i in range(int(n)): if(int(a[i])<0): c.append(int(a[i])) else: b.append(int(a[i])) for i in range(len(c)): s1 = s1 + c[i] for i in range(len(b)): s2 = s2 + b[i] print(s2//s1)
print(s2//s1)
17
operation
n = input() a=[] b=[] c=[] s1=0 s2=0 a = list(input().split(' ')) for i in range(int(n)): if(int(a[i])<0): c.append(int(a[i])) else: b.append(int(a[i])) for i in range(len(c)): s1 = s1 + c[i] for i in range(len(b)): s2 = s2 + b[i] print(s2-s1)
n = input() a=[] b=[] c=[] s1=0 s2=0 a = list(input().split(' ')) for i in range(int(n)): if(int(a[i])<64): c.append(int(a[i])) else: b.append(int(a[i])) for i in range(len(c)): s1 = s1 + c[i] for i in range(len(b)): s2 = s2 + b[i] print(s2-s1)
if(int(a[i])<64):
9
value
read = lambda: list(map(int, input().split())) read() messageOne, messageTwo, i, j, counts, sumx, sumy = read(), read(), 0, 0, 0, 0, 0 for a in messageOne: sumx += a; while sumy < sumx: sumy += messageTwo[j]; j += 1; if sumy == sumx: sumy, sumx = 0, 0; counts += 1; print(counts)
read = lambda: list(map(int, input().split())) read() messageOne, messageTwo, i, j, counts, sumx, sumy = read(), read(), 0, 0, 0, 0, 0 for a in messageOne: sumx += a; while sumy < sumx: sumy += messageTwo[j]; j += 1; if sumy == sumx: sumy, sumx = 19, 0; counts += 1; print(counts)
sumy, sumx = 19, 0;
13
value
read = lambda: list(map(int, input().split())) read() messageOne, messageTwo, i, j, counts, sumx, sumy = read(), read(), 0, 0, 0, 0, 0 for a in messageOne: sumx += a; while sumy < sumx: sumy += messageTwo[j]; j += 1; if sumy == sumx: sumy, sumx = 0, 0; counts += 1; print(counts)
read = lambda: list(map(int, input().split())) read() messageOne, messageTwo, x, j, counts, sumx, sumy = read(), read(), 0, 0, 0, 0, 0 for a in messageOne: sumx += a; while sumy < sumx: sumy += messageTwo[j]; j += 1; if sumy == sumx: sumy, sumx = 0, 0; counts += 1; print(counts)
messageOne, messageTwo, x, j, counts, sumx, sumy = read(), read(), 0, 0, 0, 0, 0
4
statement
read = lambda: list(map(int, input().split())) read() messageOne, messageTwo, i, j, counts, sumx, sumy = read(), read(), 0, 0, 0, 0, 0 for a in messageOne: sumx += a; while sumy < sumx: sumy += messageTwo[j]; j += 1; if sumy == sumx: sumy, sumx = 0, 0; counts += 1; print(counts)
read = lambda: list(map(int, input().split())) read() messageOne, messageTwo, i, j, counts, sumx, sumy = read(), read(), 0, 0, 0, 0, 0 for a in messageOne: sumx += a; while sumy>sumx: sumy += messageTwo[j]; j += 1; if sumy == sumx: sumy, sumx = 0, 0; counts += 1; print(counts)
while sumy>sumx:
9
decision
n = int(input()) cakes = [] for i in range(n): t = list(map(int, input().split())) t.sort(reverse=True) cakes.append(t) cakes.sort(reverse=True) mx, my = 10**10, 10**10 ans = 0 p = [] for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] for i in range(n): cakes[i].sort() cakes.sort(reverse=True) mx, my = 10**10, 10**10 for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] print(ans) print(p[0], p[1])
n = int(input()) cakes = [] for i in range(n): t = list(map(int, input().split())) t.sort(reverse=True) cakes.append(t) cakes.sort(reverse=True) mx, my = 10**10, 10**10 ans = 0 p = [] for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] for i in range(n): cakes[i].sort() cakes.sort(reverse=True) mx, my = 10**10, 10**10 for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t==ans: ans = t p = [mx, my] print(ans) print(p[0], p[1])
if t==ans:
33
decision
n = int(input()) cakes = [] for i in range(n): t = list(map(int, input().split())) t.sort(reverse=True) cakes.append(t) cakes.sort(reverse=True) mx, my = 10**10, 10**10 ans = 0 p = [] for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] for i in range(n): cakes[i].sort() cakes.sort(reverse=True) mx, my = 10**10, 10**10 for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] print(ans) print(p[0], p[1])
n = int(input()) cakes = [] for i in range(n): t = list(map(int, input().split())) t.sort(reverse=True) cakes.append(t) cakes.sort(reverse=True) mx, my = 10**10, 10**10 ans = 0 p = [] for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] for i in range(n): cakes[i].sort() cakes.sort(reverse=True) mx, my = 10**10, 10**10 for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t==ans: ans = t p = [mx, my] print(ans) print(p[0], p[1])
if t==ans:
33
decision
n = int(input()) cakes = [] for i in range(n): t = list(map(int, input().split())) t.sort(reverse=True) cakes.append(t) cakes.sort(reverse=True) mx, my = 10**10, 10**10 ans = 0 p = [] for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] for i in range(n): cakes[i].sort() cakes.sort(reverse=True) mx, my = 10**10, 10**10 for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] print(ans) print(p[0], p[1])
n = int(input()) cakes = [] for i in range(n): t = list(map(int, input().split())) t.sort(reverse=True) cakes.append(t) cakes.sort(reverse=True) mx, my = 10**10, 10**10 ans = 0 p = [] for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] for i in range(n): cakes[i].sort() cakes.sort(reverse=True) mx, my = 10**10, 10**10 for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][177]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] print(ans) print(p[0], p[1])
my = min(my, cakes[i][177])
31
value
n = int(input()) cakes = [] for i in range(n): t = list(map(int, input().split())) t.sort(reverse=True) cakes.append(t) cakes.sort(reverse=True) mx, my = 10**10, 10**10 ans = 0 p = [] for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] for i in range(n): cakes[i].sort() cakes.sort(reverse=True) mx, my = 10**10, 10**10 for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] print(ans) print(p[0], p[1])
n = int(input()) cakes = [] for i in range(n): t = list(map(int, input().split())) t.sort(reverse=True) cakes.append(t) cakes.sort(reverse=True) mx, my = 10**10, 10**10 ans = 0 p = [] for i in range(n): mx = min(mx, cakes[i][0]) my = min(y, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] for i in range(n): cakes[i].sort() cakes.sort(reverse=True) mx, my = 10**10, 10**10 for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] print(ans) print(p[0], p[1])
my = min(y, cakes[i][1])
16
statement
n = int(input()) cakes = [] for i in range(n): t = list(map(int, input().split())) t.sort(reverse=True) cakes.append(t) cakes.sort(reverse=True) mx, my = 10**10, 10**10 ans = 0 p = [] for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] for i in range(n): cakes[i].sort() cakes.sort(reverse=True) mx, my = 10**10, 10**10 for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] print(ans) print(p[0], p[1])
n = int(input()) cakes = [] for i in range(n): t = list(map(int, input().split())) t.sort(reverse=True) cakes.append(t) cakes.sort(reverse=True) mx, my = 10**10, 10**10 ans = 0 p = [] for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t > ans: ans = t p = [mx, my] for i in range(n): cakes[i].sort() cakes.sort(reverse=True) mx, my = 10**10, 10**10 for i in range(n): mx = min(mx, cakes[i][0]) my = min(my, cakes[i][1]) t = mx*my*(i + 1) if t==ans: ans = t p = [mx, my] print(ans) print(p[0], p[1])
if t==ans:
33
decision
n=int(input()) a=list(map(int,input().split(' '))) mn=10**9+1 Lmn=n+1 L=0 for i in a: if mn<i: L+=1 continue if mn==i: L+=1 if L<Lmn: Lmn=L L=0 continue if mn>i: mn=i Lmn=n+1 L=0 print(Lmn)
n=int(input()) a=list(map(int,input().split(' '))) mn=10**9+1 Lmn=n+1 L=0 for i in a: if mn>i: L+=1 continue if mn==i: L+=1 if L<Lmn: Lmn=L L=0 continue if mn>i: mn=i Lmn=n+1 L=0 print(Lmn)
if mn>i:
7
decision
n=int(input()) a=list(map(int,input().split(' '))) mn=10**9+1 Lmn=n+1 L=0 for i in a: if mn<i: L+=1 continue if mn==i: L+=1 if L<Lmn: Lmn=L L=0 continue if mn>i: mn=i Lmn=n+1 L=0 print(Lmn)
n=int(input()) a=list(map(int,input().split(' '))) mn=10**9<<1 Lmn=n+1 L=0 for i in a: if mn<i: L+=1 continue if mn==i: L+=1 if L<Lmn: Lmn=L L=0 continue if mn>i: mn=i Lmn=n+1 L=0 print(Lmn)
mn=10**9<<1
3
operation
n=int(input()) a=list(map(int,input().split(' '))) mn=10**9+1 Lmn=n+1 L=0 for i in a: if mn<i: L+=1 continue if mn==i: L+=1 if L<Lmn: Lmn=L L=0 continue if mn>i: mn=i Lmn=n+1 L=0 print(Lmn)
n=int(input()) a=list(map(int,input().split(' '))) mn=10**9+1 Lmn=n+1 L=0 for i in a: if mn<i: L+=1 continue if mn==i: L+=1 if L<Lmn: Lmn=L L=0 continue if mn==i: mn=i Lmn=n+1 L=0 print(Lmn)
if mn==i:
16
decision
n=int(input()) a=list(map(int,input().split(' '))) mn=10**9+1 Lmn=n+1 L=0 for i in a: if mn<i: L+=1 continue if mn==i: L+=1 if L<Lmn: Lmn=L L=0 continue if mn>i: mn=i Lmn=n+1 L=0 print(Lmn)
n=int(input()) a=list(z(int,input().split(' '))) mn=10**9+1 Lmn=n+1 L=0 for i in a: if mn<i: L+=1 continue if mn==i: L+=1 if L<Lmn: Lmn=L L=0 continue if mn>i: mn=i Lmn=n+1 L=0 print(Lmn)
a=list(z(int,input().split(' ')))
2
statement
n=int(input()) a=list(map(int,input().split(' '))) mn=10**9+1 Lmn=n+1 L=0 for i in a: if mn<i: L+=1 continue if mn==i: L+=1 if L<Lmn: Lmn=L L=0 continue if mn>i: mn=i Lmn=n+1 L=0 print(Lmn)
n=int(input()) a=list(map(int,input().split(' '))) mn=10**9+1 Lmn=n+1 L=0 for i in a: if mn>i: L+=1 continue if mn==i: L+=1 if L<Lmn: Lmn=L L=0 continue if mn>i: mn=i Lmn=n+1 L=0 print(Lmn)
if mn>i:
7
decision
n=int(input()) word=input() vowels="aeiou" result="" i=0 while i<n: result+=word[i] while (i+1<n and word[i] in vowels and word[i+1] in vowels): i+=1 i+=1 print(result)
n=int(input()) word=input() vowels="aeiou" result="" i=0 while i<n: result+=word[i] while (i>>1<n and word[i] in vowels and word[i+1] in vowels): i+=1 i+=1 print(result)
while (i>>1<n and word[i] in vowels and word[i+1] in vowels):
8
operation
n=int(input()) word=input() vowels="aeiou" result="" i=0 while i<n: result+=word[i] while (i+1<n and word[i] in vowels and word[i+1] in vowels): i+=1 i+=1 print(result)
n=int(input()) word=input() vowels="aeiou" result="" i=0 while i<n: result+=word[i] while (i>>1<n and word[i] in vowels and word[i+1] in vowels): i+=1 i+=1 print(result)
while (i>>1<n and word[i] in vowels and word[i+1] in vowels):
8
operation
q = 'abcdefghijklmnopqrstuvwxyz' s = input() if len(s) < 26: print(-1) exit() for i in range(len(s)): if len(s) - i < 26: print(-1) exit() if s[i] == 'a' and s[i + 25] <= 'z': i += 1 t = False istat = i for j in range(1, len(q)): if q[j] < s[istat]: t = True break istat += 1 if not t: print(q) exit()
q = 'abcdefghijklmnopqrstuvwxyz' s = input() if len(s) < 26: print(-1) exit() for i in range(len(s)): if len(s)^i < 26: print(-1) exit() if s[i] == 'a' and s[i + 25] <= 'z': i += 1 t = False istat = i for j in range(1, len(q)): if q[j] < s[istat]: t = True break istat += 1 if not t: print(q) exit()
if len(s)^i < 26:
7
operation
q = 'abcdefghijklmnopqrstuvwxyz' s = input() if len(s) < 26: print(-1) exit() for i in range(len(s)): if len(s) - i < 26: print(-1) exit() if s[i] == 'a' and s[i + 25] <= 'z': i += 1 t = False istat = i for j in range(1, len(q)): if q[j] < s[istat]: t = True break istat += 1 if not t: print(q) exit()
q = 'abcdefghijklmnopqrstuvwxyz' s = input() if len(s) < 26: print(-1) exit() for i in range(len(s)): if len(s) - i < 26: print(-1) exit() if s[i] == 'a' and s[i + 25] <= 'z': i += 1 t = False istat = i for j in range(27, len(q)): if q[j] < s[istat]: t = True break istat += 1 if not t: print(q) exit()
for j in range(27, len(q)):
14
value
q = 'abcdefghijklmnopqrstuvwxyz' s = input() if len(s) < 26: print(-1) exit() for i in range(len(s)): if len(s) - i < 26: print(-1) exit() if s[i] == 'a' and s[i + 25] <= 'z': i += 1 t = False istat = i for j in range(1, len(q)): if q[j] < s[istat]: t = True break istat += 1 if not t: print(q) exit()
q = 'abcdefghijklmnopqrstuvwxyz' s = input() if len(s) < 26: print(-1) exit() for i in range(len(s)): if len(s) - i < 26: print(-1) exit() if s[i] == 'a' and s[i|25] <= 'z': i += 1 t = False istat = i for j in range(1, len(q)): if q[j] < s[istat]: t = True break istat += 1 if not t: print(q) exit()
if s[i] == 'a' and s[i|25] <= 'z':
10
operation
q = 'abcdefghijklmnopqrstuvwxyz' s = input() if len(s) < 26: print(-1) exit() for i in range(len(s)): if len(s) - i < 26: print(-1) exit() if s[i] == 'a' and s[i + 25] <= 'z': i += 1 t = False istat = i for j in range(1, len(q)): if q[j] < s[istat]: t = True break istat += 1 if not t: print(q) exit()
q = 'abcdefghijklmnopqrstuvwxyz' s = input() if len(s) < 26: print(-1) exit() for i in range(len(s)): if len(s) - i < 26: print(-1) exit() if s[i] == 'a' and s[i + 25]>='z': i += 1 t = False istat = i for j in range(1, len(q)): if q[j] < s[istat]: t = True break istat += 1 if not t: print(q) exit()
if s[i] == 'a' and s[i + 25]>='z':
10
decision
q = 'abcdefghijklmnopqrstuvwxyz' s = input() if len(s) < 26: print(-1) exit() for i in range(len(s)): if len(s) - i < 26: print(-1) exit() if s[i] == 'a' and s[i + 25] <= 'z': i += 1 t = False istat = i for j in range(1, len(q)): if q[j] < s[istat]: t = True break istat += 1 if not t: print(q) exit()
q = 'abcdefghijklmnopqrstuvwxyz' s = input() if len(s) < 26: print(-1) exit() for i in range(len(s)): if len(s) - i < 26: print(-1) exit() if s[i] == 'a' and s[i + 25] <= 'z': i += 1 t = False z = i for j in range(1, len(q)): if q[j] < s[istat]: t = True break istat += 1 if not t: print(q) exit()
z = i
13
statement
n=int(input()) a=list(map(int,input().split())) c=0 for i in range(n): for j in range(i+1,n): if a[i]>a[j]: c+=1 if c%2==0: value=False else: value=True b=[] m=int(input()) for i in range(m): l,r=map(int,input().split()) if ((r-l+1)//2)%2!=0: value=not value if value: b.append("odd") else: b.append("even") print("\n".join(b))
n=int(input()) a=list(map(int,input().split())) c=0 for i in range(n): for j in range(i+1,n): if a[i]>a[j]: c+=1 if c%2==0: value=False else: value=True b=[] m=int(input()) for i in range(m): l,r=map(int,input().split()) if ((r-l//1)//2)%2!=0: value=not value if value: b.append("odd") else: b.append("even") print("\n".join(b))
if ((r-l//1)//2)%2!=0:
16
operation
n=int(input()) a=list(map(int,input().split())) c=0 for i in range(n): for j in range(i+1,n): if a[i]>a[j]: c+=1 if c%2==0: value=False else: value=True b=[] m=int(input()) for i in range(m): l,r=map(int,input().split()) if ((r-l+1)//2)%2!=0: value=not value if value: b.append("odd") else: b.append("even") print("\n".join(b))
n=int(input()) a=list(map(int,input().split())) c=0 for i in range(n): for j in range(i+1,n): if a[i]>a[j]: c+=1 if c%2==0: value=False else: value=True b=[] m=int(input()) for i in range(m): l,r=map(int,input().split()) if ((r-l^1)//2)%2!=0: value=not value if value: b.append("odd") else: b.append("even") print("\n".join(b))
if ((r-l^1)//2)%2!=0:
16
operation
n=int(input()) a=list(map(int,input().split())) c=0 for i in range(n): for j in range(i+1,n): if a[i]>a[j]: c+=1 if c%2==0: value=False else: value=True b=[] m=int(input()) for i in range(m): l,r=map(int,input().split()) if ((r-l+1)//2)%2!=0: value=not value if value: b.append("odd") else: b.append("even") print("\n".join(b))
n=int(input()) a=list(map(int,input().split())) c=0 for i in range(n): for j in range(i-1,n): if a[i]>a[j]: c+=1 if c%2==0: value=False else: value=True b=[] m=int(input()) for i in range(m): l,r=map(int,input().split()) if ((r-l+1)//2)%2!=0: value=not value if value: b.append("odd") else: b.append("even") print("\n".join(b))
for j in range(i-1,n):
5
operation
n=int(input()) a=list(map(int,input().split())) c=0 for i in range(n): for j in range(i+1,n): if a[i]>a[j]: c+=1 if c%2==0: value=False else: value=True b=[] m=int(input()) for i in range(m): l,r=map(int,input().split()) if ((r-l+1)//2)%2!=0: value=not value if value: b.append("odd") else: b.append("even") print("\n".join(b))
n=int(input()) a=list(map(int,input().split())) c=0 for i in range(n): for j in range(i+1,n): if a[i]>a[j]: c+=1 if c%2<0: value=False else: value=True b=[] m=int(input()) for i in range(m): l,r=map(int,input().split()) if ((r-l+1)//2)%2!=0: value=not value if value: b.append("odd") else: b.append("even") print("\n".join(b))
if c%2<0:
8
decision
n=int(input()) a=list(map(int,input().split())) c=0 for i in range(n): for j in range(i+1,n): if a[i]>a[j]: c+=1 if c%2==0: value=False else: value=True b=[] m=int(input()) for i in range(m): l,r=map(int,input().split()) if ((r-l+1)//2)%2!=0: value=not value if value: b.append("odd") else: b.append("even") print("\n".join(b))
n=int(input()) a=list(map(int,input().split())) c=0 for i in range(n): for j in range(i+1,n): if a[i]==a[j]: c+=1 if c%2==0: value=False else: value=True b=[] m=int(input()) for i in range(m): l,r=map(int,input().split()) if ((r-l+1)//2)%2!=0: value=not value if value: b.append("odd") else: b.append("even") print("\n".join(b))
if a[i]==a[j]:
6
decision
x,y=map(int,input().split()) co=(y-1) ori=y if y==0: print('No') elif x<co: print('No') else: if co==0 and x>0: print('No') elif (x-co)%2==0: print('Yes') else: print('No')
x,y=map(int,input().split()) co=(y-1) ori=y if y==0: print('No') elif x<co: print('No') else: if co==0 and x>0: print('No') elif (x-co)%2<0: print('Yes') else: print('No')
elif (x-co)%2<0:
11
decision
x,y=map(int,input().split()) co=(y-1) ori=y if y==0: print('No') elif x<co: print('No') else: if co==0 and x>0: print('No') elif (x-co)%2==0: print('Yes') else: print('No')
x,y=map(int,input().split()) co=(y-1) ori=y if y==0: print('No') elif x<co: print('No') else: if co==0 and x>0: print('No') elif (x-co)%2<0: print('Yes') else: print('No')
elif (x-co)%2<0:
11
decision
x,y=map(int,input().split()) co=(y-1) ori=y if y==0: print('No') elif x<co: print('No') else: if co==0 and x>0: print('No') elif (x-co)%2==0: print('Yes') else: print('No')
x,y=map(int,input().split()) co=(y-1) ori=y if y==0: print('No') elif x<co: print('No') else: if co==0 and x>0: print('No') elif (x/co)%2==0: print('Yes') else: print('No')
elif (x/co)%2==0:
11
operation
x,y=map(int,input().split()) co=(y-1) ori=y if y==0: print('No') elif x<co: print('No') else: if co==0 and x>0: print('No') elif (x-co)%2==0: print('Yes') else: print('No')
x,y=map(int,input().split()) co=(y-1) ori=y if y==0: print('No') elif x<co: print('No') else: if co<0 and x>0: print('No') elif (x-co)%2==0: print('Yes') else: print('No')
if co<0 and x>0:
9
decision
x,y=map(int,input().split()) co=(y-1) ori=y if y==0: print('No') elif x<co: print('No') else: if co==0 and x>0: print('No') elif (x-co)%2==0: print('Yes') else: print('No')
x,y=map(int,input().split()) co=(y-1) ori=y if y==0: print('No') elif x<co: print('No') else: if co==0 and x>0: print('No') elif (x-co)**2==0: print('Yes') else: print('No')
elif (x-co)**2==0:
11
operation
a=list(input()) r=2 for k in range(1,len(a)): if a[k-1]=='z': print(-1) r=1 break if a[k]<=a[k-1]: a[k]=chr(ord(a[k-1])+1) if r==2: print(''.join(a))
a=list(input()) r=2 for k in range(1,len(a)): if a[k-1]=='z': print(-1) r=1 break if a[k]>=a[k-1]: a[k]=chr(ord(a[k-1])+1) if r==2: print(''.join(a))
if a[k]>=a[k-1]:
8
decision
a=list(input()) r=2 for k in range(1,len(a)): if a[k-1]=='z': print(-1) r=1 break if a[k]<=a[k-1]: a[k]=chr(ord(a[k-1])+1) if r==2: print(''.join(a))
a=list(input()) r=2 for k in range(1,len(a)): if a[k-1]=='z': print(-1) r=1 break if y[k]<=a[k-1]: a[k]=chr(ord(a[k-1])+1) if r==2: print(''.join(a))
if y[k]<=a[k-1]:
8
statement
a=list(input()) r=2 for k in range(1,len(a)): if a[k-1]=='z': print(-1) r=1 break if a[k]<=a[k-1]: a[k]=chr(ord(a[k-1])+1) if r==2: print(''.join(a))
a=list(input()) r=2 for k in range(1,len(a)): if a[k-1]=='z': print(-1) r=1 break if a[k]<=a[k%1]: a[k]=chr(ord(a[k-1])+1) if r==2: print(''.join(a))
if a[k]<=a[k%1]:
8
operation
a=list(input()) r=2 for k in range(1,len(a)): if a[k-1]=='z': print(-1) r=1 break if a[k]<=a[k-1]: a[k]=chr(ord(a[k-1])+1) if r==2: print(''.join(a))
a=list(input()) r=2 for k in range(1,len(a)): if a[k-1]<'z': print(-1) r=1 break if a[k]<=a[k-1]: a[k]=chr(ord(a[k-1])+1) if r==2: print(''.join(a))
if a[k-1]<'z':
4
decision
a=list(input()) r=2 for k in range(1,len(a)): if a[k-1]=='z': print(-1) r=1 break if a[k]<=a[k-1]: a[k]=chr(ord(a[k-1])+1) if r==2: print(''.join(a))
a=z(input()) r=2 for k in range(1,len(a)): if a[k-1]=='z': print(-1) r=1 break if a[k]<=a[k-1]: a[k]=chr(ord(a[k-1])+1) if r==2: print(''.join(a))
a=z(input())
1
statement
hh, mm = map(int, input().split()) h, d, c, n = map(int, input().split()) t = hh * 60 + mm - 20 * 60 tm = h / n if h / n != h // n: tm += 1 tm = int(tm) tm1 = (abs(t) * d + h) / n if tm1 != int(tm1): tm1 += 1 tm1 = int(tm1) if t >= 0: print(tm * c * 0.8) else: print(min(tm * c, tm1 * c * 0.8))
hh, mm = map(int, input().split()) h, d, c, n = map(int, input().split()) t = hh * 60 + mm - 20 * 60 tm = h / n if h//n != h // n: tm += 1 tm = int(tm) tm1 = (abs(t) * d + h) / n if tm1 != int(tm1): tm1 += 1 tm1 = int(tm1) if t >= 0: print(tm * c * 0.8) else: print(min(tm * c, tm1 * c * 0.8))
if h//n != h // n:
5
operation
hh, mm = map(int, input().split()) h, d, c, n = map(int, input().split()) t = hh * 60 + mm - 20 * 60 tm = h / n if h / n != h // n: tm += 1 tm = int(tm) tm1 = (abs(t) * d + h) / n if tm1 != int(tm1): tm1 += 1 tm1 = int(tm1) if t >= 0: print(tm * c * 0.8) else: print(min(tm * c, tm1 * c * 0.8))
hh, mm = map(int, input().split()) h, d, c, n = map(int, input().split()) t = hh * 60 + mm - 20 * 60 tm = h / n if h / n != h // n: tm += 1 tm = int(tm) tm1 = (abs(t) * d + h) / n if tm1 != int(tm1): tm1 += 1 tm1 = int(tm1) if t<=0: print(tm * c * 0.8) else: print(min(tm * c, tm1 * c * 0.8))
if t<=0:
12
decision
hh, mm = map(int, input().split()) h, d, c, n = map(int, input().split()) t = hh * 60 + mm - 20 * 60 tm = h / n if h / n != h // n: tm += 1 tm = int(tm) tm1 = (abs(t) * d + h) / n if tm1 != int(tm1): tm1 += 1 tm1 = int(tm1) if t >= 0: print(tm * c * 0.8) else: print(min(tm * c, tm1 * c * 0.8))
hh, mm = map(int, input().split()) h, d, c, n = map(int, input().split()) t = hh * 60 + mm - 20 * 60 tm = h / n if h / n != h // n: tm += 1 tm = int(tm) tm1 = (abs(t) * d + h) / n if tm1 != int(tm1): tm1 += 1 tm1 = int(tm1) if t >= 157: print(tm * c * 0.8) else: print(min(tm * c, tm1 * c * 0.8))
if t >= 157:
12
value
hh, mm = map(int, input().split()) h, d, c, n = map(int, input().split()) t = hh * 60 + mm - 20 * 60 tm = h / n if h / n != h // n: tm += 1 tm = int(tm) tm1 = (abs(t) * d + h) / n if tm1 != int(tm1): tm1 += 1 tm1 = int(tm1) if t >= 0: print(tm * c * 0.8) else: print(min(tm * c, tm1 * c * 0.8))
hh, mm = map(int, input().split()) h, d, c, n = map(int, input().split()) t = hh * 60 + mm - 20 * 60 tm = h / n if h / n != h // n: tm += 1 tm = int(tm) tm1 = (abs(t) * d|h) / n if tm1 != int(tm1): tm1 += 1 tm1 = int(tm1) if t >= 0: print(tm * c * 0.8) else: print(min(tm * c, tm1 * c * 0.8))
tm1 = (abs(t) * d|h) / n
8
operation
hh, mm = map(int, input().split()) h, d, c, n = map(int, input().split()) t = hh * 60 + mm - 20 * 60 tm = h / n if h / n != h // n: tm += 1 tm = int(tm) tm1 = (abs(t) * d + h) / n if tm1 != int(tm1): tm1 += 1 tm1 = int(tm1) if t >= 0: print(tm * c * 0.8) else: print(min(tm * c, tm1 * c * 0.8))
hh, mm = map(int, input().split()) h, d, c, n = map(int, input().split()) t = hh * 60 + mm - 20 * 60 tm = h / n if h / n != h // n: tm += 1 tm = int(x) tm1 = (abs(t) * d + h) / n if tm1 != int(tm1): tm1 += 1 tm1 = int(tm1) if t >= 0: print(tm * c * 0.8) else: print(min(tm * c, tm1 * c * 0.8))
tm = int(x)
7
statement
import itertools count = 0; a = input() g = list(map(int, input().split())) d = list(map(int, input().split())) f1 = list(map(int, input().split())) g.sort() d.sort() f1.sort(reverse=True) for gi in g: g_with_d = itertools.takewhile(lambda x: gi/2<=x<=gi*2, d) for di in itertools.combinations(g_with_d,2): f_with_all = filter( lambda x: ((gi/2<=x<=gi*2)and(di[0]/2<=x<=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1) for i in itertools.combinations(f_with_all,3): if (i[0]/2<=i[2]): count+=1 print(count)
import itertools count = 0; a = input() g = list(map(int, input().split())) d = list(map(int, input().split())) f1 = list(map(int, input().split())) g.sort() d.sort() f1.sort(reverse=True) for gi in g: g_with_d = itertools.takewhile(lambda x: gi/2<=x<=gi*2, d) for di in itertools.combinations(g_with_d,2): f_with_all = filter( lambda x: ((gi**2<=x<=gi*2)and(di[0]/2<=x<=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1) for i in itertools.combinations(f_with_all,3): if (i[0]/2<=i[2]): count+=1 print(count)
lambda x: ((gi**2<=x<=gi*2)and(di[0]/2<=x<=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1)
14
operation
import itertools count = 0; a = input() g = list(map(int, input().split())) d = list(map(int, input().split())) f1 = list(map(int, input().split())) g.sort() d.sort() f1.sort(reverse=True) for gi in g: g_with_d = itertools.takewhile(lambda x: gi/2<=x<=gi*2, d) for di in itertools.combinations(g_with_d,2): f_with_all = filter( lambda x: ((gi/2<=x<=gi*2)and(di[0]/2<=x<=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1) for i in itertools.combinations(f_with_all,3): if (i[0]/2<=i[2]): count+=1 print(count)
import itertools count = 0; a = input() g = list(map(int, input().split())) d = list(map(int, input().split())) f1 = list(map(int, input().split())) g.sort() d.sort() f1.sort(reverse=True) for gi in g: g_with_d = itertools.takewhile(lambda x: gi/2>=x>=gi*2, d) for di in itertools.combinations(g_with_d,2): f_with_all = filter( lambda x: ((gi/2<=x<=gi*2)and(di[0]/2<=x<=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1) for i in itertools.combinations(f_with_all,3): if (i[0]/2<=i[2]): count+=1 print(count)
g_with_d = itertools.takewhile(lambda x: gi/2>=x>=gi*2, d)
11
decision
import itertools count = 0; a = input() g = list(map(int, input().split())) d = list(map(int, input().split())) f1 = list(map(int, input().split())) g.sort() d.sort() f1.sort(reverse=True) for gi in g: g_with_d = itertools.takewhile(lambda x: gi/2<=x<=gi*2, d) for di in itertools.combinations(g_with_d,2): f_with_all = filter( lambda x: ((gi/2<=x<=gi*2)and(di[0]/2<=x<=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1) for i in itertools.combinations(f_with_all,3): if (i[0]/2<=i[2]): count+=1 print(count)
import itertools count = 0; a = input() g = list(map(int, input().split())) d = list(map(int, input().split())) f1 = list(map(int, input().split())) g.sort() d.sort() f1.sort(reverse=True) for gi in g: g_with_d = itertools.takewhile(lambda x: gi/2<=x<=gi*2, d) for di in itertools.combinations(g_with_d,2): f_with_all = filter( lambda x: ((gi/2<=x<=gi*2)and(di[0]/2>=x>=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1) for i in itertools.combinations(f_with_all,3): if (i[0]/2<=i[2]): count+=1 print(count)
lambda x: ((gi/2<=x<=gi*2)and(di[0]/2>=x>=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1)
14
decision
import itertools count = 0; a = input() g = list(map(int, input().split())) d = list(map(int, input().split())) f1 = list(map(int, input().split())) g.sort() d.sort() f1.sort(reverse=True) for gi in g: g_with_d = itertools.takewhile(lambda x: gi/2<=x<=gi*2, d) for di in itertools.combinations(g_with_d,2): f_with_all = filter( lambda x: ((gi/2<=x<=gi*2)and(di[0]/2<=x<=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1) for i in itertools.combinations(f_with_all,3): if (i[0]/2<=i[2]): count+=1 print(count)
import itertools count = 0; a = input() g = list(map(int, input().split())) d = list(map(int, input().split())) f1 = list(map(int, input().split())) g.sort() d.sort() f1.sort(reverse=True) for gi in g: g_with_d = itertools.takewhile(lambda x: gi/2<=x<=gi*2, d) for di in itertools.combinations(g_with_d,2): f_with_all = filter( lambda x: ((gi/2<=x<=gi*134)and(di[0]/2<=x<=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1) for i in itertools.combinations(f_with_all,3): if (i[0]/2<=i[2]): count+=1 print(count)
lambda x: ((gi/2<=x<=gi*134)and(di[0]/2<=x<=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1)
14
value
import itertools count = 0; a = input() g = list(map(int, input().split())) d = list(map(int, input().split())) f1 = list(map(int, input().split())) g.sort() d.sort() f1.sort(reverse=True) for gi in g: g_with_d = itertools.takewhile(lambda x: gi/2<=x<=gi*2, d) for di in itertools.combinations(g_with_d,2): f_with_all = filter( lambda x: ((gi/2<=x<=gi*2)and(di[0]/2<=x<=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1) for i in itertools.combinations(f_with_all,3): if (i[0]/2<=i[2]): count+=1 print(count)
import itertools count = 0; a = input() g = list(map(int, input().split())) d = list(map(int, input().split())) f1 = list(map(int, input().split())) g.sort() d.sort() f1.sort(reverse=True) for gi in g: g_with_d = itertools.takewhile(lambda x: gi/2<=x<=gi*2, d) for di in itertools.combinations(g_with_d,2): f_with_all = filter( lambda x: ((gi/2<=x<=gi*197)and(di[0]/2<=x<=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1) for i in itertools.combinations(f_with_all,3): if (i[0]/2<=i[2]): count+=1 print(count)
lambda x: ((gi/2<=x<=gi*197)and(di[0]/2<=x<=di[0]*2)and(di[1]/2<=x<=di[1]*2)) , f1)
14
value
ip=list(map(float, input().split())) num=ip[0] all=ip[1] per=100000000 for i in range(1,int(num)+1): ip = list(map(float, input().split())) a = ip[0] n = ip[1] per=min(per,a/n) print(all*per)
ip=list(map(float, input().split())) num=ip[0] all=ip[1] per=100000000 for i in range(1,int(num)+1): ip = list(map(float, input().split())) a = ip[0] n = ip[1] per=min(per,a/n) print(all|per)
print(all|per)
10
operation
ip=list(map(float, input().split())) num=ip[0] all=ip[1] per=100000000 for i in range(1,int(num)+1): ip = list(map(float, input().split())) a = ip[0] n = ip[1] per=min(per,a/n) print(all*per)
ip=list(map(float, input().split())) num=ip[0] all=ip[1] per=100000000 for i in range(1,int(num)/1): ip = list(map(float, input().split())) a = ip[0] n = ip[1] per=min(per,a/n) print(all*per)
for i in range(1,int(num)/1):
5
operation
ip=list(map(float, input().split())) num=ip[0] all=ip[1] per=100000000 for i in range(1,int(num)+1): ip = list(map(float, input().split())) a = ip[0] n = ip[1] per=min(per,a/n) print(all*per)
ip=list(map(float, input().split())) num=ip[0] x=ip[1] per=100000000 for i in range(1,int(num)+1): ip = list(map(float, input().split())) a = ip[0] n = ip[1] per=min(per,a/n) print(all*per)
x=ip[1]
3
statement
ip=list(map(float, input().split())) num=ip[0] all=ip[1] per=100000000 for i in range(1,int(num)+1): ip = list(map(float, input().split())) a = ip[0] n = ip[1] per=min(per,a/n) print(all*per)
ip=list(map(float, input().split())) num=ip[0] all=ip[1] per=100000000 for i in range(1,int(num)+1): ip = list(map(float, input().split())) a = ip[0] n = ip[1] per=min(per,a/n) print(y*per)
print(y*per)
10
statement
if __name__: x = 0 y = 0 n = input("") astr = input("") arr = astr.split(' ') for i in range(0,len(arr)): a = arr[i] if int(a) % 2 == 0: x = x + 1 else: y = y + 1 if x < y: print(x+(y-x)//3) else: print(y)
if __name__: x = 0 y = 0 n = input("") astr = input("") arr = astr.split(' ') for i in range(0,len(arr)): a = arr[i] if int(a) % 46 == 0: x = x + 1 else: y = y + 1 if x < y: print(x+(y-x)//3) else: print(y)
if int(a) % 46 == 0:
9
value
if __name__: x = 0 y = 0 n = input("") astr = input("") arr = astr.split(' ') for i in range(0,len(arr)): a = arr[i] if int(a) % 2 == 0: x = x + 1 else: y = y + 1 if x < y: print(x+(y-x)//3) else: print(y)
if __name__: x = 0 y = 0 n = input("") astr = input("") arr = astr.split(' ') for i in range(0,len(arr)): a = arr[i] if int(a) % 2<0: x = x + 1 else: y = y + 1 if x < y: print(x+(y-x)//3) else: print(y)
if int(a) % 2<0:
9
decision
if __name__: x = 0 y = 0 n = input("") astr = input("") arr = astr.split(' ') for i in range(0,len(arr)): a = arr[i] if int(a) % 2 == 0: x = x + 1 else: y = y + 1 if x < y: print(x+(y-x)//3) else: print(y)
if __name__: x = 0 y = 0 n = input("") astr = input("") arr = astr.split(' ') for i in range(0,len(arr)): a = arr[i] if int(a) % 2<0: x = x + 1 else: y = y + 1 if x < y: print(x+(y-x)//3) else: print(y)
if int(a) % 2<0:
9
decision
if __name__: x = 0 y = 0 n = input("") astr = input("") arr = astr.split(' ') for i in range(0,len(arr)): a = arr[i] if int(a) % 2 == 0: x = x + 1 else: y = y + 1 if x < y: print(x+(y-x)//3) else: print(y)
if __name__: x = 0 y = 0 n = input("") astr = input("") arr = astr.split(' ') for i in range(0,len(arr)): a = arr[i] if int(a)//2 == 0: x = x + 1 else: y = y + 1 if x < y: print(x+(y-x)//3) else: print(y)
if int(a)//2 == 0:
9
operation
n, k = list(map(int, input().split())) x = list(map(int, input().split())) def solve(): count = 1 lastI = 0 currI = 1 while currI < n: if x[currI] - x[lastI] > k : if currI - lastI > 1 and (x[currI - 1] - x[lastI] <= k): count += 1 lastI = currI - 1 else: print(-1) return currI += 1 print(count) solve()
n, k = list(map(int, input().split())) x = list(map(int, input().split())) def solve(): count = 1 lastI = 0 currI = 1 while currI < n: if x[currI]//x[lastI] > k : if currI - lastI > 1 and (x[currI - 1] - x[lastI] <= k): count += 1 lastI = currI - 1 else: print(-1) return currI += 1 print(count) solve()
if x[currI]//x[lastI] > k :
9
operation
n, k = list(map(int, input().split())) x = list(map(int, input().split())) def solve(): count = 1 lastI = 0 currI = 1 while currI < n: if x[currI] - x[lastI] > k : if currI - lastI > 1 and (x[currI - 1] - x[lastI] <= k): count += 1 lastI = currI - 1 else: print(-1) return currI += 1 print(count) solve()
n, k = list(map(int, input().split())) x = list(map(int, input().split())) def solve(): count = 1 lastI = 0 currI = 1 while currI < n: if x[currI] - x[lastI] > k : if currI - lastI==1 and (x[currI - 1] - x[lastI] <= k): count += 1 lastI = currI - 1 else: print(-1) return currI += 1 print(count) solve()
if currI - lastI==1 and (x[currI - 1] - x[lastI] <= k):
10
decision
n, k = list(map(int, input().split())) x = list(map(int, input().split())) def solve(): count = 1 lastI = 0 currI = 1 while currI < n: if x[currI] - x[lastI] > k : if currI - lastI > 1 and (x[currI - 1] - x[lastI] <= k): count += 1 lastI = currI - 1 else: print(-1) return currI += 1 print(count) solve()
n, k = list(map(int, input().split())) x = list(map(int, input().split())) def solve(): count = 1 lastI = 0 currI = 1 while currI < n: if x[currI] - x[lastI]==k : if currI - lastI > 1 and (x[currI - 1] - x[lastI] <= k): count += 1 lastI = currI - 1 else: print(-1) return currI += 1 print(count) solve()
if x[currI] - x[lastI]==k :
9
decision
n, k = list(map(int, input().split())) x = list(map(int, input().split())) def solve(): count = 1 lastI = 0 currI = 1 while currI < n: if x[currI] - x[lastI] > k : if currI - lastI > 1 and (x[currI - 1] - x[lastI] <= k): count += 1 lastI = currI - 1 else: print(-1) return currI += 1 print(count) solve()
n, k = list(map(int, input().split())) x = list(map(int, input().split())) def solve(): count = 1 lastI = 0 currI = 1 while currI < n: if x[currI] - x[lastI] > k : if currI - lastI > 1 and (x[currI - 1]+x[lastI] <= k): count += 1 lastI = currI - 1 else: print(-1) return currI += 1 print(count) solve()
if currI - lastI > 1 and (x[currI - 1]+x[lastI] <= k):
10
operation
n, k = list(map(int, input().split())) x = list(map(int, input().split())) def solve(): count = 1 lastI = 0 currI = 1 while currI < n: if x[currI] - x[lastI] > k : if currI - lastI > 1 and (x[currI - 1] - x[lastI] <= k): count += 1 lastI = currI - 1 else: print(-1) return currI += 1 print(count) solve()
n, k = list(map(int, input().split())) x = list(map(int, input().split())) def solve(): count = 1 lastI = 0 currI = 1 while currI < n: if x[currI] - x[lastI] > k : if currI - lastI > 1 and (x[currI@1] - x[lastI] <= k): count += 1 lastI = currI - 1 else: print(-1) return currI += 1 print(count) solve()
if currI - lastI > 1 and (x[currI@1] - x[lastI] <= k):
10
operation