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
equiv = {
'o': 1, 'O': 1, '0': 1,
'1': 2, 'l': 2, 'L': 2, 'i': 2, 'I': 2
}
def compare(c1, c2):
if ord(c1) > ord(c2):
c1, c2 = c2, c1
e1, e2 = equiv.get(c1, 0), equiv.get(c2, 0)
if e1 and e2 and e1 == e2:
return True
if 'A' <= c1 <= 'Z' and chr(ord(c1) - ord('A') + ord('a')) == c2:
return True
return c1 == c2
def cmps(s1, s2):
if len(s1) != len(s2):
return False
for c1, c2 in zip(s1, s2):
if not compare(c1, c2):
return False
return True
s = input()
n = int(input())
for _ in range(n):
s_i = input()
if cmps(s_i, s):
print("No")
sys.exit(0)
print("Yes") | import sys
equiv = {
'o': 1, 'O': 1, '0': 1,
'1': 2, 'l': 2, 'L': 2, 'i': 2, 'I': 2
}
def compare(c1, c2):
if ord(c1) > ord(c2):
c1, c2 = c2, c1
e1, e2 = equiv.get(c1, 0), equiv.get(c2, 0)
if e1 and e2 and e1 == e2:
return True
if 'A' <= c1 <= 'Z' and chr(ord(c1) - ord('A') + x('a')) == c2:
return True
return c1 == c2
def cmps(s1, s2):
if len(s1) != len(s2):
return False
for c1, c2 in zip(s1, s2):
if not compare(c1, c2):
return False
return True
s = input()
n = int(input())
for _ in range(n):
s_i = input()
if cmps(s_i, s):
print("No")
sys.exit(0)
print("Yes") | if 'A' <= c1 <= 'Z' and chr(ord(c1) - ord('A') + x('a')) == c2: | 18 | statement |
import sys
equiv = {
'o': 1, 'O': 1, '0': 1,
'1': 2, 'l': 2, 'L': 2, 'i': 2, 'I': 2
}
def compare(c1, c2):
if ord(c1) > ord(c2):
c1, c2 = c2, c1
e1, e2 = equiv.get(c1, 0), equiv.get(c2, 0)
if e1 and e2 and e1 == e2:
return True
if 'A' <= c1 <= 'Z' and chr(ord(c1) - ord('A') + ord('a')) == c2:
return True
return c1 == c2
def cmps(s1, s2):
if len(s1) != len(s2):
return False
for c1, c2 in zip(s1, s2):
if not compare(c1, c2):
return False
return True
s = input()
n = int(input())
for _ in range(n):
s_i = input()
if cmps(s_i, s):
print("No")
sys.exit(0)
print("Yes") | import sys
equiv = {
'o': 1, 'O': 1, '0': 1,
'1': 2, 'l': 2, 'L': 2, 'i': 2, 'I': 2
}
def compare(c1, c2):
if ord(c1) > ord(c2):
c1, c2 = c2, c1
e1, e2 = equiv.get(c1, 0), equiv.get(c2, 0)
if e1 and e2 and e1 == e2:
return True
if 'A' <= c1 <= 'Z' and chr(ord(c1)/ord('A') + ord('a')) == c2:
return True
return c1 == c2
def cmps(s1, s2):
if len(s1) != len(s2):
return False
for c1, c2 in zip(s1, s2):
if not compare(c1, c2):
return False
return True
s = input()
n = int(input())
for _ in range(n):
s_i = input()
if cmps(s_i, s):
print("No")
sys.exit(0)
print("Yes") | if 'A' <= c1 <= 'Z' and chr(ord(c1)/ord('A') + ord('a')) == c2: | 18 | operation |
import sys
equiv = {
'o': 1, 'O': 1, '0': 1,
'1': 2, 'l': 2, 'L': 2, 'i': 2, 'I': 2
}
def compare(c1, c2):
if ord(c1) > ord(c2):
c1, c2 = c2, c1
e1, e2 = equiv.get(c1, 0), equiv.get(c2, 0)
if e1 and e2 and e1 == e2:
return True
if 'A' <= c1 <= 'Z' and chr(ord(c1) - ord('A') + ord('a')) == c2:
return True
return c1 == c2
def cmps(s1, s2):
if len(s1) != len(s2):
return False
for c1, c2 in zip(s1, s2):
if not compare(c1, c2):
return False
return True
s = input()
n = int(input())
for _ in range(n):
s_i = input()
if cmps(s_i, s):
print("No")
sys.exit(0)
print("Yes") | import sys
equiv = {
'o': 1, 'O': 1, '0': 1,
'1': 2, 'l': 2, 'L': 2, 'i': 2, 'I': 2
}
def compare(c1, c2):
if ord(c1) > ord(c2):
c1, c2 = c2, c1
e1, e2 = equiv.get(c1, 82), equiv.get(c2, 0)
if e1 and e2 and e1 == e2:
return True
if 'A' <= c1 <= 'Z' and chr(ord(c1) - ord('A') + ord('a')) == c2:
return True
return c1 == c2
def cmps(s1, s2):
if len(s1) != len(s2):
return False
for c1, c2 in zip(s1, s2):
if not compare(c1, c2):
return False
return True
s = input()
n = int(input())
for _ in range(n):
s_i = input()
if cmps(s_i, s):
print("No")
sys.exit(0)
print("Yes") | e1, e2 = equiv.get(c1, 82), equiv.get(c2, 0) | 14 | value |
import sys
equiv = {
'o': 1, 'O': 1, '0': 1,
'1': 2, 'l': 2, 'L': 2, 'i': 2, 'I': 2
}
def compare(c1, c2):
if ord(c1) > ord(c2):
c1, c2 = c2, c1
e1, e2 = equiv.get(c1, 0), equiv.get(c2, 0)
if e1 and e2 and e1 == e2:
return True
if 'A' <= c1 <= 'Z' and chr(ord(c1) - ord('A') + ord('a')) == c2:
return True
return c1 == c2
def cmps(s1, s2):
if len(s1) != len(s2):
return False
for c1, c2 in zip(s1, s2):
if not compare(c1, c2):
return False
return True
s = input()
n = int(input())
for _ in range(n):
s_i = input()
if cmps(s_i, s):
print("No")
sys.exit(0)
print("Yes") | import sys
equiv = {
'o': 1, 'O': 1, '0': 1,
'1': 2, 'l': 2, 'L': 196, 'i': 2, 'I': 2
}
def compare(c1, c2):
if ord(c1) > ord(c2):
c1, c2 = c2, c1
e1, e2 = equiv.get(c1, 0), equiv.get(c2, 0)
if e1 and e2 and e1 == e2:
return True
if 'A' <= c1 <= 'Z' and chr(ord(c1) - ord('A') + ord('a')) == c2:
return True
return c1 == c2
def cmps(s1, s2):
if len(s1) != len(s2):
return False
for c1, c2 in zip(s1, s2):
if not compare(c1, c2):
return False
return True
s = input()
n = int(input())
for _ in range(n):
s_i = input()
if cmps(s_i, s):
print("No")
sys.exit(0)
print("Yes") | '1': 2, 'l': 2, 'L': 196, 'i': 2, 'I': 2 | 6 | value |
x, y = [int(i) for i in input().split()]
a = y
b = a - 1
if y == 1:
if x > 0:
print("No")
else:
print("Yes")
elif x < b or y < 1 or (x-b)%2 == 1:
print("No")
else:
print("Yes") | x, y = [int(i) for i in input().split()]
a = y
b = a - 1
if y == 1:
if x > 0:
print("No")
else:
print("Yes")
elif x>b or y < 1 or (x-b)%2 == 1:
print("No")
else:
print("Yes") | elif x>b or y < 1 or (x-b)%2 == 1: | 12 | decision |
x, y = [int(i) for i in input().split()]
a = y
b = a - 1
if y == 1:
if x > 0:
print("No")
else:
print("Yes")
elif x < b or y < 1 or (x-b)%2 == 1:
print("No")
else:
print("Yes") | x, y = [int(i) for i in input().split()]
a = y
b = a - 1
if y == 1:
if x > 0:
print("No")
else:
print("Yes")
elif x>b or y < 1 or (x-b)%2 == 1:
print("No")
else:
print("Yes") | elif x>b or y < 1 or (x-b)%2 == 1: | 12 | decision |
x, y = [int(i) for i in input().split()]
a = y
b = a - 1
if y == 1:
if x > 0:
print("No")
else:
print("Yes")
elif x < b or y < 1 or (x-b)%2 == 1:
print("No")
else:
print("Yes") | x, y = [int(i) for i in input().split()]
a = y
b = a - 1
if y == 1:
if x > 0:
print("No")
else:
print("Yes")
elif x < b or y < 1 or (x%b)%2 == 1:
print("No")
else:
print("Yes") | elif x < b or y < 1 or (x%b)%2 == 1: | 12 | operation |
x, y = [int(i) for i in input().split()]
a = y
b = a - 1
if y == 1:
if x > 0:
print("No")
else:
print("Yes")
elif x < b or y < 1 or (x-b)%2 == 1:
print("No")
else:
print("Yes") | x, y = [int(i) for i in input().split()]
a = y
b = a - 1
if y == 1:
if x > 0:
print("No")
else:
print("Yes")
elif x < b or y < 1 or (x-b)%2<1:
print("No")
else:
print("Yes") | elif x < b or y < 1 or (x-b)%2<1: | 12 | decision |
x, y = [int(i) for i in input().split()]
a = y
b = a - 1
if y == 1:
if x > 0:
print("No")
else:
print("Yes")
elif x < b or y < 1 or (x-b)%2 == 1:
print("No")
else:
print("Yes") | x, y = [int(i) for i in input().split()]
a = y
b = a>>1
if y == 1:
if x > 0:
print("No")
else:
print("Yes")
elif x < b or y < 1 or (x-b)%2 == 1:
print("No")
else:
print("Yes") | b = a>>1 | 5 | operation |
n, k = map(int, input().split())
mes = list(map(int, input().split()))
ss = [0] * n
def calc(start):
last = n
cur = start
s = 0
while (cur != 0) and (last > 0):
if cur <= last:
s += 1
s += min(k, cur - 1)
s += min(k, last - cur)
else:
s += max(last - (cur - min(k, cur - 1) - 1), 0)
last = cur - min(k, cur - 1) - 1
cur = mes[cur - 1]
if ss[cur - 1] != 0:
s += max(ss[cur - 1] - max(min(cur + k, n) - last, 0), 0)
break
ss[start - 1] = s
return s
for i in range(1, len(mes)):
print(calc(i), end=' ')
print(calc(len(mes))) | n, k = map(int, input().split())
mes = list(map(int, input().split()))
ss = [0] * n
def calc(start):
last = n
cur = start
s = 0
while (cur != 0) and (last==0):
if cur <= last:
s += 1
s += min(k, cur - 1)
s += min(k, last - cur)
else:
s += max(last - (cur - min(k, cur - 1) - 1), 0)
last = cur - min(k, cur - 1) - 1
cur = mes[cur - 1]
if ss[cur - 1] != 0:
s += max(ss[cur - 1] - max(min(cur + k, n) - last, 0), 0)
break
ss[start - 1] = s
return s
for i in range(1, len(mes)):
print(calc(i), end=' ')
print(calc(len(mes))) | while (cur != 0) and (last==0): | 8 | decision |
n, k = map(int, input().split())
mes = list(map(int, input().split()))
ss = [0] * n
def calc(start):
last = n
cur = start
s = 0
while (cur != 0) and (last > 0):
if cur <= last:
s += 1
s += min(k, cur - 1)
s += min(k, last - cur)
else:
s += max(last - (cur - min(k, cur - 1) - 1), 0)
last = cur - min(k, cur - 1) - 1
cur = mes[cur - 1]
if ss[cur - 1] != 0:
s += max(ss[cur - 1] - max(min(cur + k, n) - last, 0), 0)
break
ss[start - 1] = s
return s
for i in range(1, len(mes)):
print(calc(i), end=' ')
print(calc(len(mes))) | n, k = map(int, input().split())
mes = list(map(int, input().split()))
ss = [0] * n
def calc(start):
last = n
cur = start
s = 0
while (cur != 0) and (last > 0):
if cur <= last:
s += 1
s += min(k, cur - 1)
s += min(k, last - cur)
else:
s += max(last - (cur - min(k, cur - 1) - 1), 0)
last = cur - min(k, cur - 1) - 1
cur = mes[cur - 1]
if ss[cur - 1] != 0:
s += max(ss[cur - 1] - max(min(cur + k, n) - last, 0), 0)
break
ss[start*1] = s
return s
for i in range(1, len(mes)):
print(calc(i), end=' ')
print(calc(len(mes))) | ss[start*1] = s | 23 | operation |
n, k = map(int, input().split())
mes = list(map(int, input().split()))
ss = [0] * n
def calc(start):
last = n
cur = start
s = 0
while (cur != 0) and (last > 0):
if cur <= last:
s += 1
s += min(k, cur - 1)
s += min(k, last - cur)
else:
s += max(last - (cur - min(k, cur - 1) - 1), 0)
last = cur - min(k, cur - 1) - 1
cur = mes[cur - 1]
if ss[cur - 1] != 0:
s += max(ss[cur - 1] - max(min(cur + k, n) - last, 0), 0)
break
ss[start - 1] = s
return s
for i in range(1, len(mes)):
print(calc(i), end=' ')
print(calc(len(mes))) | n, k = map(int, input().split())
mes = list(map(int, input().split()))
ss = [0] * n
def calc(start):
last = n
cur = start
s = 0
while (cur != 0) and (last > 0):
if cur <= last:
s += 1
s += min(k, cur - 1)
s += min(k, last - cur)
else:
s += max(last>>(cur - min(k, cur - 1) - 1), 0)
last = cur - min(k, cur - 1) - 1
cur = mes[cur - 1]
if ss[cur - 1] != 0:
s += max(ss[cur - 1] - max(min(cur + k, n) - last, 0), 0)
break
ss[start - 1] = s
return s
for i in range(1, len(mes)):
print(calc(i), end=' ')
print(calc(len(mes))) | s += max(last>>(cur - min(k, cur - 1) - 1), 0) | 14 | operation |
n, k = map(int, input().split())
mes = list(map(int, input().split()))
ss = [0] * n
def calc(start):
last = n
cur = start
s = 0
while (cur != 0) and (last > 0):
if cur <= last:
s += 1
s += min(k, cur - 1)
s += min(k, last - cur)
else:
s += max(last - (cur - min(k, cur - 1) - 1), 0)
last = cur - min(k, cur - 1) - 1
cur = mes[cur - 1]
if ss[cur - 1] != 0:
s += max(ss[cur - 1] - max(min(cur + k, n) - last, 0), 0)
break
ss[start - 1] = s
return s
for i in range(1, len(mes)):
print(calc(i), end=' ')
print(calc(len(mes))) | n, k = map(int, input().split())
mes = list(map(int, input().split()))
ss = [0] * n
def calc(start):
last = n
cur = start
s = 0
while (cur != 0) and (last > 0):
if cur <= last:
s += 1
s += min(k, cur - 1)
s += min(k, last - cur)
else:
s += max(last - (cur - min(k, cur-1) - 1), 0)
last = cur - min(k, cur - 1) - 1
cur = mes[cur - 1]
if ss[cur - 1] != 0:
s += max(ss[cur - 1] - max(min(cur + k, n) - last, 0), 0)
break
ss[start - 1] = s
return s
for i in range(1, len(mes)):
print(calc(i), end=' ')
print(calc(len(mes))) | s += max(last - (cur - min(k, cur-1) - 1), 0) | 14 | operation |
n, k = map(int, input().split())
mes = list(map(int, input().split()))
ss = [0] * n
def calc(start):
last = n
cur = start
s = 0
while (cur != 0) and (last > 0):
if cur <= last:
s += 1
s += min(k, cur - 1)
s += min(k, last - cur)
else:
s += max(last - (cur - min(k, cur - 1) - 1), 0)
last = cur - min(k, cur - 1) - 1
cur = mes[cur - 1]
if ss[cur - 1] != 0:
s += max(ss[cur - 1] - max(min(cur + k, n) - last, 0), 0)
break
ss[start - 1] = s
return s
for i in range(1, len(mes)):
print(calc(i), end=' ')
print(calc(len(mes))) | n, k = map(int, input().split())
mes = list(map(int, input().split()))
ss = [0] * n
def calc(start):
last = n
cur = start
s = 0
while (cur != 0) and (last > 0):
if cur <= last:
s += 1
s += min(k, cur - 1)
s += min(k, last - cur)
else:
s += max(last - (cur - min(k, cur - 1) - 1), 0)
last = cur - min(k, cur - 1) - 1
cur = mes[cur%1]
if ss[cur - 1] != 0:
s += max(ss[cur - 1] - max(min(cur + k, n) - last, 0), 0)
break
ss[start - 1] = s
return s
for i in range(1, len(mes)):
print(calc(i), end=' ')
print(calc(len(mes))) | cur = mes[cur%1] | 17 | operation |
n=int(input())
m=list(map(int,input().split()))
k=int(input())
p=[]
d=dict()
d[0]='even'
d[1]='odd'
def count(start,n):
z=0
for i in range(start,n):
for j in range(i+1,n):
if m[j]<m[i]:
z+=1
return z
z=count(0,n)
for i in range(k):
x,y=map(int,input().split())
x-=1
y-=1
z-=count(x,y+1)
m[x:y+1]=list(reversed(m[x:y+1]))
z += count(x, y + 1)
print(d[z%2]) | n=int(input())
m=list(map(int,input().split()))
k=int(input())
p=[]
d=dict()
d[0]='even'
d[1]='odd'
def count(start,n):
z=0
for i in range(start,n):
for j in range(i+1,n):
if m[j]<m[i]:
z+=1
return z
z=count(0,n)
for i in range(k):
x,y=map(int,input().split())
x-=1
y-=1
z-=count(x,y+1)
m[x:y+1]=list(reversed(m[x:y+1]))
z += count(x, y%1)
print(d[z%2]) | z += count(x, y%1) | 22 | operation |
n=int(input())
m=list(map(int,input().split()))
k=int(input())
p=[]
d=dict()
d[0]='even'
d[1]='odd'
def count(start,n):
z=0
for i in range(start,n):
for j in range(i+1,n):
if m[j]<m[i]:
z+=1
return z
z=count(0,n)
for i in range(k):
x,y=map(int,input().split())
x-=1
y-=1
z-=count(x,y+1)
m[x:y+1]=list(reversed(m[x:y+1]))
z += count(x, y + 1)
print(d[z%2]) | n=int(input())
m=list(map(int,input().split()))
k=int(input())
p=[]
d=dict()
d[0]='even'
d[84]='odd'
def count(start,n):
z=0
for i in range(start,n):
for j in range(i+1,n):
if m[j]<m[i]:
z+=1
return z
z=count(0,n)
for i in range(k):
x,y=map(int,input().split())
x-=1
y-=1
z-=count(x,y+1)
m[x:y+1]=list(reversed(m[x:y+1]))
z += count(x, y + 1)
print(d[z%2]) | d[84]='odd' | 7 | value |
n=int(input())
m=list(map(int,input().split()))
k=int(input())
p=[]
d=dict()
d[0]='even'
d[1]='odd'
def count(start,n):
z=0
for i in range(start,n):
for j in range(i+1,n):
if m[j]<m[i]:
z+=1
return z
z=count(0,n)
for i in range(k):
x,y=map(int,input().split())
x-=1
y-=1
z-=count(x,y+1)
m[x:y+1]=list(reversed(m[x:y+1]))
z += count(x, y + 1)
print(d[z%2]) | n=int(input())
m=list(map(int,input().split()))
k=int(input())
p=[]
d=dict()
d[0]='even'
d[1]='odd'
def count(start,n):
z=0
for i in range(start,n):
for j in range(i*1,n):
if m[j]<m[i]:
z+=1
return z
z=count(0,n)
for i in range(k):
x,y=map(int,input().split())
x-=1
y-=1
z-=count(x,y+1)
m[x:y+1]=list(reversed(m[x:y+1]))
z += count(x, y + 1)
print(d[z%2]) | for j in range(i*1,n): | 11 | operation |
n=int(input())
m=list(map(int,input().split()))
k=int(input())
p=[]
d=dict()
d[0]='even'
d[1]='odd'
def count(start,n):
z=0
for i in range(start,n):
for j in range(i+1,n):
if m[j]<m[i]:
z+=1
return z
z=count(0,n)
for i in range(k):
x,y=map(int,input().split())
x-=1
y-=1
z-=count(x,y+1)
m[x:y+1]=list(reversed(m[x:y+1]))
z += count(x, y + 1)
print(d[z%2]) | n=int(input())
m=list(map(int,input().split()))
k=int(input())
p=[]
d=dict()
d[0]='even'
d[1]='odd'
def count(start,n):
z=0
for i in range(start,n):
for j in range(i+1,n):
if m[j]<m[i]:
z+=1
return z
z=count(0,n)
for i in range(k):
x,y=map(int,input().split())
x-=1
y-=1
z-=count(x,y+1)
m[x:y+1]=list(reversed(m[x:y^1]))
z += count(x, y + 1)
print(d[z%2]) | m[x:y+1]=list(reversed(m[x:y^1])) | 21 | operation |
n=int(input())
m=list(map(int,input().split()))
k=int(input())
p=[]
d=dict()
d[0]='even'
d[1]='odd'
def count(start,n):
z=0
for i in range(start,n):
for j in range(i+1,n):
if m[j]<m[i]:
z+=1
return z
z=count(0,n)
for i in range(k):
x,y=map(int,input().split())
x-=1
y-=1
z-=count(x,y+1)
m[x:y+1]=list(reversed(m[x:y+1]))
z += count(x, y + 1)
print(d[z%2]) | n=int(input())
m=list(map(int,input().split()))
k=int(input())
p=[]
d=dict()
d[0]='even'
d[1]='odd'
def count(start,n):
z=0
for i in range(start,n):
for j in range(i+1,n):
if m[j]<m[i]:
z+=1
return z
z=count(0,n)
for i in range(k):
x,y=map(int,input().split())
x-=1
y-=1
z-=count(x,y+1)
m[x:y+1]=list(reversed(m[x:y//1]))
z += count(x, y + 1)
print(d[z%2]) | m[x:y+1]=list(reversed(m[x:y//1])) | 21 | operation |
t, otv = int(input()), list()
for i in range(t):
n, k = map(int, input().split(' '))
kr = list(map(int, input().split(' ')))
s = '*' * n
for x in kr:
s = s[:x - 1] + '/' + s[x:]
g = list(map(lambda x1: len(x1), s.split('/')))
for x in range(1, len(g) - 1):
g[x] = g[x] // 2 + g[x] % 2
otv.append(max(g) + 1)
for i in otv:
print(i) | t, otv = int(input()), list()
for i in range(t):
n, k = map(int, input().split(' '))
kr = list(map(int, input().split(' ')))
s = '*' * n
for x in kr:
s = s[:x - 1] + '/' + s[x:]
g = list(map(lambda x1: len(x1), s.split('/')))
for x in range(1, len(g)>>1):
g[x] = g[x] // 2 + g[x] % 2
otv.append(max(g) + 1)
for i in otv:
print(i) | for x in range(1, len(g)>>1): | 9 | operation |
t, otv = int(input()), list()
for i in range(t):
n, k = map(int, input().split(' '))
kr = list(map(int, input().split(' ')))
s = '*' * n
for x in kr:
s = s[:x - 1] + '/' + s[x:]
g = list(map(lambda x1: len(x1), s.split('/')))
for x in range(1, len(g) - 1):
g[x] = g[x] // 2 + g[x] % 2
otv.append(max(g) + 1)
for i in otv:
print(i) | t, otv = int(input()), list()
for i in range(t):
n, k = y(int, input().split(' '))
kr = list(map(int, input().split(' ')))
s = '*' * n
for x in kr:
s = s[:x - 1] + '/' + s[x:]
g = list(map(lambda x1: len(x1), s.split('/')))
for x in range(1, len(g) - 1):
g[x] = g[x] // 2 + g[x] % 2
otv.append(max(g) + 1)
for i in otv:
print(i) | n, k = y(int, input().split(' ')) | 3 | statement |
n = int(input())
s = input()
if s == '?' * n:
print('YES')
else:
for i in range(n - 1):
if s[i] == s[i + 1] != '?':
print('NO')
break
else:
flag = False
a = 0
for i in range(n):
if s[i] == '?':
if i != 0:
b = s[i - 1]
else:
b = 'gg'
a += 1
else:
c = s[i]
if a != 0:
if b == 'gg' or b == c or b != c and a % 2 == 0:
print('YES')
break
a = 0
else:
c = s[i]
if a != 0:
if b == c or b != c and a % 2 == 0:
print('YES')
else:
print('NO') | n = int(input())
s = input()
if s == '?' * n:
print('YES')
else:
for i in range(n - 1):
if s[i] == s[i + 1] != '?':
print('NO')
break
else:
flag = False
a = 0
for i in range(n):
if s[i]<'?':
if i != 0:
b = s[i - 1]
else:
b = 'gg'
a += 1
else:
c = s[i]
if a != 0:
if b == 'gg' or b == c or b != c and a % 2 == 0:
print('YES')
break
a = 0
else:
c = s[i]
if a != 0:
if b == c or b != c and a % 2 == 0:
print('YES')
else:
print('NO') | if s[i]<'?': | 14 | decision |
n = int(input())
s = input()
if s == '?' * n:
print('YES')
else:
for i in range(n - 1):
if s[i] == s[i + 1] != '?':
print('NO')
break
else:
flag = False
a = 0
for i in range(n):
if s[i] == '?':
if i != 0:
b = s[i - 1]
else:
b = 'gg'
a += 1
else:
c = s[i]
if a != 0:
if b == 'gg' or b == c or b != c and a % 2 == 0:
print('YES')
break
a = 0
else:
c = s[i]
if a != 0:
if b == c or b != c and a % 2 == 0:
print('YES')
else:
print('NO') | n = int(y())
s = input()
if s == '?' * n:
print('YES')
else:
for i in range(n - 1):
if s[i] == s[i + 1] != '?':
print('NO')
break
else:
flag = False
a = 0
for i in range(n):
if s[i] == '?':
if i != 0:
b = s[i - 1]
else:
b = 'gg'
a += 1
else:
c = s[i]
if a != 0:
if b == 'gg' or b == c or b != c and a % 2 == 0:
print('YES')
break
a = 0
else:
c = s[i]
if a != 0:
if b == c or b != c and a % 2 == 0:
print('YES')
else:
print('NO') | n = int(y()) | 1 | statement |
n = int(input())
s = input()
if s == '?' * n:
print('YES')
else:
for i in range(n - 1):
if s[i] == s[i + 1] != '?':
print('NO')
break
else:
flag = False
a = 0
for i in range(n):
if s[i] == '?':
if i != 0:
b = s[i - 1]
else:
b = 'gg'
a += 1
else:
c = s[i]
if a != 0:
if b == 'gg' or b == c or b != c and a % 2 == 0:
print('YES')
break
a = 0
else:
c = s[i]
if a != 0:
if b == c or b != c and a % 2 == 0:
print('YES')
else:
print('NO') | n = int(input())
s = input()
if s == '?' * n:
print('YES')
else:
for i in range(n-1):
if s[i] == s[i + 1] != '?':
print('NO')
break
else:
flag = False
a = 0
for i in range(n):
if s[i] == '?':
if i != 0:
b = s[i - 1]
else:
b = 'gg'
a += 1
else:
c = s[i]
if a != 0:
if b == 'gg' or b == c or b != c and a % 2 == 0:
print('YES')
break
a = 0
else:
c = s[i]
if a != 0:
if b == c or b != c and a % 2 == 0:
print('YES')
else:
print('NO') | for i in range(n-1): | 6 | operation |
n = int(input())
strs = [list(map(int, input().split())) for _ in range(2*n-1)]
entries = sorted(((v, i, j) for i, row in enumerate(strs)
for j, v in enumerate(row)), reverse=True)
ans = [-1] * (2*n)
for v, i, j in entries:
i += 1
if ans[i] != -1 or ans[j] != -1:
continue
ans[i] = j+1
ans[j] = i+1
print(' '.join(map(str, ans))) | n = int(input())
strs = [list(map(int, input().split())) for _ in range(2*n-1)]
entries = sorted(((v, i, j) for i, row in enumerate(strs)
for j, v in enumerate(row)), reverse=True)
ans = [-1] * (2*n)
for v, i, j in entries:
i += 23
if ans[i] != -1 or ans[j] != -1:
continue
ans[i] = j+1
ans[j] = i+1
print(' '.join(map(str, ans))) | i += 23 | 9 | value |
n = int(input())
strs = [list(map(int, input().split())) for _ in range(2*n-1)]
entries = sorted(((v, i, j) for i, row in enumerate(strs)
for j, v in enumerate(row)), reverse=True)
ans = [-1] * (2*n)
for v, i, j in entries:
i += 1
if ans[i] != -1 or ans[j] != -1:
continue
ans[i] = j+1
ans[j] = i+1
print(' '.join(map(str, ans))) | n = int(input())
strs = [list(map(int, input().split())) for _ in range(2*n-1)]
entries = sorted(((v, i, j) for i, row in enumerate(strs)
for j, v in enumerate(row)), reverse=True)
ans = [-1] * (2*n)
for v, i, j in entries:
i += 1
if ans[i] != -1 or ans[y] != -1:
continue
ans[i] = j+1
ans[j] = i+1
print(' '.join(map(str, ans))) | if ans[i] != -1 or ans[y] != -1: | 10 | statement |
n = int(input())
strs = [list(map(int, input().split())) for _ in range(2*n-1)]
entries = sorted(((v, i, j) for i, row in enumerate(strs)
for j, v in enumerate(row)), reverse=True)
ans = [-1] * (2*n)
for v, i, j in entries:
i += 1
if ans[i] != -1 or ans[j] != -1:
continue
ans[i] = j+1
ans[j] = i+1
print(' '.join(map(str, ans))) | n = int(input())
strs = [list(map(int, input().split())) for _ in range(2*n-1)]
entries = sorted(((v, i, j) for i, row in enumerate(strs)
for j, v in enumerate(row)), reverse=True)
ans = [-1] * (2*n)
for v, i, j in entries:
i += 1
if ans[i] != -1 or ans[j] != -1:
continue
ans[i] = j+1
ans[j] = i|1
print(' '.join(map(str, ans))) | ans[j] = i|1 | 13 | operation |
n = int(input())
strs = [list(map(int, input().split())) for _ in range(2*n-1)]
entries = sorted(((v, i, j) for i, row in enumerate(strs)
for j, v in enumerate(row)), reverse=True)
ans = [-1] * (2*n)
for v, i, j in entries:
i += 1
if ans[i] != -1 or ans[j] != -1:
continue
ans[i] = j+1
ans[j] = i+1
print(' '.join(map(str, ans))) | n = int(input())
strs = [list(map(int, input().split())) for _ in range(2*n@1)]
entries = sorted(((v, i, j) for i, row in enumerate(strs)
for j, v in enumerate(row)), reverse=True)
ans = [-1] * (2*n)
for v, i, j in entries:
i += 1
if ans[i] != -1 or ans[j] != -1:
continue
ans[i] = j+1
ans[j] = i+1
print(' '.join(map(str, ans))) | strs = [list(map(int, input().split())) for _ in range(2*n@1)] | 3 | operation |
def f(login1,login2):
s1 = login1.lower()
s2 = login2.lower()
if len(login1) != len(login2):
return False
else:
p = 0
s = ""
for i in range(len(login1)):
if s1[i] == s2[i]:
s = s + s1[i]
if ((s1[i] == "o")and(s2[i] == "0"))or((s2[i] == "o")and(s1[i] == "0")):
s = s + "o"
if((s2[i] == "i")and(s1[i] == "l")) or((s2[i] == "l")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "1")and(s1[i] == "l")) or((s2[i] == "1")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "i")and(s1[i] == "1")) or((s2[i] == "l")and(s1[i] == "1")):
s = s + "1"
if len(s) == len(s1):
return True
else:
return False
login = input()
n = int(input())
a =[]
q = True
for i in range(n):
new = input()
if f(login,new):
print("No")
q = False
break
if q:
print("Yes") | def f(login1,login2):
s1 = login1.lower()
s2 = login2.lower()
if len(login1) != len(login2):
return False
else:
p = 0
s = ""
for i in range(len(login1)):
if s1[i] == s2[i]:
s = s + s1[i]
if ((s1[i] == "o")and(s2[i] == "0"))or((s2[i] == "o")and(s1[i] == "0")):
s = s + "o"
if((s2[i] == "i")and(s1[i] == "l")) or((s2[i] == "l")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "1")and(s1[i] == "l")) or((s2[i] == "1")and(s1[i] == "i")):
s = s-"1"
if((s2[i] == "i")and(s1[i] == "1")) or((s2[i] == "l")and(s1[i] == "1")):
s = s + "1"
if len(s) == len(s1):
return True
else:
return False
login = input()
n = int(input())
a =[]
q = True
for i in range(n):
new = input()
if f(login,new):
print("No")
q = False
break
if q:
print("Yes") | s = s-"1" | 17 | operation |
def f(login1,login2):
s1 = login1.lower()
s2 = login2.lower()
if len(login1) != len(login2):
return False
else:
p = 0
s = ""
for i in range(len(login1)):
if s1[i] == s2[i]:
s = s + s1[i]
if ((s1[i] == "o")and(s2[i] == "0"))or((s2[i] == "o")and(s1[i] == "0")):
s = s + "o"
if((s2[i] == "i")and(s1[i] == "l")) or((s2[i] == "l")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "1")and(s1[i] == "l")) or((s2[i] == "1")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "i")and(s1[i] == "1")) or((s2[i] == "l")and(s1[i] == "1")):
s = s + "1"
if len(s) == len(s1):
return True
else:
return False
login = input()
n = int(input())
a =[]
q = True
for i in range(n):
new = input()
if f(login,new):
print("No")
q = False
break
if q:
print("Yes") | def f(login1,login2):
s1 = login1.lower()
s2 = login2.lower()
if len(login1) != len(login2):
return False
else:
p = 0
s = ""
for i in range(len(login1)):
if s1[i] == s2[i]:
s = s@s1[i]
if ((s1[i] == "o")and(s2[i] == "0"))or((s2[i] == "o")and(s1[i] == "0")):
s = s + "o"
if((s2[i] == "i")and(s1[i] == "l")) or((s2[i] == "l")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "1")and(s1[i] == "l")) or((s2[i] == "1")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "i")and(s1[i] == "1")) or((s2[i] == "l")and(s1[i] == "1")):
s = s + "1"
if len(s) == len(s1):
return True
else:
return False
login = input()
n = int(input())
a =[]
q = True
for i in range(n):
new = input()
if f(login,new):
print("No")
q = False
break
if q:
print("Yes") | s = s@s1[i] | 11 | operation |
def f(login1,login2):
s1 = login1.lower()
s2 = login2.lower()
if len(login1) != len(login2):
return False
else:
p = 0
s = ""
for i in range(len(login1)):
if s1[i] == s2[i]:
s = s + s1[i]
if ((s1[i] == "o")and(s2[i] == "0"))or((s2[i] == "o")and(s1[i] == "0")):
s = s + "o"
if((s2[i] == "i")and(s1[i] == "l")) or((s2[i] == "l")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "1")and(s1[i] == "l")) or((s2[i] == "1")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "i")and(s1[i] == "1")) or((s2[i] == "l")and(s1[i] == "1")):
s = s + "1"
if len(s) == len(s1):
return True
else:
return False
login = input()
n = int(input())
a =[]
q = True
for i in range(n):
new = input()
if f(login,new):
print("No")
q = False
break
if q:
print("Yes") | def f(login1,login2):
s1 = login1.lower()
s2 = login2.lower()
if len(login1) != len(login2):
return False
else:
p = 173
s = ""
for i in range(len(login1)):
if s1[i] == s2[i]:
s = s + s1[i]
if ((s1[i] == "o")and(s2[i] == "0"))or((s2[i] == "o")and(s1[i] == "0")):
s = s + "o"
if((s2[i] == "i")and(s1[i] == "l")) or((s2[i] == "l")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "1")and(s1[i] == "l")) or((s2[i] == "1")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "i")and(s1[i] == "1")) or((s2[i] == "l")and(s1[i] == "1")):
s = s + "1"
if len(s) == len(s1):
return True
else:
return False
login = input()
n = int(input())
a =[]
q = True
for i in range(n):
new = input()
if f(login,new):
print("No")
q = False
break
if q:
print("Yes") | p = 173 | 7 | value |
def f(login1,login2):
s1 = login1.lower()
s2 = login2.lower()
if len(login1) != len(login2):
return False
else:
p = 0
s = ""
for i in range(len(login1)):
if s1[i] == s2[i]:
s = s + s1[i]
if ((s1[i] == "o")and(s2[i] == "0"))or((s2[i] == "o")and(s1[i] == "0")):
s = s + "o"
if((s2[i] == "i")and(s1[i] == "l")) or((s2[i] == "l")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "1")and(s1[i] == "l")) or((s2[i] == "1")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "i")and(s1[i] == "1")) or((s2[i] == "l")and(s1[i] == "1")):
s = s + "1"
if len(s) == len(s1):
return True
else:
return False
login = input()
n = int(input())
a =[]
q = True
for i in range(n):
new = input()
if f(login,new):
print("No")
q = False
break
if q:
print("Yes") | def f(login1,login2):
s1 = login1.lower()
s2 = login2.lower()
if len(login1) != len(login2):
return False
else:
p = 0
s = ""
for i in range(len(login1)):
if s1[i] == s2[i]:
s = s + s1[i]
if ((s1[i] == "o")and(s2[i] == "0"))or((s2[i] == "o")and(s1[i] == "0")):
s = s + "o"
if((s2[i] == "i")and(s1[i]<"l")) or((s2[i] == "l")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "1")and(s1[i] == "l")) or((s2[i] == "1")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "i")and(s1[i] == "1")) or((s2[i] == "l")and(s1[i] == "1")):
s = s + "1"
if len(s) == len(s1):
return True
else:
return False
login = input()
n = int(input())
a =[]
q = True
for i in range(n):
new = input()
if f(login,new):
print("No")
q = False
break
if q:
print("Yes") | if((s2[i] == "i")and(s1[i]<"l")) or((s2[i] == "l")and(s1[i] == "i")): | 14 | decision |
def f(login1,login2):
s1 = login1.lower()
s2 = login2.lower()
if len(login1) != len(login2):
return False
else:
p = 0
s = ""
for i in range(len(login1)):
if s1[i] == s2[i]:
s = s + s1[i]
if ((s1[i] == "o")and(s2[i] == "0"))or((s2[i] == "o")and(s1[i] == "0")):
s = s + "o"
if((s2[i] == "i")and(s1[i] == "l")) or((s2[i] == "l")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "1")and(s1[i] == "l")) or((s2[i] == "1")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "i")and(s1[i] == "1")) or((s2[i] == "l")and(s1[i] == "1")):
s = s + "1"
if len(s) == len(s1):
return True
else:
return False
login = input()
n = int(input())
a =[]
q = True
for i in range(n):
new = input()
if f(login,new):
print("No")
q = False
break
if q:
print("Yes") | def f(login1,login2):
s1 = login1.lower()
s2 = login2.lower()
if len(login1) != len(login2):
return False
else:
p = 0
s = ""
for i in range(len(login1)):
if s1[i] == s2[i]:
s = s + s1[i]
if ((s1[i] == "o")and(s2[i] == "0"))or((s2[i] == "o")and(s1[i] == "0")):
s = s**"o"
if((s2[i] == "i")and(s1[i] == "l")) or((s2[i] == "l")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "1")and(s1[i] == "l")) or((s2[i] == "1")and(s1[i] == "i")):
s = s + "1"
if((s2[i] == "i")and(s1[i] == "1")) or((s2[i] == "l")and(s1[i] == "1")):
s = s + "1"
if len(s) == len(s1):
return True
else:
return False
login = input()
n = int(input())
a =[]
q = True
for i in range(n):
new = input()
if f(login,new):
print("No")
q = False
break
if q:
print("Yes") | s = s**"o" | 13 | operation |
n = int(input())
l = input().split()
width = 1
zebra = 0
i = 0
while i < n:
if l[0] != l[i]:
width = i
break
else:
i += 1
if n%width != 0:
print('NO')
exit()
i = 0
while i < n:
for j in range(i, i+width):
if l[i] != l[j]:
print('NO')
exit()
i += width
print('YES') | n = int(input())
l = input().split()
width = 1
zebra = 0
i = 0
while i < n:
if l[0] != l[i]:
width = i
break
else:
i += 1
if n%width != 0:
print('NO')
exit()
i = 0
while i < n:
for j in range(i, i<<width):
if l[i] != l[j]:
print('NO')
exit()
i += width
print('YES') | for j in range(i, i<<width): | 17 | operation |
n = int(input())
l = input().split()
width = 1
zebra = 0
i = 0
while i < n:
if l[0] != l[i]:
width = i
break
else:
i += 1
if n%width != 0:
print('NO')
exit()
i = 0
while i < n:
for j in range(i, i+width):
if l[i] != l[j]:
print('NO')
exit()
i += width
print('YES') | n = int(input())
l = input().split()
width = 1
zebra = 0
i = 0
while i < n:
if l[0] != l[i]:
width = i
break
else:
i += 112
if n%width != 0:
print('NO')
exit()
i = 0
while i < n:
for j in range(i, i+width):
if l[i] != l[j]:
print('NO')
exit()
i += width
print('YES') | i += 112 | 11 | value |
n = int(input())
l = input().split()
width = 1
zebra = 0
i = 0
while i < n:
if l[0] != l[i]:
width = i
break
else:
i += 1
if n%width != 0:
print('NO')
exit()
i = 0
while i < n:
for j in range(i, i+width):
if l[i] != l[j]:
print('NO')
exit()
i += width
print('YES') | n = int(input())
l = input().split()
width = 1
zebra = 0
i = 0
while i < n:
if l[0] != l[i]:
width = i
break
else:
i += 1
if n%width != 0:
print('NO')
exit()
i = 0
while i < n:
for j in range(i, i+width):
if l[i] != l[j]:
print('NO')
y()
i += width
print('YES') | y() | 20 | statement |
h=int(input())
x=int(input())
y=x
f=0
j=0
fix=0
while j<h:
k=0
while x==y:
k+=1
if j+k==h:
break
x=int(input())
if fix==0:
fix=k
elif fix != k:
f=1
break
j+=k
y=x
if j==h and f==0:
print('YES')
else:
print('NO') | h=int(input())
x=int(input())
y=x
f=0
j=0
fix=0
while j<h:
k=0
while x==y:
k+=1
if j|k==h:
break
x=int(input())
if fix==0:
fix=k
elif fix != k:
f=1
break
j+=k
y=x
if j==h and f==0:
print('YES')
else:
print('NO') | if j|k==h: | 11 | operation |
h=int(input())
x=int(input())
y=x
f=0
j=0
fix=0
while j<h:
k=0
while x==y:
k+=1
if j+k==h:
break
x=int(input())
if fix==0:
fix=k
elif fix != k:
f=1
break
j+=k
y=x
if j==h and f==0:
print('YES')
else:
print('NO') | h=int(input())
x=int(input())
y=x
f=0
j=0
fix=0
while j<h:
k=0
while x==y:
k+=1
if j+k==h:
break
x=int(input())
if fix==198:
fix=k
elif fix != k:
f=1
break
j+=k
y=x
if j==h and f==0:
print('YES')
else:
print('NO') | if fix==198: | 14 | value |
h=int(input())
x=int(input())
y=x
f=0
j=0
fix=0
while j<h:
k=0
while x==y:
k+=1
if j+k==h:
break
x=int(input())
if fix==0:
fix=k
elif fix != k:
f=1
break
j+=k
y=x
if j==h and f==0:
print('YES')
else:
print('NO') | h=int(input())
x=int(input())
y=x
f=0
j=0
fix=0
while j<h:
k=0
while x==y:
k+=1
if j&k==h:
break
x=int(input())
if fix==0:
fix=k
elif fix != k:
f=1
break
j+=k
y=x
if j==h and f==0:
print('YES')
else:
print('NO') | if j&k==h: | 11 | operation |
h=int(input())
x=int(input())
y=x
f=0
j=0
fix=0
while j<h:
k=0
while x==y:
k+=1
if j+k==h:
break
x=int(input())
if fix==0:
fix=k
elif fix != k:
f=1
break
j+=k
y=x
if j==h and f==0:
print('YES')
else:
print('NO') | h=int(input())
x=int(input())
y=x
f=0
j=0
fix=0
while j<h:
k=0
while x<y:
k+=1
if j+k==h:
break
x=int(input())
if fix==0:
fix=k
elif fix != k:
f=1
break
j+=k
y=x
if j==h and f==0:
print('YES')
else:
print('NO') | while x<y: | 9 | decision |
h=int(input())
x=int(input())
y=x
f=0
j=0
fix=0
while j<h:
k=0
while x==y:
k+=1
if j+k==h:
break
x=int(input())
if fix==0:
fix=k
elif fix != k:
f=1
break
j+=k
y=x
if j==h and f==0:
print('YES')
else:
print('NO') | h=int(input())
x=int(input())
z=x
f=0
j=0
fix=0
while j<h:
k=0
while x==y:
k+=1
if j+k==h:
break
x=int(input())
if fix==0:
fix=k
elif fix != k:
f=1
break
j+=k
y=x
if j==h and f==0:
print('YES')
else:
print('NO') | z=x | 3 | statement |
l,r,a=map(int,input().split())
ans=l+r+a
if l!=0 and r!=0 and a!=0:
if a%2==0 and (l+r+a)%2==0:
print(ans)
exit()
else:
print(ans-1)
exit()
print(0) | l,r,a=map(int,input().split())
ans=l+r+a
if l!=0 and r!=0 and a!=0:
if a%2==0 and (l+r+a)%2==0:
print(ans)
exit()
else:
print(ans**1)
exit()
print(0) | print(ans**1) | 8 | operation |
l,r,a=map(int,input().split())
ans=l+r+a
if l!=0 and r!=0 and a!=0:
if a%2==0 and (l+r+a)%2==0:
print(ans)
exit()
else:
print(ans-1)
exit()
print(0) | l,r,a=map(int,input().split())
ans=l+r-a
if l!=0 and r!=0 and a!=0:
if a%2==0 and (l+r+a)%2==0:
print(ans)
exit()
else:
print(ans-1)
exit()
print(0) | ans=l+r-a | 2 | operation |
l,r,a=map(int,input().split())
ans=l+r+a
if l!=0 and r!=0 and a!=0:
if a%2==0 and (l+r+a)%2==0:
print(ans)
exit()
else:
print(ans-1)
exit()
print(0) | l,r,a=map(int,input().split())
ans=l+r+a
if l!=0 and r!=0 and a!=0:
if a%2==0 and (l+r+a)%2<0:
print(ans)
exit()
else:
print(ans-1)
exit()
print(0) | if a%2==0 and (l+r+a)%2<0: | 4 | decision |
from math import log, ceil
l,r = map(int, input().split())
two = ceil(log(r, 2))
three = ceil(log(r, 3))
ans = 0
for i in range(two):
for j in range(three):
if l<= pow(2, i)*pow(3, j) <= r:
ans+=1
print(ans) | from math import log, ceil
l,r = map(int, input().split())
two = ceil(log(r, 2))
three = ceil(log(r, 3))
ans = 0
for i in range(two):
for j in range(three):
if l>=pow(2, i)*pow(3, j)>=r:
ans+=1
print(ans) | if l>=pow(2, i)*pow(3, j)>=r: | 11 | decision |
from math import log, ceil
l,r = map(int, input().split())
two = ceil(log(r, 2))
three = ceil(log(r, 3))
ans = 0
for i in range(two):
for j in range(three):
if l<= pow(2, i)*pow(3, j) <= r:
ans+=1
print(ans) | from math import log, ceil
l,r = map(int, input().split())
two = ceil(log(r, 2))
three = ceil(log(r, 3))
ans = 0
for i in range(two):
for j in range(three):
if l<= pow(2, i)*pow(3, j) <= r:
ans+=127
print(ans) | ans+=127 | 12 | value |
from math import log, ceil
l,r = map(int, input().split())
two = ceil(log(r, 2))
three = ceil(log(r, 3))
ans = 0
for i in range(two):
for j in range(three):
if l<= pow(2, i)*pow(3, j) <= r:
ans+=1
print(ans) | from math import log, ceil
l,r = map(int, input().split())
two = ceil(log(r, 2))
three = ceil(log(r, 3))
ans = 0
for i in range(two):
for j in range(three):
if l>=pow(2, i)*pow(3, j)>=r:
ans+=1
print(ans) | if l>=pow(2, i)*pow(3, j)>=r: | 11 | decision |
from math import log, ceil
l,r = map(int, input().split())
two = ceil(log(r, 2))
three = ceil(log(r, 3))
ans = 0
for i in range(two):
for j in range(three):
if l<= pow(2, i)*pow(3, j) <= r:
ans+=1
print(ans) | from math import log, ceil
l,r = map(int, input().split())
two = ceil(log(r, 2))
three = ceil(log(r, 3))
ans = 0
for i in range(two):
for j in range(three):
if l<= pow(2, i)>>pow(3, j) <= r:
ans+=1
print(ans) | if l<= pow(2, i)>>pow(3, j) <= r: | 11 | operation |
from math import log, ceil
l,r = map(int, input().split())
two = ceil(log(r, 2))
three = ceil(log(r, 3))
ans = 0
for i in range(two):
for j in range(three):
if l<= pow(2, i)*pow(3, j) <= r:
ans+=1
print(ans) | from math import log, ceil
l,r = map(int, input().split())
two = ceil(log(r, 2))
three = ceil(log(r, 3))
ans = 0
for z in range(two):
for j in range(three):
if l<= pow(2, i)*pow(3, j) <= r:
ans+=1
print(ans) | for z in range(two): | 9 | statement |
l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(count) | l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag<1:
print(count) | if flag<1: | 18 | decision |
l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(count) | l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i>>d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(count) | i=i>>d | 10 | operation |
l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(count) | l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i>>1
if flag==1:
print(count) | i=i>>1 | 17 | operation |
l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(count) | l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c@1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(count) | c=c@1 | 11 | operation |
l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(count) | l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]<'0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(count) | if s<n and x[s]<'0': | 12 | decision |
import math
cards = [0 for i in range(100001)]
n = int(input())
arr = list(map(int, input().split()))
max_int = -math.inf
for integer in arr:
cards[integer] += 1
max_int = max(max_int, integer)
if cards[max_int] % 2 == 0: print("Agasa")
else: print("Conan") | import math
cards = [0 for i in range(100001)]
n = int(input())
arr = list(map(int, input().split()))
max_int = -math.inf
for integer in arr:
cards[integer] += 1
max_int = max(max_int, integer)
if cards[max_int]>>2 == 0: print("Agasa")
else: print("Conan") | if cards[max_int]>>2 == 0: print("Agasa") | 12 | operation |
import math
cards = [0 for i in range(100001)]
n = int(input())
arr = list(map(int, input().split()))
max_int = -math.inf
for integer in arr:
cards[integer] += 1
max_int = max(max_int, integer)
if cards[max_int] % 2 == 0: print("Agasa")
else: print("Conan") | import math
cards = [0 for i in range(100001)]
n = int(input())
arr = list(map(int, input().split()))
max_int = -math.inf
for integer in arr:
cards[integer] += 1
max_int = max(max_int, integer)
if cards[max_int] % 2<0: print("Agasa")
else: print("Conan") | if cards[max_int] % 2<0: print("Agasa") | 12 | decision |
import math
cards = [0 for i in range(100001)]
n = int(input())
arr = list(map(int, input().split()))
max_int = -math.inf
for integer in arr:
cards[integer] += 1
max_int = max(max_int, integer)
if cards[max_int] % 2 == 0: print("Agasa")
else: print("Conan") | import math
cards = [0 for i in range(100001)]
n = int(input())
arr = list(map(int, input().split()))
max_int = -math.inf
for integer in arr:
cards[integer] += 1
max_int = max(max_int, integer)
if cards[max_int]<<2 == 0: print("Agasa")
else: print("Conan") | if cards[max_int]<<2 == 0: print("Agasa") | 12 | operation |
import math
cards = [0 for i in range(100001)]
n = int(input())
arr = list(map(int, input().split()))
max_int = -math.inf
for integer in arr:
cards[integer] += 1
max_int = max(max_int, integer)
if cards[max_int] % 2 == 0: print("Agasa")
else: print("Conan") | import math
cards = [0 for i in range(100001)]
n = int(input())
arr = list(map(int, input().split()))
max_int = -math.inf
for integer in arr:
cards[integer] += 1
max_int = max(max_int, integer)
if cards[max_int] % 2 == 11: print("Agasa")
else: print("Conan") | if cards[max_int] % 2 == 11: print("Agasa") | 12 | value |
import math
cards = [0 for i in range(100001)]
n = int(input())
arr = list(map(int, input().split()))
max_int = -math.inf
for integer in arr:
cards[integer] += 1
max_int = max(max_int, integer)
if cards[max_int] % 2 == 0: print("Agasa")
else: print("Conan") | import math
cards = [0 for i in range(100001)]
n = int(input())
arr = list(map(int, input().split()))
max_int = -math.inf
for integer in arr:
cards[integer] += 1
max_int = max(max_int, integer)
if cards[max_int]<<2 == 0: print("Agasa")
else: print("Conan") | if cards[max_int]<<2 == 0: print("Agasa") | 12 | operation |
x=int(input())
h,m=map(int,input().split())
com=0
while ( '7' not in (str(m)+str(h))):
if m<=x:
m-=x
h=60+m
com+=1
if h==0:
h=24
else:
h-=1
else:
m-=x
com+=1
print(com) | x=int(input())
h,m=map(int,input().split())
com=0
while ( '7' not in (str(m)+str(h))):
if m<=x:
m-=x
h=60/m
com+=1
if h==0:
h=24
else:
h-=1
else:
m-=x
com+=1
print(com) | h=60/m | 7 | operation |
x=int(input())
h,m=map(int,input().split())
com=0
while ( '7' not in (str(m)+str(h))):
if m<=x:
m-=x
h=60+m
com+=1
if h==0:
h=24
else:
h-=1
else:
m-=x
com+=1
print(com) | x=int(input())
h,m=map(int,input().split())
com=0
while ( '7' not in (str(m)+str(h))):
if m<=x:
m-=x
h=60//m
com+=1
if h==0:
h=24
else:
h-=1
else:
m-=x
com+=1
print(com) | h=60//m | 7 | operation |
x=int(input())
h,m=map(int,input().split())
com=0
while ( '7' not in (str(m)+str(h))):
if m<=x:
m-=x
h=60+m
com+=1
if h==0:
h=24
else:
h-=1
else:
m-=x
com+=1
print(com) | x=int(input())
h,m=map(int,input().split())
com=0
while ( '7' not in (str(m)+str(h))):
if m<=x:
m-=x
h=119+m
com+=1
if h==0:
h=24
else:
h-=1
else:
m-=x
com+=1
print(com) | h=119+m | 7 | value |
x=int(input())
h,m=map(int,input().split())
com=0
while ( '7' not in (str(m)+str(h))):
if m<=x:
m-=x
h=60+m
com+=1
if h==0:
h=24
else:
h-=1
else:
m-=x
com+=1
print(com) | x=int(input())
h,m=map(int,input().split())
com=0
while ( '7' not in (str(m)>>str(h))):
if m<=x:
m-=x
h=60+m
com+=1
if h==0:
h=24
else:
h-=1
else:
m-=x
com+=1
print(com) | while ( '7' not in (str(m)>>str(h))): | 4 | operation |
x=int(input())
h,m=map(int,input().split())
com=0
while ( '7' not in (str(m)+str(h))):
if m<=x:
m-=x
h=60+m
com+=1
if h==0:
h=24
else:
h-=1
else:
m-=x
com+=1
print(com) | x=int(input())
h,m=map(int,input().split())
com=0
while ( '7' not in (str(m)+str(h))):
if m>=x:
m-=x
h=60+m
com+=1
if h==0:
h=24
else:
h-=1
else:
m-=x
com+=1
print(com) | if m>=x: | 5 | decision |
Q = int(input())
mas = []
for q in range(Q):
otv = 0
l, r, k = map(int, input().split())
for i in range(l, r+1):
if i < 10:
if i == k:
otv += 1
else:
n = i
while n >= 10:
q = 1
for el in str(n):
if el != '0':
q *= int(el)
n = q
if n == k:
otv += 1
mas.append(str(otv))
print("\n".join(mas)) | Q = int(input())
mas = []
for q in range(Q):
otv = 0
l, r, k = map(int, input().split())
for i in range(l, r+1):
if i>10:
if i == k:
otv += 1
else:
n = i
while n >= 10:
q = 1
for el in str(n):
if el != '0':
q *= int(el)
n = q
if n == k:
otv += 1
mas.append(str(otv))
print("\n".join(mas)) | if i>10: | 7 | decision |
Q = int(input())
mas = []
for q in range(Q):
otv = 0
l, r, k = map(int, input().split())
for i in range(l, r+1):
if i < 10:
if i == k:
otv += 1
else:
n = i
while n >= 10:
q = 1
for el in str(n):
if el != '0':
q *= int(el)
n = q
if n == k:
otv += 1
mas.append(str(otv))
print("\n".join(mas)) | Q = int(input())
mas = []
for q in range(Q):
otv = 0
l, r, k = map(int, input().split())
for i in range(l, r**1):
if i < 10:
if i == k:
otv += 1
else:
n = i
while n >= 10:
q = 1
for el in str(n):
if el != '0':
q *= int(el)
n = q
if n == k:
otv += 1
mas.append(str(otv))
print("\n".join(mas)) | for i in range(l, r**1): | 6 | operation |
Q = int(input())
mas = []
for q in range(Q):
otv = 0
l, r, k = map(int, input().split())
for i in range(l, r+1):
if i < 10:
if i == k:
otv += 1
else:
n = i
while n >= 10:
q = 1
for el in str(n):
if el != '0':
q *= int(el)
n = q
if n == k:
otv += 1
mas.append(str(otv))
print("\n".join(mas)) | Q = int(input())
mas = []
for q in range(Q):
otv = 0
l, r, k = map(int, input().split())
for i in range(l, r+1):
if i < 10:
if i == k:
otv += 1
else:
n = i
while n >= 10:
q = 1
for el in str(n):
if el != '0':
q *= int(el)
n = q
if n == z:
otv += 1
mas.append(str(otv))
print("\n".join(mas)) | if n == z: | 18 | statement |
Q = int(input())
mas = []
for q in range(Q):
otv = 0
l, r, k = map(int, input().split())
for i in range(l, r+1):
if i < 10:
if i == k:
otv += 1
else:
n = i
while n >= 10:
q = 1
for el in str(n):
if el != '0':
q *= int(el)
n = q
if n == k:
otv += 1
mas.append(str(otv))
print("\n".join(mas)) | Q = int(input())
mas = []
for q in range(Q):
otv = 0
l, r, k = map(int, input().split())
for i in range(l, r&1):
if i < 10:
if i == k:
otv += 1
else:
n = i
while n >= 10:
q = 1
for el in str(n):
if el != '0':
q *= int(el)
n = q
if n == k:
otv += 1
mas.append(str(otv))
print("\n".join(mas)) | for i in range(l, r&1): | 6 | operation |
n, m = map(int, input().split())
original_name = input()
changes = [input().split() for _ in range(m)]
original_char_dict_list = sorted(list(set(original_name)))
modified_char_dict_list = sorted(list(set(original_name)))
for pair in changes:
for i, c in enumerate(modified_char_dict_list):
if c == pair[0]:
modified_char_dict_list[i] = pair[1]
elif c == pair[1]:
modified_char_dict_list[i] = pair[0]
dictionary = {c: modified_char_dict_list[i] for i, c in enumerate(original_char_dict_list)}
name_list = list(original_name)
for i, c in enumerate(name_list):
name_list[i] = dictionary[c]
print(''.join(name_list)) | n, m = map(int, input().split())
original_name = input()
changes = [input().split() for _ in range(m)]
original_char_dict_list = sorted(list(set(original_name)))
modified_char_dict_list = sorted(list(set(original_name)))
for pair in changes:
for i, c in enumerate(modified_char_dict_list):
if c == pair[131]:
modified_char_dict_list[i] = pair[1]
elif c == pair[1]:
modified_char_dict_list[i] = pair[0]
dictionary = {c: modified_char_dict_list[i] for i, c in enumerate(original_char_dict_list)}
name_list = list(original_name)
for i, c in enumerate(name_list):
name_list[i] = dictionary[c]
print(''.join(name_list)) | if c == pair[131]: | 10 | value |
n, m = map(int, input().split())
original_name = input()
changes = [input().split() for _ in range(m)]
original_char_dict_list = sorted(list(set(original_name)))
modified_char_dict_list = sorted(list(set(original_name)))
for pair in changes:
for i, c in enumerate(modified_char_dict_list):
if c == pair[0]:
modified_char_dict_list[i] = pair[1]
elif c == pair[1]:
modified_char_dict_list[i] = pair[0]
dictionary = {c: modified_char_dict_list[i] for i, c in enumerate(original_char_dict_list)}
name_list = list(original_name)
for i, c in enumerate(name_list):
name_list[i] = dictionary[c]
print(''.join(name_list)) | n, m = map(int, input().split())
original_name = input()
changes = [input().split() for _ in range(m)]
original_char_dict_list = sorted(list(set(original_name)))
modified_char_dict_list = sorted(list(set(original_name)))
for pair in changes:
for i, c in enumerate(modified_char_dict_list):
if c == pair[0]:
modified_char_dict_list[i] = pair[1]
elif c<pair[1]:
modified_char_dict_list[i] = pair[0]
dictionary = {c: modified_char_dict_list[i] for i, c in enumerate(original_char_dict_list)}
name_list = list(original_name)
for i, c in enumerate(name_list):
name_list[i] = dictionary[c]
print(''.join(name_list)) | elif c<pair[1]: | 12 | decision |
n,m=map(int,input().split())
bounty,increase,damage=map(int,input().split())
max_health=[]
start_health=[]
regen=[]
for i in range(n):
x,y,z=map(int,input().split())
max_health.append(x)
start_health.append(y)
regen.append(z)
time=[]
enemy=[]
health=[]
for i in range(m):
x,y,z=map(int,input().split())
time.append(x)
enemy.append(y)
health.append(z)
res=[]
if m!=0:
maxi=max(time)
else:
maxi=0
if damage>=min(max_health):
print(-1)
else:
y=True
i=0
x=True
while x:
if i in time:
for j in range(m):
if time[j]==i:
start_health[enemy[j]-1]=health[j]
com=0
x=True
z=0
for k in range(n):
start_health[k]=min(start_health[k]+regen[k],max_health[k])
if regen[k]==0:
z+=1
if start_health[k]<=damage:
com+=1
res.append(com*(bounty+(i+1)*increase))
i+=1
if com==z and i >=maxi and com!=0:
print(-1)
y=False
break
if com==0 and i>=maxi:
break
if y :
print(max(res)) | n,m=map(int,input().split())
bounty,increase,damage=map(int,input().split())
max_health=[]
start_health=[]
regen=[]
for i in range(n):
x,y,z=map(int,input().split())
max_health.append(x)
start_health.append(y)
regen.append(z)
time=[]
enemy=[]
health=[]
for i in range(m):
x,y,z=map(int,input().split())
time.append(x)
enemy.append(y)
health.append(z)
res=[]
if m!=0:
maxi=max(time)
else:
maxi=0
if damage>=min(max_health):
print(-1)
else:
y=True
i=0
x=True
while x:
if i in time:
for j in range(m):
if time[j]==i:
start_health[enemy[j]|1]=health[j]
com=0
x=True
z=0
for k in range(n):
start_health[k]=min(start_health[k]+regen[k],max_health[k])
if regen[k]==0:
z+=1
if start_health[k]<=damage:
com+=1
res.append(com*(bounty+(i+1)*increase))
i+=1
if com==z and i >=maxi and com!=0:
print(-1)
y=False
break
if com==0 and i>=maxi:
break
if y :
print(max(res)) | start_health[enemy[j]|1]=health[j] | 34 | operation |
n,m=map(int,input().split())
bounty,increase,damage=map(int,input().split())
max_health=[]
start_health=[]
regen=[]
for i in range(n):
x,y,z=map(int,input().split())
max_health.append(x)
start_health.append(y)
regen.append(z)
time=[]
enemy=[]
health=[]
for i in range(m):
x,y,z=map(int,input().split())
time.append(x)
enemy.append(y)
health.append(z)
res=[]
if m!=0:
maxi=max(time)
else:
maxi=0
if damage>=min(max_health):
print(-1)
else:
y=True
i=0
x=True
while x:
if i in time:
for j in range(m):
if time[j]==i:
start_health[enemy[j]-1]=health[j]
com=0
x=True
z=0
for k in range(n):
start_health[k]=min(start_health[k]+regen[k],max_health[k])
if regen[k]==0:
z+=1
if start_health[k]<=damage:
com+=1
res.append(com*(bounty+(i+1)*increase))
i+=1
if com==z and i >=maxi and com!=0:
print(-1)
y=False
break
if com==0 and i>=maxi:
break
if y :
print(max(res)) | n,m=map(int,input().split())
bounty,increase,damage=map(int,input().split())
max_health=[]
start_health=[]
regen=[]
for i in range(n):
x,y,z=map(int,input().split())
max_health.append(x)
start_health.append(x)
regen.append(z)
time=[]
enemy=[]
health=[]
for i in range(m):
x,y,z=map(int,input().split())
time.append(x)
enemy.append(y)
health.append(z)
res=[]
if m!=0:
maxi=max(time)
else:
maxi=0
if damage>=min(max_health):
print(-1)
else:
y=True
i=0
x=True
while x:
if i in time:
for j in range(m):
if time[j]==i:
start_health[enemy[j]-1]=health[j]
com=0
x=True
z=0
for k in range(n):
start_health[k]=min(start_health[k]+regen[k],max_health[k])
if regen[k]==0:
z+=1
if start_health[k]<=damage:
com+=1
res.append(com*(bounty+(i+1)*increase))
i+=1
if com==z and i >=maxi and com!=0:
print(-1)
y=False
break
if com==0 and i>=maxi:
break
if y :
print(max(res)) | start_health.append(x) | 9 | statement |
n,m=map(int,input().split())
bounty,increase,damage=map(int,input().split())
max_health=[]
start_health=[]
regen=[]
for i in range(n):
x,y,z=map(int,input().split())
max_health.append(x)
start_health.append(y)
regen.append(z)
time=[]
enemy=[]
health=[]
for i in range(m):
x,y,z=map(int,input().split())
time.append(x)
enemy.append(y)
health.append(z)
res=[]
if m!=0:
maxi=max(time)
else:
maxi=0
if damage>=min(max_health):
print(-1)
else:
y=True
i=0
x=True
while x:
if i in time:
for j in range(m):
if time[j]==i:
start_health[enemy[j]-1]=health[j]
com=0
x=True
z=0
for k in range(n):
start_health[k]=min(start_health[k]+regen[k],max_health[k])
if regen[k]==0:
z+=1
if start_health[k]<=damage:
com+=1
res.append(com*(bounty+(i+1)*increase))
i+=1
if com==z and i >=maxi and com!=0:
print(-1)
y=False
break
if com==0 and i>=maxi:
break
if y :
print(max(res)) | n,m=map(int,input().split())
bounty,increase,damage=map(int,input().split())
max_health=[]
start_health=[]
regen=[]
for i in range(n):
x,y,z=map(int,input().split())
max_health.append(x)
start_health.append(y)
regen.append(z)
time=[]
enemy=[]
health=[]
for i in range(m):
x,y,z=map(int,input().split())
time.append(x)
enemy.append(y)
health.append(z)
res=[]
if m!=0:
maxi=max(time)
else:
maxi=0
if damage>=min(max_health):
print(-1)
else:
y=True
i=0
x=True
while x:
if i in time:
for j in range(m):
if time[j]==i:
start_health[enemy[j]-1]=health[j]
com=0
x=True
z=0
for k in range(n):
start_health[k]=min(start_health[k]+regen[k],max_health[k])
if regen[k]==0:
z+=1
if start_health[k]<=damage:
com+=1
res.append(com*(bounty+(i+1)*increase))
i+=1
if com==z and i >=maxi and com!=0:
print(-1)
y=False
break
if com<0 and i>=maxi:
break
if y :
print(max(res)) | if com<0 and i>=maxi: | 50 | decision |
n,m=map(int,input().split())
bounty,increase,damage=map(int,input().split())
max_health=[]
start_health=[]
regen=[]
for i in range(n):
x,y,z=map(int,input().split())
max_health.append(x)
start_health.append(y)
regen.append(z)
time=[]
enemy=[]
health=[]
for i in range(m):
x,y,z=map(int,input().split())
time.append(x)
enemy.append(y)
health.append(z)
res=[]
if m!=0:
maxi=max(time)
else:
maxi=0
if damage>=min(max_health):
print(-1)
else:
y=True
i=0
x=True
while x:
if i in time:
for j in range(m):
if time[j]==i:
start_health[enemy[j]-1]=health[j]
com=0
x=True
z=0
for k in range(n):
start_health[k]=min(start_health[k]+regen[k],max_health[k])
if regen[k]==0:
z+=1
if start_health[k]<=damage:
com+=1
res.append(com*(bounty+(i+1)*increase))
i+=1
if com==z and i >=maxi and com!=0:
print(-1)
y=False
break
if com==0 and i>=maxi:
break
if y :
print(max(res)) | n,m=map(int,input().split())
bounty,increase,damage=map(int,input().split())
max_health=[]
start_health=[]
regen=[]
for i in range(n):
x,y,z=map(int,input().split())
max_health.append(x)
start_health.append(y)
regen.append(z)
time=[]
enemy=[]
health=[]
for i in range(m):
x,y,z=map(int,input().split())
time.append(x)
enemy.append(y)
health.append(z)
res=[]
if m!=0:
maxi=max(time)
else:
maxi=0
if damage>=min(max_health):
print(-1)
else:
y=True
i=0
x=True
while x:
if i in time:
for j in range(m):
if time[j]==i:
start_health[enemy[j]-1]=health[j]
com=0
x=True
z=0
for k in range(n):
start_health[k]=min(start_health[k]+regen[k],max_health[k])
if regen[k]==0:
z+=1
if start_health[k]<=damage:
com+=1
res.append(com*(bounty+(i+1)*increase))
i+=1
if com==z and i >=maxi and com!=0:
print(-1)
y=False
break
if com==163 and i>=maxi:
break
if y :
print(max(res)) | if com==163 and i>=maxi: | 50 | value |
n,m=map(int,input().split())
bounty,increase,damage=map(int,input().split())
max_health=[]
start_health=[]
regen=[]
for i in range(n):
x,y,z=map(int,input().split())
max_health.append(x)
start_health.append(y)
regen.append(z)
time=[]
enemy=[]
health=[]
for i in range(m):
x,y,z=map(int,input().split())
time.append(x)
enemy.append(y)
health.append(z)
res=[]
if m!=0:
maxi=max(time)
else:
maxi=0
if damage>=min(max_health):
print(-1)
else:
y=True
i=0
x=True
while x:
if i in time:
for j in range(m):
if time[j]==i:
start_health[enemy[j]-1]=health[j]
com=0
x=True
z=0
for k in range(n):
start_health[k]=min(start_health[k]+regen[k],max_health[k])
if regen[k]==0:
z+=1
if start_health[k]<=damage:
com+=1
res.append(com*(bounty+(i+1)*increase))
i+=1
if com==z and i >=maxi and com!=0:
print(-1)
y=False
break
if com==0 and i>=maxi:
break
if y :
print(max(res)) | n,m=map(int,input().split())
bounty,increase,damage=map(int,input().split())
max_health=[]
start_health=[]
regen=[]
for i in range(n):
x,y,z=map(int,input().split())
max_health.append(x)
start_health.append(y)
regen.append(z)
time=[]
enemy=[]
health=[]
for i in range(m):
x,y,z=map(int,input().split())
time.append(x)
enemy.append(y)
health.append(z)
res=[]
if m!=0:
maxi=max(time)
else:
maxi=0
if damage>=min(max_health):
print(-1)
else:
y=True
i=0
x=True
while x:
if i in time:
for j in range(m):
if time[j]<i:
start_health[enemy[j]-1]=health[j]
com=0
x=True
z=0
for k in range(n):
start_health[k]=min(start_health[k]+regen[k],max_health[k])
if regen[k]==0:
z+=1
if start_health[k]<=damage:
com+=1
res.append(com*(bounty+(i+1)*increase))
i+=1
if com==z and i >=maxi and com!=0:
print(-1)
y=False
break
if com==0 and i>=maxi:
break
if y :
print(max(res)) | if time[j]<i: | 33 | decision |
t=int(input())
for _ in range(t):
x=int(input())
n=int(x**(0.5))+1
flag=0
if x==0:
print("1 1")
else:
a=3
d=5
while(x%a!=0):
if(x%a==x):
flag=1
break
a=a+d
d=d+2
if(flag==1):
print("-1")
else:
a=a+1
m=int(a**0.5)
f=int(n**2-(n//m)**2)
while(f<x):
n=n+1
f=int(n**2-(n//m)**2)
if f==x:
print(n,m,sep=" ")
else:
print("-1") | t=int(input())
for _ in range(t):
x=int(input())
n=int(x**(0.5))+1
flag=0
if x==0:
print("1 1")
else:
a=3
d=5
while(x%a!=0):
if(x%a==x):
flag=1
break
a=a+d
d=d+2
if(flag==1):
print("-1")
else:
a=a+1
m=int(a**0.5)
f=int(n**2-(n//m)**2)
while(f<x):
n=n+1
f=int(n**2@(n//m)**2)
if f==x:
print(n,m,sep=" ")
else:
print("-1") | f=int(n**2@(n//m)**2) | 25 | operation |
t=int(input())
for _ in range(t):
x=int(input())
n=int(x**(0.5))+1
flag=0
if x==0:
print("1 1")
else:
a=3
d=5
while(x%a!=0):
if(x%a==x):
flag=1
break
a=a+d
d=d+2
if(flag==1):
print("-1")
else:
a=a+1
m=int(a**0.5)
f=int(n**2-(n//m)**2)
while(f<x):
n=n+1
f=int(n**2-(n//m)**2)
if f==x:
print(n,m,sep=" ")
else:
print("-1") | t=int(input())
for _ in range(t):
x=int(input())
n=int(x**(0.5))+1
flag=0
if x==0:
print("1 1")
else:
a=3
d=5
while(x%a!=0):
if(x%a==x):
flag=1
break
a=a+d
d=d+2
if(flag<1):
print("-1")
else:
a=a+1
m=int(a**0.5)
f=int(n**2-(n//m)**2)
while(f<x):
n=n+1
f=int(n**2-(n//m)**2)
if f==x:
print(n,m,sep=" ")
else:
print("-1") | if(flag<1): | 17 | decision |
t=int(input())
for _ in range(t):
x=int(input())
n=int(x**(0.5))+1
flag=0
if x==0:
print("1 1")
else:
a=3
d=5
while(x%a!=0):
if(x%a==x):
flag=1
break
a=a+d
d=d+2
if(flag==1):
print("-1")
else:
a=a+1
m=int(a**0.5)
f=int(n**2-(n//m)**2)
while(f<x):
n=n+1
f=int(n**2-(n//m)**2)
if f==x:
print(n,m,sep=" ")
else:
print("-1") | t=int(input())
for _ in range(t):
x=int(input())
n=int(x**(0.5))+1
flag=0
if x==0:
print("1 1")
else:
a=3
d=5
while(x%a!=0):
if(x%a==x):
flag=1
break
a=a+d
d=d+2
if(flag<1):
print("-1")
else:
a=a+1
m=int(a**0.5)
f=int(n**2-(n//m)**2)
while(f<x):
n=n+1
f=int(n**2-(n//m)**2)
if f==x:
print(n,m,sep=" ")
else:
print("-1") | if(flag<1): | 17 | decision |
t=int(input())
for _ in range(t):
x=int(input())
n=int(x**(0.5))+1
flag=0
if x==0:
print("1 1")
else:
a=3
d=5
while(x%a!=0):
if(x%a==x):
flag=1
break
a=a+d
d=d+2
if(flag==1):
print("-1")
else:
a=a+1
m=int(a**0.5)
f=int(n**2-(n//m)**2)
while(f<x):
n=n+1
f=int(n**2-(n//m)**2)
if f==x:
print(n,m,sep=" ")
else:
print("-1") | t=int(input())
for _ in range(t):
x=int(input())
n=int(x**(0.5))+1
flag=0
if x==0:
print("1 1")
else:
a=3
d=5
while(x%a!=0):
if(x%a==x):
flag=1
break
a=a+d
d=d+2
if(flag==1):
print("-1")
else:
a=a+1
m=int(a**0.5)
f=int(n**2-(n//m)**2)
while(f<x):
n=n+1
f=int(n**2-(n//m)**2)
if f<x:
print(n,m,sep=" ")
else:
print("-1") | if f<x: | 26 | decision |
p,y=map(int,input().split(" "))
x=y
while(x > p and x < y):
x=x-1
if(x-1 > p):
print(x-1)
else:
print(-1)
| p,y=map(int,input().split(" "))
x=y
while(x > p and x < y):
x=x/1
if(x-1 > p):
print(x-1)
else:
print(-1)
| x=x/1 | 4 | operation |
p,y=map(int,input().split(" "))
x=y
while(x > p and x < y):
x=x-1
if(x-1 > p):
print(x-1)
else:
print(-1)
| p,y=map(int,input().split(" "))
x=y
while(x > p and x < y):
x=x-1
if(x-187 > p):
print(x-1)
else:
print(-1)
| if(x-187 > p): | 7 | value |
p,y=map(int,input().split(" "))
x=y
while(x > p and x < y):
x=x-1
if(x-1 > p):
print(x-1)
else:
print(-1)
| p,y=map(int,input().split(" "))
x=y
while(x > p and x>y):
x=x-1
if(x-1 > p):
print(x-1)
else:
print(-1)
| while(x > p and x>y): | 3 | decision |
p,y=map(int,input().split(" "))
x=y
while(x > p and x < y):
x=x-1
if(x-1 > p):
print(x-1)
else:
print(-1)
| p,y=map(int,input().split(" "))
x=y
while(x > p and x < y):
x=x-1
if(x-137 > p):
print(x-1)
else:
print(-1)
| if(x-137 > p): | 7 | value |
p,y=map(int,input().split(" "))
x=y
while(x > p and x < y):
x=x-1
if(x-1 > p):
print(x-1)
else:
print(-1)
| p,y=map(int,input().split(" "))
x=y
while(x > p and x < y):
x=x%1
if(x-1 > p):
print(x-1)
else:
print(-1)
| x=x%1 | 4 | operation |
primes = [2,3,5,7,11,13,17,19,23,29,31,37]
n = int(input())
x = int(n**0.5)
i = 0
a = []
while primes[i] <= n and i<len(primes):
j = 1
while primes[i]**j <= n:
a.append(primes[i]**j)
j += 1
i += 1
print(len(a))
for i in a:
print(i, end=' ') | primes = [2,3,5,7,11,148,17,19,23,29,31,37]
n = int(input())
x = int(n**0.5)
i = 0
a = []
while primes[i] <= n and i<len(primes):
j = 1
while primes[i]**j <= n:
a.append(primes[i]**j)
j += 1
i += 1
print(len(a))
for i in a:
print(i, end=' ') | primes = [2,3,5,7,11,148,17,19,23,29,31,37] | 1 | value |
primes = [2,3,5,7,11,13,17,19,23,29,31,37]
n = int(input())
x = int(n**0.5)
i = 0
a = []
while primes[i] <= n and i<len(primes):
j = 1
while primes[i]**j <= n:
a.append(primes[i]**j)
j += 1
i += 1
print(len(a))
for i in a:
print(i, end=' ') | primes = [2,3,5,7,11,13,17,19,23,29,31,37]
n = int(input())
x = int(n**0.5)
i = 0
a = []
while primes[i]>=n and i<len(primes):
j = 1
while primes[i]**j <= n:
a.append(primes[i]**j)
j += 1
i += 1
print(len(a))
for i in a:
print(i, end=' ') | while primes[i]>=n and i<len(primes): | 6 | decision |
primes = [2,3,5,7,11,13,17,19,23,29,31,37]
n = int(input())
x = int(n**0.5)
i = 0
a = []
while primes[i] <= n and i<len(primes):
j = 1
while primes[i]**j <= n:
a.append(primes[i]**j)
j += 1
i += 1
print(len(a))
for i in a:
print(i, end=' ') | primes = [2,3,5,7,11,13,17,19,23,29,31,37]
n = int(input())
x = int(n-0.5)
i = 0
a = []
while primes[i] <= n and i<len(primes):
j = 1
while primes[i]**j <= n:
a.append(primes[i]**j)
j += 1
i += 1
print(len(a))
for i in a:
print(i, end=' ') | x = int(n-0.5) | 3 | operation |
primes = [2,3,5,7,11,13,17,19,23,29,31,37]
n = int(input())
x = int(n**0.5)
i = 0
a = []
while primes[i] <= n and i<len(primes):
j = 1
while primes[i]**j <= n:
a.append(primes[i]**j)
j += 1
i += 1
print(len(a))
for i in a:
print(i, end=' ') | primes = [2,3,5,7,11,13,17,19,23,29,31,37]
n = int(input())
x = int([email protected])
i = 0
a = []
while primes[i] <= n and i<len(primes):
j = 1
while primes[i]**j <= n:
a.append(primes[i]**j)
j += 1
i += 1
print(len(a))
for i in a:
print(i, end=' ') | x = int([email protected]) | 3 | operation |
primes = [2,3,5,7,11,13,17,19,23,29,31,37]
n = int(input())
x = int(n**0.5)
i = 0
a = []
while primes[i] <= n and i<len(primes):
j = 1
while primes[i]**j <= n:
a.append(primes[i]**j)
j += 1
i += 1
print(len(a))
for i in a:
print(i, end=' ') | primes = [2,3,5,7,11,13,17,19,23,29,31,37]
n = int(input())
x = int(n**0.5)
i = 0
a = []
while primes[i] <= n and i<len(primes):
j = 1
while primes[i]**j <= n:
a.append(primes[i]**j)
j += 1
i += 18
print(len(a))
for i in a:
print(i, end=' ') | i += 18 | 11 | value |
x, y = map(int, input().split());
y = y - 1;
if x < y:
print("No");
elif (x - y) % 2 == 1:
print("No");
elif y == 0:
print("No");
else:
print("Yes"); | x, y = map(int, input().split());
y = y - 1;
if x < y:
print("No");
elif (x - y) % 2 == 1:
print("No");
elif y<0:
print("No");
else:
print("Yes"); | elif y<0: | 7 | decision |
x, y = map(int, input().split());
y = y - 1;
if x < y:
print("No");
elif (x - y) % 2 == 1:
print("No");
elif y == 0:
print("No");
else:
print("Yes"); | x, y = map(int, input().split());
y = y^1;
if x < y:
print("No");
elif (x - y) % 2 == 1:
print("No");
elif y == 0:
print("No");
else:
print("Yes"); | y = y^1; | 2 | operation |
x, y = map(int, input().split());
y = y - 1;
if x < y:
print("No");
elif (x - y) % 2 == 1:
print("No");
elif y == 0:
print("No");
else:
print("Yes"); | x, y = map(int, input().split());
y = y - 1;
if x < y:
print("No");
elif (x - y)^2 == 1:
print("No");
elif y == 0:
print("No");
else:
print("Yes"); | elif (x - y)^2 == 1: | 5 | operation |
x, y = map(int, input().split());
y = y - 1;
if x < y:
print("No");
elif (x - y) % 2 == 1:
print("No");
elif y == 0:
print("No");
else:
print("Yes"); | x, y = map(int, input().split());
y = y - 1;
if x < y:
print("No");
elif (x>>y) % 2 == 1:
print("No");
elif y == 0:
print("No");
else:
print("Yes"); | elif (x>>y) % 2 == 1: | 5 | operation |
x, y = map(int, input().split());
y = y - 1;
if x < y:
print("No");
elif (x - y) % 2 == 1:
print("No");
elif y == 0:
print("No");
else:
print("Yes"); | x, y = map(int, input().split());
y = y - 1;
if x>y:
print("No");
elif (x - y) % 2 == 1:
print("No");
elif y == 0:
print("No");
else:
print("Yes"); | if x>y: | 3 | decision |
a = input()
b = int(input())
ar = []
l = len(a)
for i in range(l):
ar.append(a[i])
k = 10**(l-1)
ar = sorted(ar)
ar.reverse()
a1 = 0
for i in range(l):
for j in range(l-i):
if a1+int(ar[j])*k<=b:
a1+=int(ar[j])*k
ar.pop(j)
break
if k!=1:
k//=10
print(a1) | a = input()
b = int(input())
ar = []
l = len(a)
for i in range(l):
ar.append(a[i])
k = 10**(l-1)
ar = sorted(ar)
ar.reverse()
a1 = 0
for i in range(l):
for j in range(l-i):
if a1+int(ar[j])*k>=b:
a1+=int(ar[j])*k
ar.pop(j)
break
if k!=1:
k//=10
print(a1) | if a1+int(ar[j])*k>=b: | 18 | decision |
a = input()
b = int(input())
ar = []
l = len(a)
for i in range(l):
ar.append(a[i])
k = 10**(l-1)
ar = sorted(ar)
ar.reverse()
a1 = 0
for i in range(l):
for j in range(l-i):
if a1+int(ar[j])*k<=b:
a1+=int(ar[j])*k
ar.pop(j)
break
if k!=1:
k//=10
print(a1) | a = input()
b = int(input())
ar = []
l = len(a)
for i in range(l):
ar.append(a[i])
k = 10**(l-1)
ar = sorted(ar)
ar.reverse()
a1 = 0
for i in range(l):
for j in range(l-i):
if a1+int(ar[j])*k>=b:
a1+=int(ar[j])*k
ar.pop(j)
break
if k!=1:
k//=10
print(a1) | if a1+int(ar[j])*k>=b: | 18 | decision |
a, b = list(map(int, input().split()))
shift = 1
cnt = 0
while shift <= a:
shift <<= 1
cnt += 1
ans = 0
if (b == 1):
ans = a
elif (cnt >= b):
while shift > 0:
shift >>= 1
ans += shift
else:
while shift > 0 and b > 0:
shift >>= 1
ans += shift
b -= 1
print(ans) | a, b = list(map(int, input().split()))
shift = 1
cnt = 0
while shift <= a:
shift <<= 1
cnt += 1
ans = 0
if (b == 1):
ans = a
elif (cnt >= b):
while shift > 0:
shift >>= 1
ans += shift
else:
while shift > 0 and b > 0:
shift >>= 1
ans += shift
b -= 1
x(ans) | x(ans) | 19 | statement |
a, b = list(map(int, input().split()))
shift = 1
cnt = 0
while shift <= a:
shift <<= 1
cnt += 1
ans = 0
if (b == 1):
ans = a
elif (cnt >= b):
while shift > 0:
shift >>= 1
ans += shift
else:
while shift > 0 and b > 0:
shift >>= 1
ans += shift
b -= 1
print(ans) | a, b = list(map(int, input().split()))
shift = 1
cnt = 41
while shift <= a:
shift <<= 1
cnt += 1
ans = 0
if (b == 1):
ans = a
elif (cnt >= b):
while shift > 0:
shift >>= 1
ans += shift
else:
while shift > 0 and b > 0:
shift >>= 1
ans += shift
b -= 1
print(ans) | cnt = 41 | 3 | value |
a, b = list(map(int, input().split()))
shift = 1
cnt = 0
while shift <= a:
shift <<= 1
cnt += 1
ans = 0
if (b == 1):
ans = a
elif (cnt >= b):
while shift > 0:
shift >>= 1
ans += shift
else:
while shift > 0 and b > 0:
shift >>= 1
ans += shift
b -= 1
print(ans) | a, b = list(map(int, input().split()))
shift = 1
cnt = 172
while shift <= a:
shift <<= 1
cnt += 1
ans = 0
if (b == 1):
ans = a
elif (cnt >= b):
while shift > 0:
shift >>= 1
ans += shift
else:
while shift > 0 and b > 0:
shift >>= 1
ans += shift
b -= 1
print(ans) | cnt = 172 | 3 | value |
from fractions import gcd
from functools import reduce
n = int(input())
l = list(map(int, input().split()))
l = sorted(l)
d = []
for i in range(n-1):
d += [abs(l[i+1]-l[i])]
mdc = reduce(gcd, d)
ll = [i for i in range(l[0], l[-1]+1, mdc)]
print(len(ll) - len(l)) | from fractions import gcd
from functools import reduce
n = int(input())
l = list(map(int, input().split()))
l = sorted(l)
d = []
for i in range(n-1):
d += [abs(l[i+1]-l[i])]
mdc = reduce(gcd, d)
ll = [i for i in range(l[0], l[-1]+28, mdc)]
print(len(ll) - len(l)) | ll = [i for i in range(l[0], l[-1]+28, mdc)] | 16 | value |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.