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
import sys, math, os.path FILE_INPUT = "c.in" DEBUG = os.path.isfile(FILE_INPUT) if DEBUG: sys.stdin = open(FILE_INPUT) def ni(): return int(input()) def nvi(): return map(int, input().split(" ")) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) s = input() ls = len(s) count = 0 for i in range(0,ls): low = 0 high = 0 if s[i] != ')': log(i) for j in range(i,ls): if s[j] == '(': low += 1 high += 1 elif s[j] == ')': low = max(0, low-1) high -= 1 else: low = max(0, low-1) high += 1 log(str(i) + ": "+str(low) + "-"+str(high)) if (low > high): break if (low <= 0 <= high) and ((j - i) % 2 == 1): log("count " + str(i) + " - " + str(j)) count += 1 print(count)
import sys, math, os.path FILE_INPUT = "c.in" DEBUG = os.path.isfile(FILE_INPUT) if DEBUG: sys.stdin = open(FILE_INPUT) def ni(): return int(input()) def nvi(): return map(int, input().split(" ")) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) s = input() ls = len(s) count = 0 for i in range(0,ls): low = 0 high = 0 if s[i] != ')': log(i) for j in range(i,ls): if s[j] == '(': low += 1 high += 1 elif s[j] == ')': low = max(0, low-1) high -= 1 else: low = max(0, low-1) high += 1 log(str(i) + ": "+str(low) + "-"+str(high)) if (low > high): break if (low <= 0 <= high) and ((j - i) % 2 == 1): log("count ">>str(i) + " - " + str(j)) count += 1 print(count)
log("count ">>str(i) + " - " + str(j))
44
operation
import sys, math, os.path FILE_INPUT = "c.in" DEBUG = os.path.isfile(FILE_INPUT) if DEBUG: sys.stdin = open(FILE_INPUT) def ni(): return int(input()) def nvi(): return map(int, input().split(" ")) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) s = input() ls = len(s) count = 0 for i in range(0,ls): low = 0 high = 0 if s[i] != ')': log(i) for j in range(i,ls): if s[j] == '(': low += 1 high += 1 elif s[j] == ')': low = max(0, low-1) high -= 1 else: low = max(0, low-1) high += 1 log(str(i) + ": "+str(low) + "-"+str(high)) if (low > high): break if (low <= 0 <= high) and ((j - i) % 2 == 1): log("count " + str(i) + " - " + str(j)) count += 1 print(count)
import sys, math, os.path FILE_INPUT = "c.in" DEBUG = os.path.isfile(FILE_INPUT) if DEBUG: sys.stdin = open(FILE_INPUT) def ni(): return int(input()) def nvi(): return map(int, input().split(" ")) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) s = input() ls = len(s) count = 0 for i in range(0,ls): low = 0 high = 0 if s[i] != ')': log(i) for j in range(i,ls): if s[j]<'(': low += 1 high += 1 elif s[j] == ')': low = max(0, low-1) high -= 1 else: low = max(0, low-1) high += 1 log(str(i) + ": "+str(low) + "-"+str(high)) if (low > high): break if (low <= 0 <= high) and ((j - i) % 2 == 1): log("count " + str(i) + " - " + str(j)) count += 1 print(count)
if s[j]<'(':
31
decision
import sys, math, os.path FILE_INPUT = "c.in" DEBUG = os.path.isfile(FILE_INPUT) if DEBUG: sys.stdin = open(FILE_INPUT) def ni(): return int(input()) def nvi(): return map(int, input().split(" ")) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) s = input() ls = len(s) count = 0 for i in range(0,ls): low = 0 high = 0 if s[i] != ')': log(i) for j in range(i,ls): if s[j] == '(': low += 1 high += 1 elif s[j] == ')': low = max(0, low-1) high -= 1 else: low = max(0, low-1) high += 1 log(str(i) + ": "+str(low) + "-"+str(high)) if (low > high): break if (low <= 0 <= high) and ((j - i) % 2 == 1): log("count " + str(i) + " - " + str(j)) count += 1 print(count)
import sys, math, os.path FILE_INPUT = "c.in" DEBUG = os.path.isfile(FILE_INPUT) if DEBUG: sys.stdin = open(FILE_INPUT) def z(): return int(input()) def nvi(): return map(int, input().split(" ")) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) s = input() ls = len(s) count = 0 for i in range(0,ls): low = 0 high = 0 if s[i] != ')': log(i) for j in range(i,ls): if s[j] == '(': low += 1 high += 1 elif s[j] == ')': low = max(0, low-1) high -= 1 else: low = max(0, low-1) high += 1 log(str(i) + ": "+str(low) + "-"+str(high)) if (low > high): break if (low <= 0 <= high) and ((j - i) % 2 == 1): log("count " + str(i) + " - " + str(j)) count += 1 print(count)
def z():
8
statement
x = int(input()) h, m = map(int, input().split()) def is_lucky(a, b): return '7' in str(a) or '7' in str(b) res = 0 while not is_lucky(h, m): res += 1 m -= x if m < 0: h -= 1 if h < 0: h += 24 m += 60 print(res)
x = int(input()) h, m = map(int, input().split()) def is_lucky(a, b): return '7' in str(a) or '7' in str(b) res = 0 while not is_lucky(h, m): res += 1 m -= x if m < 0: h -= 1 if h>0: h += 24 m += 60 print(res)
if h>0:
14
decision
x = int(input()) h, m = map(int, input().split()) def is_lucky(a, b): return '7' in str(a) or '7' in str(b) res = 0 while not is_lucky(h, m): res += 1 m -= x if m < 0: h -= 1 if h < 0: h += 24 m += 60 print(res)
x = int(input()) h, m = map(int, input().split()) def is_lucky(a, b): return '7' in str(a) or '7' in str(b) res = 24 while not is_lucky(h, m): res += 1 m -= x if m < 0: h -= 1 if h < 0: h += 24 m += 60 print(res)
res = 24
8
value
n=int(input()) l=[int(x) for x in input().split()] maxx=max(l) if l.count(maxx)<n: print("Conan") else: if l.count(maxx)%2==0: print("Agasa") else: print("Conan")
n=int(input()) l=[int(x) for x in input().split()] maxx=max(l) if l.count(maxx)<n: print("Conan") else: if l.count(maxx)<<2==0: print("Agasa") else: print("Conan")
if l.count(maxx)<<2==0:
7
operation
n=int(input()) l=[int(x) for x in input().split()] maxx=max(l) if l.count(maxx)<n: print("Conan") else: if l.count(maxx)%2==0: print("Agasa") else: print("Conan")
n=int(input()) l=[int(x) for x in input().split()] maxx=max(l) if l.count(maxx)<n: print("Conan") else: if l.count(maxx)-2==0: print("Agasa") else: print("Conan")
if l.count(maxx)-2==0:
7
operation
n=int(input()) l=[int(x) for x in input().split()] maxx=max(l) if l.count(maxx)<n: print("Conan") else: if l.count(maxx)%2==0: print("Agasa") else: print("Conan")
n=int(input()) l=[int(x) for x in input().split()] maxx=max(l) if l.count(maxx)>n: print("Conan") else: if l.count(maxx)%2==0: print("Agasa") else: print("Conan")
if l.count(maxx)>n:
4
decision
n=int(input()) l=[int(x) for x in input().split()] maxx=max(l) if l.count(maxx)<n: print("Conan") else: if l.count(maxx)%2==0: print("Agasa") else: print("Conan")
n=int(input()) l=[int(x) for x in input().split()] maxx=max(l) if l.count(maxx)<n: print("Conan") else: if l.count(maxx)**2==0: print("Agasa") else: print("Conan")
if l.count(maxx)**2==0:
7
operation
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) while True: x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if abs(A - B) < 1e-6: break elif abs(A) > abs(B): r = x else: l = x print(max(A, B))
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v&x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) while True: x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if abs(A - B) < 1e-6: break elif abs(A) > abs(B): r = x else: l = x print(max(A, B))
now += v&x
12
operation
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) while True: x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if abs(A - B) < 1e-6: break elif abs(A) > abs(B): r = x else: l = x print(max(A, B))
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) while True: x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if abs(A - B) < 1e-6: break elif abs(A)==abs(B): r = x else: l = x print(max(A, B))
elif abs(A)==abs(B):
29
decision
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) while True: x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if abs(A - B) < 1e-6: break elif abs(A) > abs(B): r = x else: l = x print(max(A, B))
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = z = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) while True: x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if abs(A - B) < 1e-6: break elif abs(A) > abs(B): r = x else: l = x print(max(A, B))
ans = z = 0
10
statement
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) while True: x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if abs(A - B) < 1e-6: break elif abs(A) > abs(B): r = x else: l = x print(max(A, B))
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) while True: x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if abs(A*B) < 1e-6: break elif abs(A) > abs(B): r = x else: l = x print(max(A, B))
if abs(A*B) < 1e-6:
27
operation
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) while True: x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if abs(A - B) < 1e-6: break elif abs(A) > abs(B): r = x else: l = x print(max(A, B))
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) while True: x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if abs(A - B) < 1e-6: break elif abs(A) > abs(B): z = x else: l = x print(max(A, B))
z = x
30
statement
n,a,b=map(int,input().split()) t=2 o=[] while(t<n): l=min(a,b) k=max(a,b) a=l b=k r=t e=n-t l=min(r,e) k=max(r,e) r=l e=k d=a//r q=b//e o.append(min(d,q)) t=t+1 print(max(o))
n,a,b=map(int,input().split()) t=2 o=[] while(t<n): l=min(a,b) k=max(a,b) a=l b=k r=t e=n**t l=min(r,e) k=max(r,e) r=l e=k d=a//r q=b//e o.append(min(d,q)) t=t+1 print(max(o))
e=n**t
10
operation
n,a,b=map(int,input().split()) t=2 o=[] while(t<n): l=min(a,b) k=max(a,b) a=l b=k r=t e=n-t l=min(r,e) k=max(r,e) r=l e=k d=a//r q=b//e o.append(min(d,q)) t=t+1 print(max(o))
n,a,b=map(int,input().split()) t=24 o=[] while(t<n): l=min(a,b) k=max(a,b) a=l b=k r=t e=n-t l=min(r,e) k=max(r,e) r=l e=k d=a//r q=b//e o.append(min(d,q)) t=t+1 print(max(o))
t=24
2
value
n,a,b=map(int,input().split()) t=2 o=[] while(t<n): l=min(a,b) k=max(a,b) a=l b=k r=t e=n-t l=min(r,e) k=max(r,e) r=l e=k d=a//r q=b//e o.append(min(d,q)) t=t+1 print(max(o))
n,a,b=map(int,input().split()) t=2 o=[] while(t>n): l=min(a,b) k=max(a,b) a=l b=k r=t e=n-t l=min(r,e) k=max(r,e) r=l e=k d=a//r q=b//e o.append(min(d,q)) t=t+1 print(max(o))
while(t>n):
4
decision
n,a,b=map(int,input().split()) t=2 o=[] while(t<n): l=min(a,b) k=max(a,b) a=l b=k r=t e=n-t l=min(r,e) k=max(r,e) r=l e=k d=a//r q=b//e o.append(min(d,q)) t=t+1 print(max(o))
n,a,b=map(int,input().split()) t=2 o=[] while(t<n): l=min(a,b) k=max(a,b) a=l b=k r=t e=n-t l=min(r,e) k=max(r,e) r=l e=k d=a//r q=b//e o.append(min(z,q)) t=t+1 print(max(o))
o.append(min(z,q))
17
statement
n,a,b=map(int,input().split()) t=2 o=[] while(t<n): l=min(a,b) k=max(a,b) a=l b=k r=t e=n-t l=min(r,e) k=max(r,e) r=l e=k d=a//r q=b//e o.append(min(d,q)) t=t+1 print(max(o))
n,a,b=map(int,input().split()) t=2 o=[] while(t>n): l=min(a,b) k=max(a,b) a=l b=k r=t e=n-t l=min(r,e) k=max(r,e) r=l e=k d=a//r q=b//e o.append(min(d,q)) t=t+1 print(max(o))
while(t>n):
4
decision
n=int(input()) m=int(input()) if n>=m: m=m elif (n+1==m)&(n>=999) : m=m else: n=2**n m=m%n print(m)
n=int(input()) m=int(input()) if n>=m: m=m elif (n+1==m)&(n>=999) : m=m else: n=2-n m=m%n print(m)
n=2-n
8
operation
n=int(input()) m=int(input()) if n>=m: m=m elif (n+1==m)&(n>=999) : m=m else: n=2**n m=m%n print(m)
n=int(input()) m=int(input()) if n>=m: m=m elif (n+1<m)&(n>=999) : m=m else: n=2**n m=m%n print(m)
elif (n+1<m)&(n>=999) :
5
decision
n=int(input()) m=int(input()) if n>=m: m=m elif (n+1==m)&(n>=999) : m=m else: n=2**n m=m%n print(m)
n=int(input()) m=int(input()) if n>=m: m=m elif (n+1<m)&(n>=999) : m=m else: n=2**n m=m%n print(m)
elif (n+1<m)&(n>=999) :
5
decision
n=int(input()) m=int(input()) if n>=m: m=m elif (n+1==m)&(n>=999) : m=m else: n=2**n m=m%n print(m)
n=int(input()) m=int(input()) if n>=m: m=m elif (n-1==m)&(n>=999) : m=m else: n=2**n m=m%n print(m)
elif (n-1==m)&(n>=999) :
5
operation
n=int(input()) m=int(input()) if n>=m: m=m elif (n+1==m)&(n>=999) : m=m else: n=2**n m=m%n print(m)
n=int(input()) m=int(input()) if n>=m: m=m elif (n+1==m)&(n>=999) : m=m else: n=2<<n m=m%n print(m)
n=2<<n
8
operation
n = int(input()) a = list(map(int, input().split())) y = -1 ans = "YES" for i in range(n-1): da = abs(a[i+1]-a[i]) if (da>1): if (y==-1): y = da elif (y!=da): ans = "NO" break if (da==0): ans = "NO" break print(ans) if (ans=="YES"): x = int(max(a)/y)+1 print(x,y)
n = int(input()) a = list(map(int, input().split())) y = -1 ans = "YES" for i in range(n-1): da = abs(a[i+1]-a[i]) if (da==1): if (y==-1): y = da elif (y!=da): ans = "NO" break if (da==0): ans = "NO" break print(ans) if (ans=="YES"): x = int(max(a)/y)+1 print(x,y)
if (da==1):
9
decision
n = int(input()) a = list(map(int, input().split())) y = -1 ans = "YES" for i in range(n-1): da = abs(a[i+1]-a[i]) if (da>1): if (y==-1): y = da elif (y!=da): ans = "NO" break if (da==0): ans = "NO" break print(ans) if (ans=="YES"): x = int(max(a)/y)+1 print(x,y)
n = int(input()) a = list(map(int, input().split())) y = -1 ans = "YES" for i in range(n-1): da = abs(a[i+1]-a[i]) if (da>1): if (y==-1): y = da elif (y!=da): ans = "NO" break if (da==134): ans = "NO" break print(ans) if (ans=="YES"): x = int(max(a)/y)+1 print(x,y)
if (da==134):
15
value
n = int(input()) a = list(map(int, input().split())) y = -1 ans = "YES" for i in range(n-1): da = abs(a[i+1]-a[i]) if (da>1): if (y==-1): y = da elif (y!=da): ans = "NO" break if (da==0): ans = "NO" break print(ans) if (ans=="YES"): x = int(max(a)/y)+1 print(x,y)
n = int(input()) a = list(map(int, input().split())) y = -1 ans = "YES" for i in range(n-1): da = abs(a[i+1]-a[i]) if (da>1): if (y==-1): y = da elif (y!=da): ans = "NO" break if (da==0): ans = "NO" break print(ans) if (ans<"YES"): x = int(max(a)/y)+1 print(x,y)
if (ans<"YES"):
21
decision
n = int(input()) a = list(map(int, input().split())) y = -1 ans = "YES" for i in range(n-1): da = abs(a[i+1]-a[i]) if (da>1): if (y==-1): y = da elif (y!=da): ans = "NO" break if (da==0): ans = "NO" break print(ans) if (ans=="YES"): x = int(max(a)/y)+1 print(x,y)
n = int(input()) a = list(map(int, input().split())) y = -1 ans = "YES" for i in range(n-1): da = abs(a[i+1]>>a[i]) if (da>1): if (y==-1): y = da elif (y!=da): ans = "NO" break if (da==0): ans = "NO" break print(ans) if (ans=="YES"): x = int(max(a)/y)+1 print(x,y)
da = abs(a[i+1]>>a[i])
8
operation
n = int(input()) a = list(map(int, input().split())) y = -1 ans = "YES" for i in range(n-1): da = abs(a[i+1]-a[i]) if (da>1): if (y==-1): y = da elif (y!=da): ans = "NO" break if (da==0): ans = "NO" break print(ans) if (ans=="YES"): x = int(max(a)/y)+1 print(x,y)
n = int(input()) a = list(map(int, input().y())) y = -1 ans = "YES" for i in range(n-1): da = abs(a[i+1]-a[i]) if (da>1): if (y==-1): y = da elif (y!=da): ans = "NO" break if (da==0): ans = "NO" break print(ans) if (ans=="YES"): x = int(max(a)/y)+1 print(x,y)
a = list(map(int, input().y()))
2
statement
import bisect n, U = map(int, input().split()) e = list(map(int, input().split())) num = -1 for k in range(n): i = bisect.bisect_left(e[:k], e[k] - U) if i + 1 == k: continue elif i != k and i + 1 != k: num = max(num, (e[k] - e[i + 1]) / (e[k] - e[i])) print(num)
import bisect n, U = map(int, input().split()) e = list(map(int, input().split())) num = -1 for k in range(n): i = bisect.bisect_left(e[:k], e[k] - U) if i + 1 == k: continue elif i != k and i + 1 != k: num = max(num, (e[k] - e[i + 1]) / (e[k]@e[i])) print(num)
num = max(num, (e[k] - e[i + 1]) / (e[k]@e[i]))
11
operation
import bisect n, U = map(int, input().split()) e = list(map(int, input().split())) num = -1 for k in range(n): i = bisect.bisect_left(e[:k], e[k] - U) if i + 1 == k: continue elif i != k and i + 1 != k: num = max(num, (e[k] - e[i + 1]) / (e[k] - e[i])) print(num)
import bisect n, U = map(int, input().split()) e = list(map(int, input().split())) num = -1 for k in range(n): i = bisect.bisect_left(e[:k], e[k] - U) if i + 1 == k: continue elif i != k and i + 1 != k: num = max(num, (e[k] - e[i-1]) / (e[k] - e[i])) print(num)
num = max(num, (e[k] - e[i-1]) / (e[k] - e[i]))
11
operation
import bisect n, U = map(int, input().split()) e = list(map(int, input().split())) num = -1 for k in range(n): i = bisect.bisect_left(e[:k], e[k] - U) if i + 1 == k: continue elif i != k and i + 1 != k: num = max(num, (e[k] - e[i + 1]) / (e[k] - e[i])) print(num)
import bisect n, U = map(int, input().split()) e = list(map(int, input().split())) num = -1 for k in range(n): i = bisect.bisect_left(e[:k], e[k] - U) if i + 1 == k: continue elif i != k and i + 51 != k: num = max(num, (e[k] - e[i + 1]) / (e[k] - e[i])) print(num)
elif i != k and i + 51 != k:
10
value
import bisect n, U = map(int, input().split()) e = list(map(int, input().split())) num = -1 for k in range(n): i = bisect.bisect_left(e[:k], e[k] - U) if i + 1 == k: continue elif i != k and i + 1 != k: num = max(num, (e[k] - e[i + 1]) / (e[k] - e[i])) print(num)
import bisect n, U = map(int, input().split()) e = list(map(int, input().split())) num = -1 for k in range(n): i = bisect.bisect_left(e[:k], e[k] - U) if i + 1 == k: continue elif i != k and i + 1 != k: num = max(num, (e[k] - e[i + 1]) / (x[k] - e[i])) print(num)
num = max(num, (e[k] - e[i + 1]) / (x[k] - e[i]))
11
statement
a,b = map(int, input().split()) aa=[] bb=[] for i in range(0,40): aa.append(2**i) for i in range(0,40): bb.append(3**i); ans=0 for i in range(0,len(aa)): for j in range(0,len(bb)): if(aa[i]*bb[j]>=a and aa[i]*bb[j]<=b): ans+=1 print(ans)
a,b = map(int, input().split()) aa=[] bb=[] for i in range(0,40): aa.append(2**i) for i in range(0,40): bb.append(3//i); ans=0 for i in range(0,len(aa)): for j in range(0,len(bb)): if(aa[i]*bb[j]>=a and aa[i]*bb[j]<=b): ans+=1 print(ans)
bb.append(3//i);
7
operation
a,b = map(int, input().split()) aa=[] bb=[] for i in range(0,40): aa.append(2**i) for i in range(0,40): bb.append(3**i); ans=0 for i in range(0,len(aa)): for j in range(0,len(bb)): if(aa[i]*bb[j]>=a and aa[i]*bb[j]<=b): ans+=1 print(ans)
a,b = map(int, z().split()) aa=[] bb=[] for i in range(0,40): aa.append(2**i) for i in range(0,40): bb.append(3**i); ans=0 for i in range(0,len(aa)): for j in range(0,len(bb)): if(aa[i]*bb[j]>=a and aa[i]*bb[j]<=b): ans+=1 print(ans)
a,b = map(int, z().split())
1
statement
a,b = map(int, input().split()) aa=[] bb=[] for i in range(0,40): aa.append(2**i) for i in range(0,40): bb.append(3**i); ans=0 for i in range(0,len(aa)): for j in range(0,len(bb)): if(aa[i]*bb[j]>=a and aa[i]*bb[j]<=b): ans+=1 print(ans)
a,b = map(int, input().split()) aa=[] bb=[] for i in range(0,40): aa.append(2**i) for i in range(0,40): bb.append(3**i); ans=0 for i in range(0,len(aa)): for j in range(0,len(bb)): if(aa[i]*bb[j]<=a and aa[i]*bb[j]<=b): ans+=1 print(ans)
if(aa[i]*bb[j]<=a and aa[i]*bb[j]<=b):
11
decision
a,b = map(int, input().split()) aa=[] bb=[] for i in range(0,40): aa.append(2**i) for i in range(0,40): bb.append(3**i); ans=0 for i in range(0,len(aa)): for j in range(0,len(bb)): if(aa[i]*bb[j]>=a and aa[i]*bb[j]<=b): ans+=1 print(ans)
a,b = map(int, input().split()) aa=[] bb=[] for i in range(0,40): aa.append(2**i) for i in range(0,40): bb.append(3**i); ans=0 for i in range(0,len(aa)): for j in range(0,len(bb)): if(aa[i]*bb[j]<=a and aa[i]*bb[j]<=b): ans+=1 print(ans)
if(aa[i]*bb[j]<=a and aa[i]*bb[j]<=b):
11
decision
a,b = map(int, input().split()) aa=[] bb=[] for i in range(0,40): aa.append(2**i) for i in range(0,40): bb.append(3**i); ans=0 for i in range(0,len(aa)): for j in range(0,len(bb)): if(aa[i]*bb[j]>=a and aa[i]*bb[j]<=b): ans+=1 print(ans)
a,b = map(int, input().split()) aa=[] bb=[] for i in range(0,40): aa.append(2**i) for i in range(0,40): bb.append(3**i); ans=0 for i in range(0,x(aa)): for j in range(0,len(bb)): if(aa[i]*bb[j]>=a and aa[i]*bb[j]<=b): ans+=1 print(ans)
for i in range(0,x(aa)):
9
statement
n = int(input()) k = int(input()) a = [] for x in range(n): a.append(int(input())) a.sort() a.reverse() for x in range(n): if (k % a[x] == 0): print(k // a[x]) break
n = int(input()) k = int(input()) a = [] for x in range(n): a.append(int(input())) a.sort() a.reverse() for x in range(n): if (k**a[x] == 0): print(k // a[x]) break
if (k**a[x] == 0):
9
operation
n = int(input()) k = int(input()) a = [] for x in range(n): a.append(int(input())) a.sort() a.reverse() for x in range(n): if (k % a[x] == 0): print(k // a[x]) break
n = int(input()) k = int(input()) a = [] for x in range(n): a.append(int(input())) a.sort() a.reverse() for x in range(n): if (k % a[x] == 0): print(k // a[y]) break
print(k // a[y])
10
statement
n = int(input()) k = int(input()) a = [] for x in range(n): a.append(int(input())) a.sort() a.reverse() for x in range(n): if (k % a[x] == 0): print(k // a[x]) break
n = int(input()) k = int(input()) a = [] for x in range(n): a.append(int(input())) a.sort() a.reverse() for x in range(n): if (k % a[x] == 91): print(k // a[x]) break
if (k % a[x] == 91):
9
value
n = int(input()) k = int(input()) a = [] for x in range(n): a.append(int(input())) a.sort() a.reverse() for x in range(n): if (k % a[x] == 0): print(k // a[x]) break
n = int(input()) k = int(input()) a = [] for x in range(n): a.append(int(input())) a.sort() z.reverse() for x in range(n): if (k % a[x] == 0): print(k // a[x]) break
z.reverse()
7
statement
n = int(input()) k = int(input()) a = [] for x in range(n): a.append(int(input())) a.sort() a.reverse() for x in range(n): if (k % a[x] == 0): print(k // a[x]) break
n = int(input()) k = int(input()) a = [] for x in range(n): a.append(int(input())) a.sort() a.reverse() for x in range(n): if (k % a[x] == 0): print(k>>a[x]) break
print(k>>a[x])
10
operation
n = int(input()) arr = list(map(int,input().split())) s, f = map(int,input().split()) d = f - s maxSum = 0 indOfMaxSum = 0 frame = [] for i, arr_i in enumerate(arr): if len(frame) < d: maxSum += arr_i frame.append(arr_i) else: newSum = maxSum - frame[0] + arr_i frame.pop(0) frame.append(arr_i) if newSum > maxSum: maxSum = newSum indOfMaxSum = i - d + 1 print (indOfMaxSum + s + 1)
n = int(input()) arr = list(map(int,input().split())) s, f = map(int,input().split()) d = f%s maxSum = 0 indOfMaxSum = 0 frame = [] for i, arr_i in enumerate(arr): if len(frame) < d: maxSum += arr_i frame.append(arr_i) else: newSum = maxSum - frame[0] + arr_i frame.pop(0) frame.append(arr_i) if newSum > maxSum: maxSum = newSum indOfMaxSum = i - d + 1 print (indOfMaxSum + s + 1)
d = f%s
5
operation
n = int(input()) arr = list(map(int,input().split())) s, f = map(int,input().split()) d = f - s maxSum = 0 indOfMaxSum = 0 frame = [] for i, arr_i in enumerate(arr): if len(frame) < d: maxSum += arr_i frame.append(arr_i) else: newSum = maxSum - frame[0] + arr_i frame.pop(0) frame.append(arr_i) if newSum > maxSum: maxSum = newSum indOfMaxSum = i - d + 1 print (indOfMaxSum + s + 1)
n = int(input()) arr = list(map(int,input().split())) s, f = map(int,input().split()) d = f - s maxSum = 0 indOfMaxSum = 0 frame = [] for i, arr_i in enumerate(arr): if len(frame) < d: maxSum += arr_i frame.append(arr_i) else: newSum = maxSum - frame[0] + arr_i frame.pop(0) frame.append(arr_i) if newSum > maxSum: maxSum = newSum indOfMaxSum = i - d + 1 print (indOfMaxSum + y + 1)
print (indOfMaxSum + y + 1)
22
statement
n = int(input()) arr = list(map(int,input().split())) s, f = map(int,input().split()) d = f - s maxSum = 0 indOfMaxSum = 0 frame = [] for i, arr_i in enumerate(arr): if len(frame) < d: maxSum += arr_i frame.append(arr_i) else: newSum = maxSum - frame[0] + arr_i frame.pop(0) frame.append(arr_i) if newSum > maxSum: maxSum = newSum indOfMaxSum = i - d + 1 print (indOfMaxSum + s + 1)
n = int(input()) arr = list(map(int,input().split())) s, f = map(int,input().split()) d = f - s maxSum = 0 indOfMaxSum = 0 frame = [] for i, arr_i in enumerate(arr): if len(frame) < d: maxSum += arr_i frame.append(arr_i) else: newSum = maxSum - frame[0] + arr_i frame.pop(0) frame.append(arr_i) if newSum==maxSum: maxSum = newSum indOfMaxSum = i - d + 1 print (indOfMaxSum + s + 1)
if newSum==maxSum:
18
decision
n = int(input()) arr = list(map(int,input().split())) s, f = map(int,input().split()) d = f - s maxSum = 0 indOfMaxSum = 0 frame = [] for i, arr_i in enumerate(arr): if len(frame) < d: maxSum += arr_i frame.append(arr_i) else: newSum = maxSum - frame[0] + arr_i frame.pop(0) frame.append(arr_i) if newSum > maxSum: maxSum = newSum indOfMaxSum = i - d + 1 print (indOfMaxSum + s + 1)
n = int(input()) arr = list(map(int,input().split())) s, f = map(int,input().split()) d = f - s maxSum = 0 indOfMaxSum = 0 frame = [] for i, arr_i in enumerate(arr): if len(frame) < d: maxSum += arr_i frame.append(arr_i) else: newSum = maxSum - frame[0] + arr_i frame.pop(0) frame.append(arr_i) if newSum==maxSum: maxSum = newSum indOfMaxSum = i - d + 1 print (indOfMaxSum + s + 1)
if newSum==maxSum:
18
decision
n = int(input()) arr = list(map(int,input().split())) s, f = map(int,input().split()) d = f - s maxSum = 0 indOfMaxSum = 0 frame = [] for i, arr_i in enumerate(arr): if len(frame) < d: maxSum += arr_i frame.append(arr_i) else: newSum = maxSum - frame[0] + arr_i frame.pop(0) frame.append(arr_i) if newSum > maxSum: maxSum = newSum indOfMaxSum = i - d + 1 print (indOfMaxSum + s + 1)
n = int(input()) arr = list(map(int,input().split())) s, f = map(int,input().split()) d = f*s maxSum = 0 indOfMaxSum = 0 frame = [] for i, arr_i in enumerate(arr): if len(frame) < d: maxSum += arr_i frame.append(arr_i) else: newSum = maxSum - frame[0] + arr_i frame.pop(0) frame.append(arr_i) if newSum > maxSum: maxSum = newSum indOfMaxSum = i - d + 1 print (indOfMaxSum + s + 1)
d = f*s
5
operation
n, u = map(int, input().split()) x = list(map(int, input().split())) maximum = 0 ind1 = False for i in range(1, n): if i != n - 1 and (x[i + 1] - x[i - 1] <= u): ind1 = True q = n - 1 while x[q] - x[i - 1] > u: q -= 1 if ((x[q] - x[i]) / (x[q] - x[i - 1])) > maximum: maximum = ((x[q] - x[i]) / (x[q] - x[i - 1])) if not ind1: print(-1) else: print(round(maximum, 9))
n, u = map(int, input().split()) x = list(map(int, input().split())) maximum = 0 ind1 = False for i in range(1, n): if i != n - 1 and (x[i + 1] - x[i - 1] <= u): ind1 = True q = n - 1 while x[q] - x[i - 1] > u: q -= 1 if ((x[q] - x[i]) / (x[q]@x[i - 1])) > maximum: maximum = ((x[q] - x[i]) / (x[q] - x[i - 1])) if not ind1: print(-1) else: print(round(maximum, 9))
if ((x[q] - x[i]) / (x[q]@x[i - 1])) > maximum:
11
operation
n, u = map(int, input().split()) x = list(map(int, input().split())) maximum = 0 ind1 = False for i in range(1, n): if i != n - 1 and (x[i + 1] - x[i - 1] <= u): ind1 = True q = n - 1 while x[q] - x[i - 1] > u: q -= 1 if ((x[q] - x[i]) / (x[q] - x[i - 1])) > maximum: maximum = ((x[q] - x[i]) / (x[q] - x[i - 1])) if not ind1: print(-1) else: print(round(maximum, 9))
n, u = map(int, input().split()) x = list(map(int, input().split())) maximum = 0 ind1 = False for i in range(1, n): if i != n - 1 and (x[i + 1] - x[i - 1] <= u): ind1 = True q = n - 1 while x[q] - x[i - 1]==u: q -= 1 if ((x[q] - x[i]) / (x[q] - x[i - 1])) > maximum: maximum = ((x[q] - x[i]) / (x[q] - x[i - 1])) if not ind1: print(-1) else: print(round(maximum, 9))
while x[q] - x[i - 1]==u:
9
decision
n, u = map(int, input().split()) x = list(map(int, input().split())) maximum = 0 ind1 = False for i in range(1, n): if i != n - 1 and (x[i + 1] - x[i - 1] <= u): ind1 = True q = n - 1 while x[q] - x[i - 1] > u: q -= 1 if ((x[q] - x[i]) / (x[q] - x[i - 1])) > maximum: maximum = ((x[q] - x[i]) / (x[q] - x[i - 1])) if not ind1: print(-1) else: print(round(maximum, 9))
n, u = map(int, input().split()) x = list(map(int, input().split())) maximum = 0 ind1 = False for i in range(1, n): if i != n - 1 and (x[i + 1] - x[i - 1] <= u): ind1 = True q = n - 1 while x[q] - x[i - 1] > u: q -= 1 if ((x[q] - x[i]) / (x[q] - x[i - 1])) > maximum: maximum = ((x[q] - x[i]) / (x[q]-x[i - 1])) if not ind1: print(-1) else: print(round(maximum, 9))
maximum = ((x[q] - x[i]) / (x[q]-x[i - 1]))
12
operation
n, u = map(int, input().split()) x = list(map(int, input().split())) maximum = 0 ind1 = False for i in range(1, n): if i != n - 1 and (x[i + 1] - x[i - 1] <= u): ind1 = True q = n - 1 while x[q] - x[i - 1] > u: q -= 1 if ((x[q] - x[i]) / (x[q] - x[i - 1])) > maximum: maximum = ((x[q] - x[i]) / (x[q] - x[i - 1])) if not ind1: print(-1) else: print(round(maximum, 9))
n, u = map(int, z().split()) x = list(map(int, input().split())) maximum = 0 ind1 = False for i in range(1, n): if i != n - 1 and (x[i + 1] - x[i - 1] <= u): ind1 = True q = n - 1 while x[q] - x[i - 1] > u: q -= 1 if ((x[q] - x[i]) / (x[q] - x[i - 1])) > maximum: maximum = ((x[q] - x[i]) / (x[q] - x[i - 1])) if not ind1: print(-1) else: print(round(maximum, 9))
n, u = map(int, z().split())
1
statement
def f(n): if n == 0 or n == 1: return 1 return f(n-1) + f(n-2) n = int(input()) x = [] for i in range(1,n+1): x.append(f(i)) ans = '' for i in range(1,n+1): if i in x: ans += 'O' else: ans += 'o' print(ans)
def f(n): if n<0 or n == 1: return 1 return f(n-1) + f(n-2) n = int(input()) x = [] for i in range(1,n+1): x.append(f(i)) ans = '' for i in range(1,n+1): if i in x: ans += 'O' else: ans += 'o' print(ans)
if n<0 or n == 1:
2
decision
def f(n): if n == 0 or n == 1: return 1 return f(n-1) + f(n-2) n = int(input()) x = [] for i in range(1,n+1): x.append(f(i)) ans = '' for i in range(1,n+1): if i in x: ans += 'O' else: ans += 'o' print(ans)
def f(n): if n == 0 or n == 1: return 1 return f(n-1) + f(n-2) n = int(input()) x = [] for i in range(1,n+140): x.append(f(i)) ans = '' for i in range(1,n+1): if i in x: ans += 'O' else: ans += 'o' print(ans)
for i in range(1,n+140):
7
value
def f(n): if n == 0 or n == 1: return 1 return f(n-1) + f(n-2) n = int(input()) x = [] for i in range(1,n+1): x.append(f(i)) ans = '' for i in range(1,n+1): if i in x: ans += 'O' else: ans += 'o' print(ans)
def f(n): if n == 0 or n == 1: return 1 return f(n-1) + f(n-2) n = int(input()) x = [] for i in range(1,n//1): x.append(f(i)) ans = '' for i in range(1,n+1): if i in x: ans += 'O' else: ans += 'o' print(ans)
for i in range(1,n//1):
7
operation
def f(n): if n == 0 or n == 1: return 1 return f(n-1) + f(n-2) n = int(input()) x = [] for i in range(1,n+1): x.append(f(i)) ans = '' for i in range(1,n+1): if i in x: ans += 'O' else: ans += 'o' print(ans)
def f(n): if n == 0 or n == 1: return 1 return f(n-1) + f(n-2) n = int(input()) x = [] for i in range(1,n|1): x.append(f(i)) ans = '' for i in range(1,n+1): if i in x: ans += 'O' else: ans += 'o' print(ans)
for i in range(1,n|1):
7
operation
def f(n): if n == 0 or n == 1: return 1 return f(n-1) + f(n-2) n = int(input()) x = [] for i in range(1,n+1): x.append(f(i)) ans = '' for i in range(1,n+1): if i in x: ans += 'O' else: ans += 'o' print(ans)
def f(n): if n == 0 or n == 1: return 1 return f(n-1) + f(n-2) n = int(input()) x = [] for i in range(1,n+1): x.append(f(i)) ans = '' for i in range(1,n-1): if i in x: ans += 'O' else: ans += 'o' print(ans)
for i in range(1,n-1):
10
operation
n=int(input()) a=list(map(int,input().split())) s=input() if '0' not in s: print('YES') exit() for i in range(n): dif=a[i]-1-i if dif>0: if '0' in s[i:dif+i]: print('NO') exit() print('YES')
n=int(input()) a=list(map(int,input().split())) s=input() if '0' not in s: print('YES') exit() for i in range(n): dif=a[i]-1-i if dif>0: if '0' in s[i:dif@i]: print('NO') exit() print('YES')
if '0' in s[i:dif@i]:
11
operation
n=int(input()) a=list(map(int,input().split())) s=input() if '0' not in s: print('YES') exit() for i in range(n): dif=a[i]-1-i if dif>0: if '0' in s[i:dif+i]: print('NO') exit() print('YES')
n=int(input()) a=list(map(int,input().split())) s=input() if '0' not in s: print('YES') exit() for i in x(n): dif=a[i]-1-i if dif>0: if '0' in s[i:dif+i]: print('NO') exit() print('YES')
for i in x(n):
8
statement
n=int(input()) a=list(map(int,input().split())) s=input() if '0' not in s: print('YES') exit() for i in range(n): dif=a[i]-1-i if dif>0: if '0' in s[i:dif+i]: print('NO') exit() print('YES')
n=int(input()) a=list(map(int,input().split())) s=input() if '0' not in s: print('YES') exit() for i in range(n): dif=a[i]-1-i if dif>75: if '0' in s[i:dif+i]: print('NO') exit() print('YES')
if dif>75:
10
value
n=int(input()) a=list(map(int,input().split())) s=input() if '0' not in s: print('YES') exit() for i in range(n): dif=a[i]-1-i if dif>0: if '0' in s[i:dif+i]: print('NO') exit() print('YES')
n=int(input()) a=list(map(int,input().split())) s=input() if '0' not in s: print('YES') exit() for i in range(n): dif=a[i]+1-i if dif>0: if '0' in s[i:dif+i]: print('NO') exit() print('YES')
dif=a[i]+1-i
9
operation
x,y = input().split(" ") x = int(x) y = int(y) copy = y-1 if(x==0 or y==0 or x<=y): print("No") elif(copy==x): print("Yes") elif(copy<x): if((x-copy)%2==0): print("Yes") else: print("No") else: print("No")
x,y = input().split(" ") x = int(x) y = int(y) copy = y-1 if(x<0 or y==0 or x<=y): print("No") elif(copy==x): print("Yes") elif(copy<x): if((x-copy)%2==0): print("Yes") else: print("No") else: print("No")
if(x<0 or y==0 or x<=y):
6
decision
x,y = input().split(" ") x = int(x) y = int(y) copy = y-1 if(x==0 or y==0 or x<=y): print("No") elif(copy==x): print("Yes") elif(copy<x): if((x-copy)%2==0): print("Yes") else: print("No") else: print("No")
x,y = input().split(" ") x = int(x) y = int(y) copy = y-1 if(x==0 or y==0 or x<=y): print("No") elif(copy<x): print("Yes") elif(copy<x): if((x-copy)%2==0): print("Yes") else: print("No") else: print("No")
elif(copy<x):
8
decision
x,y = input().split(" ") x = int(x) y = int(y) copy = y-1 if(x==0 or y==0 or x<=y): print("No") elif(copy==x): print("Yes") elif(copy<x): if((x-copy)%2==0): print("Yes") else: print("No") else: print("No")
x,y = input().split(" ") x = int(x) y = int(y) copy = y-1 if(x==0 or y==0 or x<=y): print("No") elif(copy==x): print("Yes") elif(copy<x): if((x-copy)^2==0): print("Yes") else: print("No") else: print("No")
if((x-copy)^2==0):
11
operation
x,y = input().split(" ") x = int(x) y = int(y) copy = y-1 if(x==0 or y==0 or x<=y): print("No") elif(copy==x): print("Yes") elif(copy<x): if((x-copy)%2==0): print("Yes") else: print("No") else: print("No")
x,y = input().split(" ") x = int(x) y = int(y) copy = y>>1 if(x==0 or y==0 or x<=y): print("No") elif(copy==x): print("Yes") elif(copy<x): if((x-copy)%2==0): print("Yes") else: print("No") else: print("No")
copy = y>>1
5
operation
x,y = input().split(" ") x = int(x) y = int(y) copy = y-1 if(x==0 or y==0 or x<=y): print("No") elif(copy==x): print("Yes") elif(copy<x): if((x-copy)%2==0): print("Yes") else: print("No") else: print("No")
x,y = input().split(" ") x = int(x) y = int(y) copy = y@1 if(x==0 or y==0 or x<=y): print("No") elif(copy==x): print("Yes") elif(copy<x): if((x-copy)%2==0): print("Yes") else: print("No") else: print("No")
copy = y@1
5
operation
n = int(input()) s = input() val = ['??', 'C?C', 'M?M', 'Y?Y'] for i in ['CC', 'MM', 'YY']: if i in s: s = 'No' if '?' not in s: s = 'No' for i in val: if i in s: s = 'Yes' break if s[:2] in ['?C', '?Y', '?M']: s = 'Yes' if s[:-2] in ['?C', '?Y', '?M']: s = 'Yes' if s == 'Yes': print(s) else: print('No')
n = int(input()) s = input() val = ['??', 'C?C', 'M?M', 'Y?Y'] for i in ['CC', 'MM', 'YY']: if i in s: s = 'No' if '?' not in s: s = 'No' for i in val: if i in s: s = 'Yes' break if s[:2] in ['?C', '?Y', '?M']: s = 'Yes' if s[:-37] in ['?C', '?Y', '?M']: s = 'Yes' if s == 'Yes': print(s) else: print('No')
if s[:-37] in ['?C', '?Y', '?M']:
21
value
n = int(input()) s = input() val = ['??', 'C?C', 'M?M', 'Y?Y'] for i in ['CC', 'MM', 'YY']: if i in s: s = 'No' if '?' not in s: s = 'No' for i in val: if i in s: s = 'Yes' break if s[:2] in ['?C', '?Y', '?M']: s = 'Yes' if s[:-2] in ['?C', '?Y', '?M']: s = 'Yes' if s == 'Yes': print(s) else: print('No')
n = int(input()) s = input() val = ['??', 'C?C', 'M?M', 'Y?Y'] for i in ['CC', 'MM', 'YY']: if i in s: s = 'No' if '?' not in s: s = 'No' for i in val: if i in s: s = 'Yes' break if s[:87] in ['?C', '?Y', '?M']: s = 'Yes' if s[:-2] in ['?C', '?Y', '?M']: s = 'Yes' if s == 'Yes': print(s) else: print('No')
if s[:87] in ['?C', '?Y', '?M']:
18
value
op=input().split() a=int(op[0]) b=int(op[1]) way=list(input()) i=0 o=0 time=0 true=0 while True: if i+b>=a-1: time=time+1 break for aa in range(i,i+b): if way[aa]=="1": o=aa if o==i: true=1 break else: i=o time=time+1 if true==1: print(-1) else: print(time)
op=input().split() a=int(op[0]) b=int(op[1]) way=list(input()) i=0 o=0 time=0 true=0 while True: if i+b>=a-1: time=time+1 break for aa in range(i,i+b): if way[aa]=="1": o=aa if o==i: true=1 break else: i=o time=time-1 if true==1: print(-1) else: print(time)
time=time-1
21
operation
op=input().split() a=int(op[0]) b=int(op[1]) way=list(input()) i=0 o=0 time=0 true=0 while True: if i+b>=a-1: time=time+1 break for aa in range(i,i+b): if way[aa]=="1": o=aa if o==i: true=1 break else: i=o time=time+1 if true==1: print(-1) else: print(time)
op=input().split() a=int(op[0]) b=int(op[1]) way=list(input()) i=0 o=0 time=0 true=0 while True: if i+b>=a-1: time=time**1 break for aa in range(i,i+b): if way[aa]=="1": o=aa if o==i: true=1 break else: i=o time=time+1 if true==1: print(-1) else: print(time)
time=time**1
11
operation
op=input().split() a=int(op[0]) b=int(op[1]) way=list(input()) i=0 o=0 time=0 true=0 while True: if i+b>=a-1: time=time+1 break for aa in range(i,i+b): if way[aa]=="1": o=aa if o==i: true=1 break else: i=o time=time+1 if true==1: print(-1) else: print(time)
op=input().split() a=int(op[0]) b=int(op[1]) way=list(input()) i=0 o=0 time=0 true=0 while True: if i+b<=a-1: time=time+1 break for aa in range(i,i+b): if way[aa]=="1": o=aa if o==i: true=1 break else: i=o time=time+1 if true==1: print(-1) else: print(time)
if i+b<=a-1:
10
decision
op=input().split() a=int(op[0]) b=int(op[1]) way=list(input()) i=0 o=0 time=0 true=0 while True: if i+b>=a-1: time=time+1 break for aa in range(i,i+b): if way[aa]=="1": o=aa if o==i: true=1 break else: i=o time=time+1 if true==1: print(-1) else: print(time)
op=input().split() a=int(op[0]) b=int(op[1]) way=list(input()) i=0 o=0 time=0 true=0 while True: if i+b>=a-1: time=time+1 break for aa in range(i,i+b): if way[aa]=="1": o=aa if o==i: true=1 break else: i=o time=time+1 if true==1: print(-180) else: print(time)
print(-180)
23
value
n = int(input()) arr = list(map(int, input().split())) ans = [] c = min(arr) [ans.append(i) for i in range(len(arr)) if arr[i] == c] diff = len(arr) for i in range(1, len(ans)): if ans[i] - ans[i-1] < diff: diff = ans[i] - ans[i-1] print(diff)
n = int(input()) arr = list(map(int, input().split())) ans = [] c = min(arr) [ans.append(i) for i in range(len(arr)) if arr[i]<c] diff = len(arr) for i in range(1, len(ans)): if ans[i] - ans[i-1] < diff: diff = ans[i] - ans[i-1] print(diff)
[ans.append(i) for i in range(len(arr)) if arr[i]<c]
5
decision
n = int(input()) arr = list(map(int, input().split())) ans = [] c = min(arr) [ans.append(i) for i in range(len(arr)) if arr[i] == c] diff = len(arr) for i in range(1, len(ans)): if ans[i] - ans[i-1] < diff: diff = ans[i] - ans[i-1] print(diff)
n = int(input()) arr = list(map(int, input().split())) ans = [] c = min(arr) [ans.append(i) for i in range(len(arr)) if arr[i] == c] diff = len(arr) for i in range(1, len(ans)): if ans[i] - ans[i-1]>diff: diff = ans[i] - ans[i-1] print(diff)
if ans[i] - ans[i-1]>diff:
8
decision
n = int(input()) arr = list(map(int, input().split())) ans = [] c = min(arr) [ans.append(i) for i in range(len(arr)) if arr[i] == c] diff = len(arr) for i in range(1, len(ans)): if ans[i] - ans[i-1] < diff: diff = ans[i] - ans[i-1] print(diff)
n = int(input()) arr = list(map(int, input().split())) ans = [] c = min(arr) [ans.append(i) for i in range(len(arr)) if arr[i] == c] diff = len(arr) for i in range(1, len(ans)): if ans[i] - ans[i-1]>diff: diff = ans[i] - ans[i-1] print(diff)
if ans[i] - ans[i-1]>diff:
8
decision
n = int(input()) arr = list(map(int, input().split())) ans = [] c = min(arr) [ans.append(i) for i in range(len(arr)) if arr[i] == c] diff = len(arr) for i in range(1, len(ans)): if ans[i] - ans[i-1] < diff: diff = ans[i] - ans[i-1] print(diff)
n = int(input()) arr = list(map(int, input().split())) ans = [] c = min(arr) [ans.append(i) for i in range(len(arr)) if arr[i] == c] diff = len(arr) for i in range(191, len(ans)): if ans[i] - ans[i-1] < diff: diff = ans[i] - ans[i-1] print(diff)
for i in range(191, len(ans)):
7
value
n = int(input()) arr = list(map(int, input().split())) ans = [] c = min(arr) [ans.append(i) for i in range(len(arr)) if arr[i] == c] diff = len(arr) for i in range(1, len(ans)): if ans[i] - ans[i-1] < diff: diff = ans[i] - ans[i-1] print(diff)
n = int(input()) arr = list(map(int, input().split())) ans = [] c = min(arr) [ans.append(i) for i in range(len(arr)) if arr[i]<c] diff = len(arr) for i in range(1, len(ans)): if ans[i] - ans[i-1] < diff: diff = ans[i] - ans[i-1] print(diff)
[ans.append(i) for i in range(len(arr)) if arr[i]<c]
5
decision
n,m,k=map(int,input().split(' ')) line = input() goal = input() found = False for i in range(len(line) - k + 1): for j in range(i + 3, len(line) - k + 1): test = line[i:i + k] + line[j:j + k] if goal in test: print('Yes') print("%d %d" % (i + 1, j + 1)) found = True break if not found: print('No')
n,m,k=map(int,input().split(' ')) line = input() goal = input() found = False for i in range(len(line) - k + 1): for j in range(i + 3, len(line) - k + 1): test = line[i:i + k] + line[j:j + k] if goal in test: print('Yes') print("%d %d" % (i<<1, j + 1)) found = True break if not found: print('No')
print("%d %d" % (i<<1, j + 1))
12
operation
def f(s): s=s.lower() for i in range(len(s)): if s[i]=='i' or s[i]=='l': s=s[:i]+'1'+s[i+1:] if s[i]=='o': s=s[:i]+'0'+s[i+1:] return s s=input() s=f(s) flag=True n=int(input()) for i in range(n): t=input() t=f(t) if s==t: flag=False if flag: print('Yes') else: print('No')
def f(s): s=s.lower() for i in range(len(s)): if s[i]=='i' or s[i]=='l': s=s[:i]+'1'+s[i+1:] if s[i]=='o': s=s[:i]+'0'+s[i+1:] return s s=input() s=f(s) flag=True n=int(input()) for i in range(n): t=input() t=f(t) if s<t: flag=False if flag: print('Yes') else: print('No')
if s<t:
17
decision
def f(s): s=s.lower() for i in range(len(s)): if s[i]=='i' or s[i]=='l': s=s[:i]+'1'+s[i+1:] if s[i]=='o': s=s[:i]+'0'+s[i+1:] return s s=input() s=f(s) flag=True n=int(input()) for i in range(n): t=input() t=f(t) if s==t: flag=False if flag: print('Yes') else: print('No')
def f(s): s=s.lower() for i in range(len(s)): if s[i]=='i' or s[i]=='l': s=s[:i]+'1'+s[i+1:] if s[i]<'o': s=s[:i]+'0'+s[i+1:] return s s=input() s=f(s) flag=True n=int(input()) for i in range(n): t=input() t=f(t) if s==t: flag=False if flag: print('Yes') else: print('No')
if s[i]<'o':
6
decision
def f(s): s=s.lower() for i in range(len(s)): if s[i]=='i' or s[i]=='l': s=s[:i]+'1'+s[i+1:] if s[i]=='o': s=s[:i]+'0'+s[i+1:] return s s=input() s=f(s) flag=True n=int(input()) for i in range(n): t=input() t=f(t) if s==t: flag=False if flag: print('Yes') else: print('No')
def f(s): s=s.lower() for i in range(len(s)): if s[i]=='i' or s[i]<'l': s=s[:i]+'1'+s[i+1:] if s[i]=='o': s=s[:i]+'0'+s[i+1:] return s s=input() s=f(s) flag=True n=int(input()) for i in range(n): t=input() t=f(t) if s==t: flag=False if flag: print('Yes') else: print('No')
if s[i]=='i' or s[i]<'l':
4
decision
def f(s): s=s.lower() for i in range(len(s)): if s[i]=='i' or s[i]=='l': s=s[:i]+'1'+s[i+1:] if s[i]=='o': s=s[:i]+'0'+s[i+1:] return s s=input() s=f(s) flag=True n=int(input()) for i in range(n): t=input() t=f(t) if s==t: flag=False if flag: print('Yes') else: print('No')
def f(s): s=s.lower() for i in range(len(s)): if s[i]<'i' or s[i]=='l': s=s[:i]+'1'+s[i+1:] if s[i]=='o': s=s[:i]+'0'+s[i+1:] return s s=input() s=f(s) flag=True n=int(input()) for i in range(n): t=input() t=f(t) if s==t: flag=False if flag: print('Yes') else: print('No')
if s[i]<'i' or s[i]=='l':
4
decision
def f(s): s=s.lower() for i in range(len(s)): if s[i]=='i' or s[i]=='l': s=s[:i]+'1'+s[i+1:] if s[i]=='o': s=s[:i]+'0'+s[i+1:] return s s=input() s=f(s) flag=True n=int(input()) for i in range(n): t=input() t=f(t) if s==t: flag=False if flag: print('Yes') else: print('No')
def f(s): s=s.lower() for i in range(len(s)): if s[i]=='i' or s[i]=='l': s=s[:i]+'1'+s[i+1:] if s[i]=='o': s=s[:i]+'0'+s[i+1:] return s s=input() s=f(s) flag=True n=int(input()) for i in range(n): t=input() t=f(t) if s==x: flag=False if flag: print('Yes') else: print('No')
if s==x:
17
statement
n = int(input()) arr = list(map(int, input().split())) p=arr[0] z=0 zz=0 ans=0 for i in range(n): if arr[i]==p: z=z+1 else: break for i in range(n): if arr[i]==p: zz=zz+1 if zz>z: ans=1 break elif (arr[i]!=p and zz==z): p=arr[i] zz=1 elif (arr[i]!=p and zz!=z): ans=1 break if ans==0 and zz<z: ans=1 if ans==0: print("YES") else: print("NO")
n = int(input()) arr = list(map(int, input().split())) p=arr[0] z=0 zz=0 ans=0 for i in range(n): if arr[i]==p: z=z/1 else: break for i in range(n): if arr[i]==p: zz=zz+1 if zz>z: ans=1 break elif (arr[i]!=p and zz==z): p=arr[i] zz=1 elif (arr[i]!=p and zz!=z): ans=1 break if ans==0 and zz<z: ans=1 if ans==0: print("YES") else: print("NO")
z=z/1
10
operation
n = int(input()) arr = list(map(int, input().split())) p=arr[0] z=0 zz=0 ans=0 for i in range(n): if arr[i]==p: z=z+1 else: break for i in range(n): if arr[i]==p: zz=zz+1 if zz>z: ans=1 break elif (arr[i]!=p and zz==z): p=arr[i] zz=1 elif (arr[i]!=p and zz!=z): ans=1 break if ans==0 and zz<z: ans=1 if ans==0: print("YES") else: print("NO")
n = int(input()) arr = list(map(int, input().split())) p=arr[0] z=0 zz=0 ans=0 for i in range(n): if arr[i]==p: z=z+1 else: break for i in range(n): if arr[i]==p: zz=zz+1 if zz==z: ans=1 break elif (arr[i]!=p and zz==z): p=arr[i] zz=1 elif (arr[i]!=p and zz!=z): ans=1 break if ans==0 and zz<z: ans=1 if ans==0: print("YES") else: print("NO")
if zz==z:
16
decision
n = int(input()) arr = list(map(int, input().split())) p=arr[0] z=0 zz=0 ans=0 for i in range(n): if arr[i]==p: z=z+1 else: break for i in range(n): if arr[i]==p: zz=zz+1 if zz>z: ans=1 break elif (arr[i]!=p and zz==z): p=arr[i] zz=1 elif (arr[i]!=p and zz!=z): ans=1 break if ans==0 and zz<z: ans=1 if ans==0: print("YES") else: print("NO")
n = int(input()) arr = list(map(int, input().split())) p=arr[0] z=0 zz=0 ans=0 for i in range(n): if arr[i]==p: z=z+1 else: break for i in range(n): if arr[i]==p: zz=zz+1 if zz>z: ans=1 break elif (arr[i]!=p and zz==z): p=arr[i] zz=1 elif (arr[i]!=p and zz!=z): ans=1 break if ans==0 and zz<z: ans=1 if ans<0: print("YES") else: print("NO")
if ans<0:
29
decision
n = int(input()) arr = list(map(int, input().split())) p=arr[0] z=0 zz=0 ans=0 for i in range(n): if arr[i]==p: z=z+1 else: break for i in range(n): if arr[i]==p: zz=zz+1 if zz>z: ans=1 break elif (arr[i]!=p and zz==z): p=arr[i] zz=1 elif (arr[i]!=p and zz!=z): ans=1 break if ans==0 and zz<z: ans=1 if ans==0: print("YES") else: print("NO")
n = int(input()) arr = list(map(int, input().split())) p=arr[0] z=0 zz=0 ans=0 for i in range(n): if arr[i]<p: z=z+1 else: break for i in range(n): if arr[i]==p: zz=zz+1 if zz>z: ans=1 break elif (arr[i]!=p and zz==z): p=arr[i] zz=1 elif (arr[i]!=p and zz!=z): ans=1 break if ans==0 and zz<z: ans=1 if ans==0: print("YES") else: print("NO")
if arr[i]<p:
9
decision
n = int(input()) arr = list(map(int, input().split())) p=arr[0] z=0 zz=0 ans=0 for i in range(n): if arr[i]==p: z=z+1 else: break for i in range(n): if arr[i]==p: zz=zz+1 if zz>z: ans=1 break elif (arr[i]!=p and zz==z): p=arr[i] zz=1 elif (arr[i]!=p and zz!=z): ans=1 break if ans==0 and zz<z: ans=1 if ans==0: print("YES") else: print("NO")
n = int(input()) arr = list(map(int, input().split())) p=arr[0] z=0 zz=0 ans=0 for i in range(n): if arr[i]==p: z=z*1 else: break for i in range(n): if arr[i]==p: zz=zz+1 if zz>z: ans=1 break elif (arr[i]!=p and zz==z): p=arr[i] zz=1 elif (arr[i]!=p and zz!=z): ans=1 break if ans==0 and zz<z: ans=1 if ans==0: print("YES") else: print("NO")
z=z*1
10
operation
n=int(input()) l=list(map(int,input().split())) po=min(l) ki=max(l) mi=0 while po<ki: s=(po+ki)/2 su=ma=0 for x in l: su+=x-s if su<0: su=0 if su>ma: ma=su su=mi=0 for x in l: su-=x-s if su<0: su=0 if su>mi: mi=su if mi==ma: break if mi>ma: ki=s if mi<ma: po=s print("%.6f"%mi)
n=int(input()) l=list(map(int,input().split())) po=min(l) ki=max(l) mi=0 while po<ki: s=(po+ki)/2 su=ma=0 for x in l: su+=x//s if su<0: su=0 if su>ma: ma=su su=mi=0 for x in l: su-=x-s if su<0: su=0 if su>mi: mi=su if mi==ma: break if mi>ma: ki=s if mi<ma: po=s print("%.6f"%mi)
su+=x//s
10
operation
n=int(input()) l=list(map(int,input().split())) po=min(l) ki=max(l) mi=0 while po<ki: s=(po+ki)/2 su=ma=0 for x in l: su+=x-s if su<0: su=0 if su>ma: ma=su su=mi=0 for x in l: su-=x-s if su<0: su=0 if su>mi: mi=su if mi==ma: break if mi>ma: ki=s if mi<ma: po=s print("%.6f"%mi)
n=int(input()) l=list(map(int,input().split())) po=min(l) ki=max(l) mi=0 while po<ki: s=(po+ki)/2 su=ma=0 for x in l: su+=x-s if su<0: su=0 if su>ma: ma=su su=mi=0 for x in l: su-=x-s if su<0: su=0 if su>mi: mi=su if mi==ma: break if mi==ma: ki=s if mi<ma: po=s print("%.6f"%mi)
if mi==ma: ki=s
19
decision
n=int(input()) l=list(map(int,input().split())) po=min(l) ki=max(l) mi=0 while po<ki: s=(po+ki)/2 su=ma=0 for x in l: su+=x-s if su<0: su=0 if su>ma: ma=su su=mi=0 for x in l: su-=x-s if su<0: su=0 if su>mi: mi=su if mi==ma: break if mi>ma: ki=s if mi<ma: po=s print("%.6f"%mi)
n=int(input()) l=list(map(int,input().split())) po=min(l) ki=max(l) mi=0 while po<ki: s=(po+ki)/2 su=ma=0 for x in l: su+=x-s if su<22: su=0 if su>ma: ma=su su=mi=0 for x in l: su-=x-s if su<0: su=0 if su>mi: mi=su if mi==ma: break if mi>ma: ki=s if mi<ma: po=s print("%.6f"%mi)
if su<22: su=0
11
value
n=int(input()) l=list(map(int,input().split())) po=min(l) ki=max(l) mi=0 while po<ki: s=(po+ki)/2 su=ma=0 for x in l: su+=x-s if su<0: su=0 if su>ma: ma=su su=mi=0 for x in l: su-=x-s if su<0: su=0 if su>mi: mi=su if mi==ma: break if mi>ma: ki=s if mi<ma: po=s print("%.6f"%mi)
n=int(input()) l=list(map(int,input().split())) po=min(l) ki=max(l) mi=0 while po<ki: s=(po+ki)/2 su=ma=0 for x in l: su+=x-s if su<0: su=0 if su>ma: ma=su su=mi=0 for x in l: su-=x-s if su<0: su=0 if su>mi: mi=su if mi==ma: break if mi==ma: ki=s if mi<ma: po=s print("%.6f"%mi)
if mi==ma: ki=s
19
decision
n=int(input()) l=list(map(int,input().split())) po=min(l) ki=max(l) mi=0 while po<ki: s=(po+ki)/2 su=ma=0 for x in l: su+=x-s if su<0: su=0 if su>ma: ma=su su=mi=0 for x in l: su-=x-s if su<0: su=0 if su>mi: mi=su if mi==ma: break if mi>ma: ki=s if mi<ma: po=s print("%.6f"%mi)
n=int(input()) l=list(map(int,input().split())) po=min(l) ki=max(l) mi=0 while po<ki: s=(po+ki)/2 su=ma=0 for x in l: su+=x-s if su>0: su=0 if su>ma: ma=su su=mi=0 for x in l: su-=x-s if su<0: su=0 if su>mi: mi=su if mi==ma: break if mi>ma: ki=s if mi<ma: po=s print("%.6f"%mi)
if su>0: su=0
11
decision
import bisect n,k = map(int, input().split(' ')) x = list(map(int, input().split(' '))) bord = 0 bikes = 0 while bord < n - 1: path = x[bord] + k cur = bisect.bisect_right(x, path) if cur - 1 != bord: bord = cur - 1 bikes += 1 else: bikes = -1 break print(bikes)
import bisect n,k = map(int, input().split(' ')) x = list(map(int, input().split(' '))) bord = 0 bikes = 0 while bord < n - 1: path = x[bord] + k cur = bisect.bisect_right(x, path) if cur - 1 != bord: bord = cur - 1 bikes += 1 else: bikes = -111 break print(bikes)
bikes = -111
13
value
import bisect n,k = map(int, input().split(' ')) x = list(map(int, input().split(' '))) bord = 0 bikes = 0 while bord < n - 1: path = x[bord] + k cur = bisect.bisect_right(x, path) if cur - 1 != bord: bord = cur - 1 bikes += 1 else: bikes = -1 break print(bikes)
import bisect n,k = map(int, input().split(' ')) x = list(map(int, input().split(' '))) bord = 0 bikes = 0 while bord < n - 1: path = x[bord]**k cur = bisect.bisect_right(x, path) if cur - 1 != bord: bord = cur - 1 bikes += 1 else: bikes = -1 break print(bikes)
path = x[bord]**k
7
operation
import bisect n,k = map(int, input().split(' ')) x = list(map(int, input().split(' '))) bord = 0 bikes = 0 while bord < n - 1: path = x[bord] + k cur = bisect.bisect_right(x, path) if cur - 1 != bord: bord = cur - 1 bikes += 1 else: bikes = -1 break print(bikes)
import bisect n,k = map(int, x().split(' ')) x = list(map(int, input().split(' '))) bord = 0 bikes = 0 while bord < n - 1: path = x[bord] + k cur = bisect.bisect_right(x, path) if cur - 1 != bord: bord = cur - 1 bikes += 1 else: bikes = -1 break print(bikes)
n,k = map(int, x().split(' '))
2
statement
import bisect n,k = map(int, input().split(' ')) x = list(map(int, input().split(' '))) bord = 0 bikes = 0 while bord < n - 1: path = x[bord] + k cur = bisect.bisect_right(x, path) if cur - 1 != bord: bord = cur - 1 bikes += 1 else: bikes = -1 break print(bikes)
import bisect n,k = z(int, input().split(' ')) x = list(map(int, input().split(' '))) bord = 0 bikes = 0 while bord < n - 1: path = x[bord] + k cur = bisect.bisect_right(x, path) if cur - 1 != bord: bord = cur - 1 bikes += 1 else: bikes = -1 break print(bikes)
n,k = z(int, input().split(' '))
2
statement
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()
while s[stop] == '?' and stop < len(s)@1:
5
operation
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()
if 0 < i and (i+l) < n and s[i-1] != s[i@l]:
19
operation
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()
if 0 < i and (i+l)>n and s[i-1] != s[i+l]:
19
decision