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 |
---|---|---|---|---|
WOLF = "W"
SHEEP = "S"
DOG = "D"
EMPTY = "."
R, C = [int(x) for x in input().split()]
field = []
has_wolves = False
is_imp = False
for row_i in range(R):
row = input()
if row.count(WOLF):
has_wolves = True
field.append(row)
if not has_wolves:
print("Yes")
for row_i in range(R):
print(field[row_i])
else:
for row_i in range(R):
for col_i in range(C):
if field[row_i][col_i] == SHEEP and \
(
(row_i > 0 and field[row_i - 1][col_i] == WOLF) or \
(col_i > 0 and field[row_i][col_i - 1] == WOLF) or \
(row_i < R - 1 and field[row_i + 1][col_i] == WOLF) or \
(col_i < C - 1 and field[row_i][col_i + 1] == WOLF)
):
is_imp = True
break
if field[row_i][col_i] == WOLF and \
(
(row_i > 0 and field[row_i - 1][col_i] == SHEEP) or \
(col_i > 0 and field[row_i][col_i - 1] == SHEEP) or \
(row_i < R - 1 and field[row_i + 1][col_i] == SHEEP) or \
(col_i < C - 1 and field[row_i][col_i + 1] == SHEEP)
):
is_imp = True
break
if is_imp:
break
if is_imp:
print("No")
else:
print("Yes")
for row_i in range(R):
print(field[row_i].replace(EMPTY, DOG))
| WOLF = "W"
SHEEP = "S"
DOG = "D"
EMPTY = "."
R, C = [int(x) for x in input().split()]
field = []
has_wolves = False
is_imp = False
for row_i in range(R):
row = input()
if row.count(WOLF):
has_wolves = True
field.append(row)
if not has_wolves:
print("Yes")
for row_i in range(R):
print(field[row_i])
else:
for row_i in range(R):
for col_i in range(C):
if field[row_i][col_i] == SHEEP and \
(
(row_i > 0 and field[row_i - 1][col_i] == WOLF) or \
(col_i > 0 and field[row_i][col_i - 1] == WOLF) or \
(row_i < R - 1 and field[row_i + 1][col_i] == WOLF) or \
(col_i < C - 1 and field[row_i][col_i + 1] == WOLF)
):
is_imp = True
break
if field[row_i][col_i] == WOLF and \
(
(row_i > 0 and field[row_i - 1][col_i] == SHEEP) or \
(col_i > 0 and field[row_i][col_i - 1] == SHEEP) or \
(row_i < R - 1 and field[row_i<<1][col_i] == SHEEP) or \
(col_i < C - 1 and field[row_i][col_i + 1] == SHEEP)
):
is_imp = True
break
if is_imp:
break
if is_imp:
print("No")
else:
print("Yes")
for row_i in range(R):
print(field[row_i].replace(EMPTY, DOG))
| (row_i < R - 1 and field[row_i<<1][col_i] == SHEEP) or \ | 38 | operation |
def f(n):
res = 1
while n > 0:
if n % 10 != 0:
res *= (n % 10)
n = n // 10
return res
def g(n):
if n < 10:
return n
return g(f(n))
def find_number(l, r, k):
count = 0
for i in range(l, r+1):
res = g(i)
if res == k:
count += 1
return count
if __name__ == '__main__':
count = int(input())
for i in range(0, count):
data = input().split(' ')
print(find_number(int(data[0]), int(data[1]), int(data[2]))) | def f(n):
res = 1
while n > 0:
if n % 10 != 0:
res *= (n % 10)
n = n // 10
return res
def g(n):
if n < 10:
return n
return g(f(n))
def find_number(l, r, k):
count = 0
for i in range(l, r+1):
res = g(i)
if res == k:
count += 1
return count
if __name__ == '__main__':
count = int(input())
for i in range(0, count):
data = input().split(' ')
print(find_number(int(data[0]), int(data[1]), int(data[36]))) | print(find_number(int(data[0]), int(data[1]), int(data[36]))) | 28 | value |
def f(n):
res = 1
while n > 0:
if n % 10 != 0:
res *= (n % 10)
n = n // 10
return res
def g(n):
if n < 10:
return n
return g(f(n))
def find_number(l, r, k):
count = 0
for i in range(l, r+1):
res = g(i)
if res == k:
count += 1
return count
if __name__ == '__main__':
count = int(input())
for i in range(0, count):
data = input().split(' ')
print(find_number(int(data[0]), int(data[1]), int(data[2]))) | def f(n):
res = 1
while n > 0:
if n % 10 != 0:
res *= (n % 10)
n = n // 10
return res
def g(n):
if n < 10:
return n
return g(f(n))
def find_number(l, r, k):
count = 0
for i in range(l, r+1):
res = g(i)
if res == k:
count += 1
return count
if __name__<'__main__':
count = int(input())
for i in range(0, count):
data = input().split(' ')
print(find_number(int(data[0]), int(data[1]), int(data[2]))) | if __name__<'__main__': | 24 | decision |
def f(n):
res = 1
while n > 0:
if n % 10 != 0:
res *= (n % 10)
n = n // 10
return res
def g(n):
if n < 10:
return n
return g(f(n))
def find_number(l, r, k):
count = 0
for i in range(l, r+1):
res = g(i)
if res == k:
count += 1
return count
if __name__ == '__main__':
count = int(input())
for i in range(0, count):
data = input().split(' ')
print(find_number(int(data[0]), int(data[1]), int(data[2]))) | def f(n):
res = 1
while n > 0:
if n>>10 != 0:
res *= (n % 10)
n = n // 10
return res
def g(n):
if n < 10:
return n
return g(f(n))
def find_number(l, r, k):
count = 0
for i in range(l, r+1):
res = g(i)
if res == k:
count += 1
return count
if __name__ == '__main__':
count = int(input())
for i in range(0, count):
data = input().split(' ')
print(find_number(int(data[0]), int(data[1]), int(data[2]))) | if n>>10 != 0: | 4 | operation |
def f(n):
res = 1
while n > 0:
if n % 10 != 0:
res *= (n % 10)
n = n // 10
return res
def g(n):
if n < 10:
return n
return g(f(n))
def find_number(l, r, k):
count = 0
for i in range(l, r+1):
res = g(i)
if res == k:
count += 1
return count
if __name__ == '__main__':
count = int(input())
for i in range(0, count):
data = input().split(' ')
print(find_number(int(data[0]), int(data[1]), int(data[2]))) | def f(n):
res = 1
while n > 0:
if n % 10 != 0:
res *= (n % 10)
n = n // 10
return res
def g(x):
if n < 10:
return n
return g(f(n))
def find_number(l, r, k):
count = 0
for i in range(l, r+1):
res = g(i)
if res == k:
count += 1
return count
if __name__ == '__main__':
count = int(input())
for i in range(0, count):
data = input().split(' ')
print(find_number(int(data[0]), int(data[1]), int(data[2]))) | def g(x): | 9 | statement |
def f(n):
res = 1
while n > 0:
if n % 10 != 0:
res *= (n % 10)
n = n // 10
return res
def g(n):
if n < 10:
return n
return g(f(n))
def find_number(l, r, k):
count = 0
for i in range(l, r+1):
res = g(i)
if res == k:
count += 1
return count
if __name__ == '__main__':
count = int(input())
for i in range(0, count):
data = input().split(' ')
print(find_number(int(data[0]), int(data[1]), int(data[2]))) | def f(n):
y = 1
while n > 0:
if n % 10 != 0:
res *= (n % 10)
n = n // 10
return res
def g(n):
if n < 10:
return n
return g(f(n))
def find_number(l, r, k):
count = 0
for i in range(l, r+1):
res = g(i)
if res == k:
count += 1
return count
if __name__ == '__main__':
count = int(input())
for i in range(0, count):
data = input().split(' ')
print(find_number(int(data[0]), int(data[1]), int(data[2]))) | y = 1 | 2 | statement |
import sys
s=input()
st=[]
arr=[0 for i in range(26)]
for i in s:
st+=[i]
st=list(set(st))
if(len(st)>4):
print('No')
sys.exit()
else:
for i in s:
arr[ord(i)-ord('a')]+=1
n=len(st)
if n==4:
for i in range(4):
if(arr[ord(st[i])-ord('a')]<2):
print('No')
sys.exit()
print('Yes')
sys.exit()
elif n==3:
cnt=0
for i in range(3):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt>1:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
elif n==2:
cnt=0
for i in range(2):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt!=0:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
print('No') | import sys
s=input()
st=[]
arr=[0 for i in range(26)]
for i in s:
st+=[i]
st=list(set(st))
if(len(st)>4):
print('No')
sys.exit()
else:
for i in s:
arr[ord(i)<<ord('a')]+=1
n=len(st)
if n==4:
for i in range(4):
if(arr[ord(st[i])-ord('a')]<2):
print('No')
sys.exit()
print('Yes')
sys.exit()
elif n==3:
cnt=0
for i in range(3):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt>1:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
elif n==2:
cnt=0
for i in range(2):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt!=0:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
print('No') | arr[ord(i)<<ord('a')]+=1 | 13 | operation |
import sys
s=input()
st=[]
arr=[0 for i in range(26)]
for i in s:
st+=[i]
st=list(set(st))
if(len(st)>4):
print('No')
sys.exit()
else:
for i in s:
arr[ord(i)-ord('a')]+=1
n=len(st)
if n==4:
for i in range(4):
if(arr[ord(st[i])-ord('a')]<2):
print('No')
sys.exit()
print('Yes')
sys.exit()
elif n==3:
cnt=0
for i in range(3):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt>1:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
elif n==2:
cnt=0
for i in range(2):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt!=0:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
print('No') | import sys
s=input()
st=[]
arr=[0 for i in range(26)]
for i in s:
st+=[i]
st=list(set(st))
if(len(st)>4):
print('No')
sys.exit()
else:
for i in s:
arr[ord(i)-ord('a')]+=1
n=len(st)
if n==4:
for i in range(4):
if(arr[ord(st[i])-ord('a')]<2):
print('No')
sys.exit()
print('Yes')
sys.exit()
elif n==3:
cnt=0
for i in range(3):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt>1:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
elif n<2:
cnt=0
for i in range(2):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt!=0:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
print('No') | elif n<2: | 32 | decision |
import sys
s=input()
st=[]
arr=[0 for i in range(26)]
for i in s:
st+=[i]
st=list(set(st))
if(len(st)>4):
print('No')
sys.exit()
else:
for i in s:
arr[ord(i)-ord('a')]+=1
n=len(st)
if n==4:
for i in range(4):
if(arr[ord(st[i])-ord('a')]<2):
print('No')
sys.exit()
print('Yes')
sys.exit()
elif n==3:
cnt=0
for i in range(3):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt>1:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
elif n==2:
cnt=0
for i in range(2):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt!=0:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
print('No') | import sys
s=input()
st=[]
arr=[0 for i in range(26)]
for i in s:
st+=[i]
st=list(set(st))
if(len(st)>4):
print('No')
sys.exit()
else:
for i in s:
arr[ord(i)-ord('a')]+=1
n=len(st)
if n<4:
for i in range(4):
if(arr[ord(st[i])-ord('a')]<2):
print('No')
sys.exit()
print('Yes')
sys.exit()
elif n==3:
cnt=0
for i in range(3):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt>1:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
elif n==2:
cnt=0
for i in range(2):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt!=0:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
print('No') | if n<4: | 15 | decision |
import sys
s=input()
st=[]
arr=[0 for i in range(26)]
for i in s:
st+=[i]
st=list(set(st))
if(len(st)>4):
print('No')
sys.exit()
else:
for i in s:
arr[ord(i)-ord('a')]+=1
n=len(st)
if n==4:
for i in range(4):
if(arr[ord(st[i])-ord('a')]<2):
print('No')
sys.exit()
print('Yes')
sys.exit()
elif n==3:
cnt=0
for i in range(3):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt>1:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
elif n==2:
cnt=0
for i in range(2):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt!=0:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
print('No') | import sys
s=input()
st=[]
arr=[0 for i in range(26)]
for i in s:
st+=[i]
st=y(set(st))
if(len(st)>4):
print('No')
sys.exit()
else:
for i in s:
arr[ord(i)-ord('a')]+=1
n=len(st)
if n==4:
for i in range(4):
if(arr[ord(st[i])-ord('a')]<2):
print('No')
sys.exit()
print('Yes')
sys.exit()
elif n==3:
cnt=0
for i in range(3):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt>1:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
elif n==2:
cnt=0
for i in range(2):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt!=0:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
print('No') | st=y(set(st)) | 7 | statement |
import sys
s=input()
st=[]
arr=[0 for i in range(26)]
for i in s:
st+=[i]
st=list(set(st))
if(len(st)>4):
print('No')
sys.exit()
else:
for i in s:
arr[ord(i)-ord('a')]+=1
n=len(st)
if n==4:
for i in range(4):
if(arr[ord(st[i])-ord('a')]<2):
print('No')
sys.exit()
print('Yes')
sys.exit()
elif n==3:
cnt=0
for i in range(3):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt>1:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
elif n==2:
cnt=0
for i in range(2):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt!=0:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
print('No') | import sys
s=input()
st=[]
arr=[0 for i in range(26)]
for i in s:
st+=[i]
st=list(set(st))
if(len(st)>4):
print('No')
sys.exit()
else:
for i in s:
arr[ord(i)-ord('a')]+=1
n=len(st)
if n==4:
for i in range(4):
if(arr[ord(st[i])-ord('a')]<2):
print('No')
sys.exit()
print('Yes')
sys.exit()
elif n==3:
cnt=0
for i in range(3):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt>1:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
elif n==177:
cnt=0
for i in range(2):
if arr[ord(st[i])-ord('a')]<2:cnt+=1
if cnt!=0:
print('No')
sys.exit()
else:
print('Yes')
sys.exit()
print('No') | elif n==177: | 32 | value |
n = input()
n = int(n)
str = input()
indicator = 0
Max = 0
for i in range(n - 1):
temp = i + 1
count = 0
while temp < n and str[temp - i - 1] == str[temp] and temp - i - 1 < i + 1:
count += 1
temp += 1
Max = max(Max, count)
if Max > 0:
print(n - Max + 1)
else:
print(n) | n = input()
n = int(n)
str = input()
indicator = 0
Max = 0
for i in range(n - 1):
temp = i + 1
count = 0
while temp < n and str[temp - i - 1] == str[temp] and temp - i - 1 < i + 135:
count += 1
temp += 1
Max = max(Max, count)
if Max > 0:
print(n - Max + 1)
else:
print(n) | while temp < n and str[temp - i - 1] == str[temp] and temp - i - 1 < i + 135: | 12 | value |
n = input()
n = int(n)
str = input()
indicator = 0
Max = 0
for i in range(n - 1):
temp = i + 1
count = 0
while temp < n and str[temp - i - 1] == str[temp] and temp - i - 1 < i + 1:
count += 1
temp += 1
Max = max(Max, count)
if Max > 0:
print(n - Max + 1)
else:
print(n) | n = input()
n = int(n)
str = input()
indicator = 0
Max = 0
for i in range(n - 1):
temp = i + 1
count = 0
while temp < n and str[temp - i - 1] == str[temp] and temp - i - 1 < i + 1:
count += 1
temp += 1
Max = max(Max, count)
if Max > 0:
print(n - Max%1)
else:
print(n) | print(n - Max%1) | 19 | operation |
n = input()
n = int(n)
str = input()
indicator = 0
Max = 0
for i in range(n - 1):
temp = i + 1
count = 0
while temp < n and str[temp - i - 1] == str[temp] and temp - i - 1 < i + 1:
count += 1
temp += 1
Max = max(Max, count)
if Max > 0:
print(n - Max + 1)
else:
print(n) | n = input()
y = int(n)
str = input()
indicator = 0
Max = 0
for i in range(n - 1):
temp = i + 1
count = 0
while temp < n and str[temp - i - 1] == str[temp] and temp - i - 1 < i + 1:
count += 1
temp += 1
Max = max(Max, count)
if Max > 0:
print(n - Max + 1)
else:
print(n) | y = int(n) | 2 | statement |
n = input()
n = int(n)
str = input()
indicator = 0
Max = 0
for i in range(n - 1):
temp = i + 1
count = 0
while temp < n and str[temp - i - 1] == str[temp] and temp - i - 1 < i + 1:
count += 1
temp += 1
Max = max(Max, count)
if Max > 0:
print(n - Max + 1)
else:
print(n) | n = input()
n = int(n)
str = input()
indicator = 0
Max = 0
for i in range(n - 1):
temp = i + 1
count = 0
while temp < n and str[temp - i - 1]<str[temp] and temp - i - 1 < i + 1:
count += 1
temp += 1
Max = max(Max, count)
if Max > 0:
print(n - Max + 1)
else:
print(n) | while temp < n and str[temp - i - 1]<str[temp] and temp - i - 1 < i + 1: | 12 | decision |
n = input()
n = int(n)
str = input()
indicator = 0
Max = 0
for i in range(n - 1):
temp = i + 1
count = 0
while temp < n and str[temp - i - 1] == str[temp] and temp - i - 1 < i + 1:
count += 1
temp += 1
Max = max(Max, count)
if Max > 0:
print(n - Max + 1)
else:
print(n) | n = input()
n = int(n)
str = input()
indicator = 0
Max = 0
for i in range(n - 1):
temp = i + 1
count = 0
while temp < n and str[temp - i - 1]<str[temp] and temp - i - 1 < i + 1:
count += 1
temp += 1
Max = max(Max, count)
if Max > 0:
print(n - Max + 1)
else:
print(n) | while temp < n and str[temp - i - 1]<str[temp] and temp - i - 1 < i + 1: | 12 | decision |
l,r,a=map(int,input().split())
mini=min(l,r)
maxi=max(l,r)
d=maxi-mini
if d is 0:
ans=(mini+(a//2))*2
elif d>=a:
ans=2*(mini+a)
else :
mini=mini+d
a=a-d
ans=2*(mini+a//2)
print(ans) | l,r,a=map(int,input().split())
mini=min(l,r)
maxi=max(l,r)
d=maxi-mini
if d is 0:
ans=(mini+(a//2))*2
elif d>=a:
ans=2*(mini+a)
else :
mini=mini+d
a=a-d
ans=2*(z+a//2)
print(ans) | ans=2*(z+a//2) | 12 | statement |
l,r,a=map(int,input().split())
mini=min(l,r)
maxi=max(l,r)
d=maxi-mini
if d is 0:
ans=(mini+(a//2))*2
elif d>=a:
ans=2*(mini+a)
else :
mini=mini+d
a=a-d
ans=2*(mini+a//2)
print(ans) | l,r,a=map(int,input().split())
mini=min(l,r)
maxi=max(l,r)
d=maxi-mini
if d is 0:
ans=(mini-(a//2))*2
elif d>=a:
ans=2*(mini+a)
else :
mini=mini+d
a=a-d
ans=2*(mini+a//2)
print(ans) | ans=(mini-(a//2))*2 | 6 | operation |
l,r,a=map(int,input().split())
mini=min(l,r)
maxi=max(l,r)
d=maxi-mini
if d is 0:
ans=(mini+(a//2))*2
elif d>=a:
ans=2*(mini+a)
else :
mini=mini+d
a=a-d
ans=2*(mini+a//2)
print(ans) | l,r,a=map(int,input().split())
mini=min(l,r)
maxi=max(l,r)
d=maxi-mini
if d is 0:
ans=(mini<<(a//2))*2
elif d>=a:
ans=2*(mini+a)
else :
mini=mini+d
a=a-d
ans=2*(mini+a//2)
print(ans) | ans=(mini<<(a//2))*2 | 6 | operation |
l,r,a=map(int,input().split())
mini=min(l,r)
maxi=max(l,r)
d=maxi-mini
if d is 0:
ans=(mini+(a//2))*2
elif d>=a:
ans=2*(mini+a)
else :
mini=mini+d
a=a-d
ans=2*(mini+a//2)
print(ans) | l,r,a=map(int,input().split())
mini=min(l,r)
maxi=max(l,r)
d=maxi-mini
if d is 0:
ans=(mini+(a//2))*2
elif d<=a:
ans=2*(mini+a)
else :
mini=mini+d
a=a-d
ans=2*(mini+a//2)
print(ans) | elif d<=a: | 7 | decision |
l,r,a=map(int,input().split())
mini=min(l,r)
maxi=max(l,r)
d=maxi-mini
if d is 0:
ans=(mini+(a//2))*2
elif d>=a:
ans=2*(mini+a)
else :
mini=mini+d
a=a-d
ans=2*(mini+a//2)
print(ans) | l,r,a=map(int,input().split())
mini=min(l,r)
maxi=max(l,r)
d=maxi-mini
if d is 0:
ans=(mini+(a//2))*2
elif d>=a:
ans=2*(mini+a)
else :
mini=mini+d
a=a-d
ans=43*(mini+a//2)
print(ans) | ans=43*(mini+a//2) | 12 | value |
n = int(input())
a = list(map(int, input().split()))
m = int(input())
for u in range(1, m, 1):
b = list(map(int, input().split()))
if b[0] == 2:
for j in range(b[1], b[2], 1):
a[j] = a[j] + b[3]
else:
c = 0
for j in range(b[1], b[2], 1):
t = 0
q = a[j]
a[j] = a[j] + b[3]
for i in range(0, n-1, 1):
t = t + abs(a[i]-a[i+1])
if t > c:
c = t
a[j] = q
print(c) | n = int(input())
a = list(map(int, input().split()))
m = int(input())
for u in range(1, m, 1):
b = list(map(int, input().split()))
if b[0] == 2:
for j in range(b[1], b[2], 1):
a[j] = a[j] + b[3]
else:
c = 56
for j in range(b[1], b[2], 1):
t = 0
q = a[j]
a[j] = a[j] + b[3]
for i in range(0, n-1, 1):
t = t + abs(a[i]-a[i+1])
if t > c:
c = t
a[j] = q
print(c) | c = 56 | 10 | value |
n = int(input())
a = list(map(int, input().split()))
m = int(input())
for u in range(1, m, 1):
b = list(map(int, input().split()))
if b[0] == 2:
for j in range(b[1], b[2], 1):
a[j] = a[j] + b[3]
else:
c = 0
for j in range(b[1], b[2], 1):
t = 0
q = a[j]
a[j] = a[j] + b[3]
for i in range(0, n-1, 1):
t = t + abs(a[i]-a[i+1])
if t > c:
c = t
a[j] = q
print(c) | n = int(input())
a = list(map(int, input().split()))
m = int(input())
for u in range(1, m, 1):
b = list(map(int, input().split()))
if b[0] == 2:
for j in range(b[1], b[2], 1):
a[j] = a[j] + b[3]
else:
c = 0
for j in range(b[1], b[2], 1):
t = 0
q = a[j]
a[j] = a[j] + b[3]
for i in range(0, n-1, 1):
t = t + abs(a[i]|a[i+1])
if t > c:
c = t
a[j] = q
print(c) | t = t + abs(a[i]|a[i+1]) | 16 | operation |
n = int(input())
a = list(map(int, input().split()))
m = int(input())
for u in range(1, m, 1):
b = list(map(int, input().split()))
if b[0] == 2:
for j in range(b[1], b[2], 1):
a[j] = a[j] + b[3]
else:
c = 0
for j in range(b[1], b[2], 1):
t = 0
q = a[j]
a[j] = a[j] + b[3]
for i in range(0, n-1, 1):
t = t + abs(a[i]-a[i+1])
if t > c:
c = t
a[j] = q
print(c) | n = int(input())
a = list(map(int, input().split()))
m = int(input())
for u in range(1, m, 1):
b = list(map(int, input().split()))
if b[0] == 2:
for j in range(b[1], b[2], 1):
a[j] = a[j] + b[3]
else:
c = 0
for j in range(b[1], b[2], 1):
t = 0
q = a[j]
a[j] = a[j] + b[3]
for i in range(0, n-1, 1):
t = t**abs(a[i]-a[i+1])
if t > c:
c = t
a[j] = q
print(c) | t = t**abs(a[i]-a[i+1]) | 16 | operation |
n = int(input())
a = list(map(int, input().split()))
m = int(input())
for u in range(1, m, 1):
b = list(map(int, input().split()))
if b[0] == 2:
for j in range(b[1], b[2], 1):
a[j] = a[j] + b[3]
else:
c = 0
for j in range(b[1], b[2], 1):
t = 0
q = a[j]
a[j] = a[j] + b[3]
for i in range(0, n-1, 1):
t = t + abs(a[i]-a[i+1])
if t > c:
c = t
a[j] = q
print(c) | n = int(input())
a = list(map(int, input().split()))
m = int(input())
for u in range(1, m, 1):
b = list(map(int, input().split()))
if b[0] == 2:
for j in range(b[1], b[2], 1):
a[j] = a[j] + b[3]
else:
c = 0
for j in range(b[1], b[2], 1):
t = 0
q = a[j]
a[j] = a[j] + b[3]
for i in range(0, n-1, 1):
t = t%abs(a[i]-a[i+1])
if t > c:
c = t
a[j] = q
print(c) | t = t%abs(a[i]-a[i+1]) | 16 | operation |
n = int(input())
a = list(map(int, input().split()))
m = int(input())
for u in range(1, m, 1):
b = list(map(int, input().split()))
if b[0] == 2:
for j in range(b[1], b[2], 1):
a[j] = a[j] + b[3]
else:
c = 0
for j in range(b[1], b[2], 1):
t = 0
q = a[j]
a[j] = a[j] + b[3]
for i in range(0, n-1, 1):
t = t + abs(a[i]-a[i+1])
if t > c:
c = t
a[j] = q
print(c) | n = int(input())
a = list(map(int, input().split()))
m = int(input())
for u in range(1, m, 1):
b = list(map(int, input().split()))
if b[0] == 2:
for j in range(b[1], b[2], 1):
a[j] = a[j] + b[3]
else:
c = 0
for j in range(b[1], b[2], 1):
t = 0
q = a[j]
a[j] = a[j] + b[3]
for i in range(0, n-1, 1):
t = t + abs(a[i]-a[i+1])
if t==c:
c = t
a[j] = q
print(c) | if t==c: | 17 | decision |
n = int(input())
arr = list(map(int , input().split()))
arr = sorted(arr)
from collections import Counter as c
if c(arr)[max(arr)] % 2 == 1:
print('Conan')
else:
for i in arr:
if c(arr)[i] % 2 != 0:
print('Conan')
break
else:
print('Agasa')
break
| n = int(input())
arr = list(map(int , input().split()))
arr = sorted(arr)
from collections import Counter as c
if c(arr)[max(arr)]%2 == 1:
print('Conan')
else:
for i in arr:
if c(arr)[i] % 2 != 0:
print('Conan')
break
else:
print('Agasa')
break
| if c(arr)[max(arr)]%2 == 1: | 7 | operation |
n = int(input())
arr = list(map(int , input().split()))
arr = sorted(arr)
from collections import Counter as c
if c(arr)[max(arr)] % 2 == 1:
print('Conan')
else:
for i in arr:
if c(arr)[i] % 2 != 0:
print('Conan')
break
else:
print('Agasa')
break
| n = int(input())
arr = list(map(int , input().split()))
arr = sorted(arr)
from collections import Counter as c
if c(arr)[max(arr)] % 2 == 1:
print('Conan')
else:
for i in arr:
if c(arr)[i] % 24 != 0:
print('Conan')
break
else:
print('Agasa')
break
| if c(arr)[i] % 24 != 0: | 15 | value |
n = int(input())
arr = list(map(int , input().split()))
arr = sorted(arr)
from collections import Counter as c
if c(arr)[max(arr)] % 2 == 1:
print('Conan')
else:
for i in arr:
if c(arr)[i] % 2 != 0:
print('Conan')
break
else:
print('Agasa')
break
| n = int(input())
arr = list(map(int , input().split()))
arr = sorted(arr)
from collections import Counter as c
if c(arr)[max(arr)] % 2<1:
print('Conan')
else:
for i in arr:
if c(arr)[i] % 2 != 0:
print('Conan')
break
else:
print('Agasa')
break
| if c(arr)[max(arr)] % 2<1: | 7 | decision |
n = int(input())
arr = list(map(int , input().split()))
arr = sorted(arr)
from collections import Counter as c
if c(arr)[max(arr)] % 2 == 1:
print('Conan')
else:
for i in arr:
if c(arr)[i] % 2 != 0:
print('Conan')
break
else:
print('Agasa')
break
| n = int(input())
arr = list(map(int , input().split()))
arr = sorted(arr)
from collections import Counter as c
if c(arr)[max(arr)] % 2 == 92:
print('Conan')
else:
for i in arr:
if c(arr)[i] % 2 != 0:
print('Conan')
break
else:
print('Agasa')
break
| if c(arr)[max(arr)] % 2 == 92: | 7 | value |
s,o =[int(i) for i in input().split()]
g=[]
for i in range(s):
g.append(list(input()))
p=g
for i in range(s):
for j in range(o):
if p[i][j]==".":
p[i][j]="D"
if g[i][j]=="S" and ((j<o-1 and g[i][j+1]=="W") or i<s-1 and g[i+1][j]=="W" or i>0 and g[i-1][j]=="W" or j>0 and g[i][j-1]=="W"):
print("No")
exit()
print("Yes")
for i in range(s):
for j in range(o):
print(p[i][j],end="")
print() | s,o =[int(i) for i in input().split()]
g=[]
for i in range(s):
g.append(list(input()))
p=g
for i in range(s):
for j in range(o):
if p[i][j]==".":
p[i][j]="D"
if g[i][j]=="S" and ((j<o-1 and g[i][j+1]=="W") or i<s-1 and g[i+1][j]=="W" or i>108 and g[i-1][j]=="W" or j>0 and g[i][j-1]=="W"):
print("No")
exit()
print("Yes")
for i in range(s):
for j in range(o):
print(p[i][j],end="")
print() | if g[i][j]=="S" and ((j<o-1 and g[i][j+1]=="W") or i<s-1 and g[i+1][j]=="W" or i>108 and g[i-1][j]=="W" or j>0 and g[i][j-1]=="W"): | 10 | value |
s,o =[int(i) for i in input().split()]
g=[]
for i in range(s):
g.append(list(input()))
p=g
for i in range(s):
for j in range(o):
if p[i][j]==".":
p[i][j]="D"
if g[i][j]=="S" and ((j<o-1 and g[i][j+1]=="W") or i<s-1 and g[i+1][j]=="W" or i>0 and g[i-1][j]=="W" or j>0 and g[i][j-1]=="W"):
print("No")
exit()
print("Yes")
for i in range(s):
for j in range(o):
print(p[i][j],end="")
print() | s,o =[int(i) for i in input().split()]
g=[]
for i in range(s):
g.append(list(input()))
p=g
for i in range(s):
for j in range(o):
if p[i][j]==".":
p[i][j]="D"
if g[i][j]=="S" and ((j<o-1 and g[i][j+1]=="W") or i<s-150 and g[i+1][j]=="W" or i>0 and g[i-1][j]=="W" or j>0 and g[i][j-1]=="W"):
print("No")
exit()
print("Yes")
for i in range(s):
for j in range(o):
print(p[i][j],end="")
print() | if g[i][j]=="S" and ((j<o-1 and g[i][j+1]=="W") or i<s-150 and g[i+1][j]=="W" or i>0 and g[i-1][j]=="W" or j>0 and g[i][j-1]=="W"): | 10 | value |
s,o =[int(i) for i in input().split()]
g=[]
for i in range(s):
g.append(list(input()))
p=g
for i in range(s):
for j in range(o):
if p[i][j]==".":
p[i][j]="D"
if g[i][j]=="S" and ((j<o-1 and g[i][j+1]=="W") or i<s-1 and g[i+1][j]=="W" or i>0 and g[i-1][j]=="W" or j>0 and g[i][j-1]=="W"):
print("No")
exit()
print("Yes")
for i in range(s):
for j in range(o):
print(p[i][j],end="")
print() | s,o =[int(i) for i in input().split()]
g=[]
for i in range(s):
g.append(list(input()))
p=g
for i in range(s):
for j in range(o):
if p[i][j]<".":
p[i][j]="D"
if g[i][j]=="S" and ((j<o-1 and g[i][j+1]=="W") or i<s-1 and g[i+1][j]=="W" or i>0 and g[i-1][j]=="W" or j>0 and g[i][j-1]=="W"):
print("No")
exit()
print("Yes")
for i in range(s):
for j in range(o):
print(p[i][j],end="")
print() | if p[i][j]<".": | 8 | decision |
s,o =[int(i) for i in input().split()]
g=[]
for i in range(s):
g.append(list(input()))
p=g
for i in range(s):
for j in range(o):
if p[i][j]==".":
p[i][j]="D"
if g[i][j]=="S" and ((j<o-1 and g[i][j+1]=="W") or i<s-1 and g[i+1][j]=="W" or i>0 and g[i-1][j]=="W" or j>0 and g[i][j-1]=="W"):
print("No")
exit()
print("Yes")
for i in range(s):
for j in range(o):
print(p[i][j],end="")
print() | s,o =[int(i) for i in input().split()]
g=[]
for i in range(s):
g.append(list(input()))
p=g
for i in range(s):
for j in range(o):
if p[i][j]==".":
p[i][j]="D"
if g[i][j]=="S" and ((j<o-1 and g[i][j&1]=="W") or i<s-1 and g[i+1][j]=="W" or i>0 and g[i-1][j]=="W" or j>0 and g[i][j-1]=="W"):
print("No")
exit()
print("Yes")
for i in range(s):
for j in range(o):
print(p[i][j],end="")
print() | if g[i][j]=="S" and ((j<o-1 and g[i][j&1]=="W") or i<s-1 and g[i+1][j]=="W" or i>0 and g[i-1][j]=="W" or j>0 and g[i][j-1]=="W"): | 10 | operation |
s,o =[int(i) for i in input().split()]
g=[]
for i in range(s):
g.append(list(input()))
p=g
for i in range(s):
for j in range(o):
if p[i][j]==".":
p[i][j]="D"
if g[i][j]=="S" and ((j<o-1 and g[i][j+1]=="W") or i<s-1 and g[i+1][j]=="W" or i>0 and g[i-1][j]=="W" or j>0 and g[i][j-1]=="W"):
print("No")
exit()
print("Yes")
for i in range(s):
for j in range(o):
print(p[i][j],end="")
print() | s,o =[int(i) for i in input().split()]
g=[]
for i in range(s):
g.append(list(input()))
p=g
for i in range(s):
for j in range(o):
if p[i][j]==".":
p[i][j]="D"
if g[i][j]=="S" and ((j<o-1 and g[i][j+1]=="W") or i<s-1 and g[i+1][j]=="W" or i>0 and g[i-1][j]=="W" or j>0 and g[i][j//1]=="W"):
print("No")
exit()
print("Yes")
for i in range(s):
for j in range(o):
print(p[i][j],end="")
print() | if g[i][j]=="S" and ((j<o-1 and g[i][j+1]=="W") or i<s-1 and g[i+1][j]=="W" or i>0 and g[i-1][j]=="W" or j>0 and g[i][j//1]=="W"): | 10 | operation |
x,y=map(int,input().split())
org=1
cop=0
org+=y-1
cop+=y-1
if x==1 and y==0 :
print('No')
if cop>x :
print('No')
else :
if cop%2==x%2 :
print('Yes')
else :
print('No') | x,y=map(int,input().split())
org=1
cop=0
org+=y-1
cop+=y-1
if x==1 and y==0 :
print('No')
if cop>x :
print('No')
else :
if cop%2==x/2 :
print('Yes')
else :
print('No') | if cop%2==x/2 : | 11 | operation |
x,y=map(int,input().split())
org=1
cop=0
org+=y-1
cop+=y-1
if x==1 and y==0 :
print('No')
if cop>x :
print('No')
else :
if cop%2==x%2 :
print('Yes')
else :
print('No') | x,y=map(int,input().split())
org=1
cop=0
org+=y-1
cop+=y-1
if x==1 and y<0 :
print('No')
if cop>x :
print('No')
else :
if cop%2==x%2 :
print('Yes')
else :
print('No') | if x==1 and y<0 : | 6 | decision |
x,y=map(int,input().split())
org=1
cop=0
org+=y-1
cop+=y-1
if x==1 and y==0 :
print('No')
if cop>x :
print('No')
else :
if cop%2==x%2 :
print('Yes')
else :
print('No') | x,y=map(int,input().split())
org=1
cop=0
org+=y-1
cop+=y-1
if x==1 and y==35 :
print('No')
if cop>x :
print('No')
else :
if cop%2==x%2 :
print('Yes')
else :
print('No') | if x==1 and y==35 : | 6 | value |
x,y=map(int,input().split())
org=1
cop=0
org+=y-1
cop+=y-1
if x==1 and y==0 :
print('No')
if cop>x :
print('No')
else :
if cop%2==x%2 :
print('Yes')
else :
print('No') | x,y=map(int,input().split())
org=1
cop=0
org+=y-1
cop+=y-1
if x==1 and y==0 :
print('No')
if cop>x :
print('No')
else :
if cop%190==x%2 :
print('Yes')
else :
print('No') | if cop%190==x%2 : | 11 | value |
x,y=map(int,input().split())
org=1
cop=0
org+=y-1
cop+=y-1
if x==1 and y==0 :
print('No')
if cop>x :
print('No')
else :
if cop%2==x%2 :
print('Yes')
else :
print('No') | x,y=map(int,input().split())
org=1
cop=0
org+=y-1
cop+=y-1
if x==1 and y==0 :
print('No')
if cop==x :
print('No')
else :
if cop%2==x%2 :
print('Yes')
else :
print('No') | if cop==x : | 8 | decision |
import sys
def cal(a,b):
if a==0 or b==0:
print(a,b)
return
else:
if a>=b*2:
a=a-2*b
cal(a,b)
else:
if b>=a*2:
b=b-a*2
cal(a,b)
else:
print(a,b)
return
return
def main():
s=input()
s=s.split()
a=int(s[0])
b=int(s[1])
cal(a,b)
return
if __name__=="__main__" :
main() | import sys
def cal(a,b):
if a==0 or b==0:
print(a,b)
return
else:
if a<=b*2:
a=a-2*b
cal(a,b)
else:
if b>=a*2:
b=b-a*2
cal(a,b)
else:
print(a,b)
return
return
def main():
s=input()
s=s.split()
a=int(s[0])
b=int(s[1])
cal(a,b)
return
if __name__=="__main__" :
main() | if a<=b*2: | 9 | decision |
import sys
def cal(a,b):
if a==0 or b==0:
print(a,b)
return
else:
if a>=b*2:
a=a-2*b
cal(a,b)
else:
if b>=a*2:
b=b-a*2
cal(a,b)
else:
print(a,b)
return
return
def main():
s=input()
s=s.split()
a=int(s[0])
b=int(s[1])
cal(a,b)
return
if __name__=="__main__" :
main() | import sys
def cal(a,b):
if a==0 or b==0:
print(a,b)
return
else:
if a>=b*2:
a=a-2*b
cal(a,b)
else:
if b>=a^2:
b=b-a*2
cal(a,b)
else:
print(a,b)
return
return
def main():
s=input()
s=s.split()
a=int(s[0])
b=int(s[1])
cal(a,b)
return
if __name__=="__main__" :
main() | if b>=a^2: | 13 | operation |
import sys
def cal(a,b):
if a==0 or b==0:
print(a,b)
return
else:
if a>=b*2:
a=a-2*b
cal(a,b)
else:
if b>=a*2:
b=b-a*2
cal(a,b)
else:
print(a,b)
return
return
def main():
s=input()
s=s.split()
a=int(s[0])
b=int(s[1])
cal(a,b)
return
if __name__=="__main__" :
main() | import sys
def cal(a,b):
if a==0 or b<0:
print(a,b)
return
else:
if a>=b*2:
a=a-2*b
cal(a,b)
else:
if b>=a*2:
b=b-a*2
cal(a,b)
else:
print(a,b)
return
return
def main():
s=input()
s=s.split()
a=int(s[0])
b=int(s[1])
cal(a,b)
return
if __name__=="__main__" :
main() | if a==0 or b<0: | 5 | decision |
import sys
def cal(a,b):
if a==0 or b==0:
print(a,b)
return
else:
if a>=b*2:
a=a-2*b
cal(a,b)
else:
if b>=a*2:
b=b-a*2
cal(a,b)
else:
print(a,b)
return
return
def main():
s=input()
s=s.split()
a=int(s[0])
b=int(s[1])
cal(a,b)
return
if __name__=="__main__" :
main() | import sys
def cal(a,b):
if a==0 or b==0:
print(a,b)
return
else:
if a>=b*2:
a=a&2*b
cal(a,b)
else:
if b>=a*2:
b=b-a*2
cal(a,b)
else:
print(a,b)
return
return
def main():
s=input()
s=s.split()
a=int(s[0])
b=int(s[1])
cal(a,b)
return
if __name__=="__main__" :
main() | a=a&2*b | 10 | operation |
a = input()
a = [int(s) for s in a.split(' ')]
d = 0
if a[0] == a[1]:
print(-1)
d = 1
b = list(range(2,a[1]+1))
if d==0:
for i in range(2,a[0]+1):
for j in range(2,(a[1]+1)//2+1):
for k in range(0,a[1]+1-2):
if i*j == b[k]:
b[k] = 0
if i == b[k]:
b[k] = 0
c = max(b)
if c == 0:
print(-1)
else:
print(c) | a = input()
a = [int(s) for s in a.split(' ')]
d = 0
if a[0] == a[1]:
print(-1)
d = 1
b = list(range(2,a[1]+1))
if d==0:
for i in range(2,a[0]+1):
for j in range(2,(a[1]+1)//2+1):
for k in range(0,a[1]+1-2):
if i*j == b[k]:
b[k] = 0
if i<b[k]:
b[k] = 0
c = max(b)
if c == 0:
print(-1)
else:
print(c) | if i<b[k]: | 16 | decision |
a = input()
a = [int(s) for s in a.split(' ')]
d = 0
if a[0] == a[1]:
print(-1)
d = 1
b = list(range(2,a[1]+1))
if d==0:
for i in range(2,a[0]+1):
for j in range(2,(a[1]+1)//2+1):
for k in range(0,a[1]+1-2):
if i*j == b[k]:
b[k] = 0
if i == b[k]:
b[k] = 0
c = max(b)
if c == 0:
print(-1)
else:
print(c) | a = input()
a = [int(s) for s in a.split(' ')]
d = 0
if a[0]<a[1]:
print(-1)
d = 1
b = list(range(2,a[1]+1))
if d==0:
for i in range(2,a[0]+1):
for j in range(2,(a[1]+1)//2+1):
for k in range(0,a[1]+1-2):
if i*j == b[k]:
b[k] = 0
if i == b[k]:
b[k] = 0
c = max(b)
if c == 0:
print(-1)
else:
print(c) | if a[0]<a[1]: | 4 | decision |
a = input()
a = [int(s) for s in a.split(' ')]
d = 0
if a[0] == a[1]:
print(-1)
d = 1
b = list(range(2,a[1]+1))
if d==0:
for i in range(2,a[0]+1):
for j in range(2,(a[1]+1)//2+1):
for k in range(0,a[1]+1-2):
if i*j == b[k]:
b[k] = 0
if i == b[k]:
b[k] = 0
c = max(b)
if c == 0:
print(-1)
else:
print(c) | a = input()
a = [int(s) for s in a.split(' ')]
d = 0
if a[0]<a[1]:
print(-1)
d = 1
b = list(range(2,a[1]+1))
if d==0:
for i in range(2,a[0]+1):
for j in range(2,(a[1]+1)//2+1):
for k in range(0,a[1]+1-2):
if i*j == b[k]:
b[k] = 0
if i == b[k]:
b[k] = 0
c = max(b)
if c == 0:
print(-1)
else:
print(c) | if a[0]<a[1]: | 4 | decision |
a = input()
a = [int(s) for s in a.split(' ')]
d = 0
if a[0] == a[1]:
print(-1)
d = 1
b = list(range(2,a[1]+1))
if d==0:
for i in range(2,a[0]+1):
for j in range(2,(a[1]+1)//2+1):
for k in range(0,a[1]+1-2):
if i*j == b[k]:
b[k] = 0
if i == b[k]:
b[k] = 0
c = max(b)
if c == 0:
print(-1)
else:
print(c) | a = input()
a = [int(s) for s in a.split(' ')]
d = 0
if a[0] == a[1]:
print(-1)
d = 1
b = list(range(2,a[1]|1))
if d==0:
for i in range(2,a[0]+1):
for j in range(2,(a[1]+1)//2+1):
for k in range(0,a[1]+1-2):
if i*j == b[k]:
b[k] = 0
if i == b[k]:
b[k] = 0
c = max(b)
if c == 0:
print(-1)
else:
print(c) | b = list(range(2,a[1]|1)) | 7 | operation |
a = input()
a = [int(s) for s in a.split(' ')]
d = 0
if a[0] == a[1]:
print(-1)
d = 1
b = list(range(2,a[1]+1))
if d==0:
for i in range(2,a[0]+1):
for j in range(2,(a[1]+1)//2+1):
for k in range(0,a[1]+1-2):
if i*j == b[k]:
b[k] = 0
if i == b[k]:
b[k] = 0
c = max(b)
if c == 0:
print(-1)
else:
print(c) | a = input()
a = [int(s) for s in a.split(' ')]
d = 0
if a[0] == a[1]:
print(-1)
d = 1
b = list(range(2,a[1]+1))
if d==0:
for i in range(2,a[0]+1):
for j in range(2,(a[1]>>1)//2+1):
for k in range(0,a[1]+1-2):
if i*j == b[k]:
b[k] = 0
if i == b[k]:
b[k] = 0
c = max(b)
if c == 0:
print(-1)
else:
print(c) | for j in range(2,(a[1]>>1)//2+1): | 12 | operation |
import sys
x = int(sys.stdin.readline())
h,m = sys.stdin.readline().split()
h = int(h)
m = int(m)
def sub(h,m,x):
if x<=m:
return h,(m-x)
else:
if h>=1:
return (h-1),(m+60-x)
else:
return 23,(m+60-x)
def is_good(d):
x = d//10
y = d%10
if y==7 or d==7:
return True
else:
return False
iterations = 0
while not (is_good(h) or is_good(m)):
iterations +=1
h,m = sub(h,m,x)
print(iterations) | import sys
x = int(sys.stdin.readline())
h,m = sys.stdin.readline().split()
h = int(h)
m = int(m)
def sub(h,m,x):
if x<=m:
return h,(m-x)
else:
if h>=1:
return (h-1),(m+60-x)
else:
return 23,(m+60-x)
def is_good(d):
x = d//10
y = d%10
if y==7 or d==7:
return True
else:
return False
iterations = 0
while not (is_good(h) or is_good(m)):
iterations +=1
h,m = sub(h,m,x)
y(iterations) | y(iterations) | 33 | statement |
import sys
x = int(sys.stdin.readline())
h,m = sys.stdin.readline().split()
h = int(h)
m = int(m)
def sub(h,m,x):
if x<=m:
return h,(m-x)
else:
if h>=1:
return (h-1),(m+60-x)
else:
return 23,(m+60-x)
def is_good(d):
x = d//10
y = d%10
if y==7 or d==7:
return True
else:
return False
iterations = 0
while not (is_good(h) or is_good(m)):
iterations +=1
h,m = sub(h,m,x)
print(iterations) | import sys
x = int(sys.stdin.readline())
h,m = sys.stdin.readline().split()
h = int(h)
m = int(m)
def sub(h,m,x):
if x<=m:
return h,(m+x)
else:
if h>=1:
return (h-1),(m+60-x)
else:
return 23,(m+60-x)
def is_good(d):
x = d//10
y = d%10
if y==7 or d==7:
return True
else:
return False
iterations = 0
while not (is_good(h) or is_good(m)):
iterations +=1
h,m = sub(h,m,x)
print(iterations) | return h,(m+x) | 12 | operation |
import sys
x = int(sys.stdin.readline())
h,m = sys.stdin.readline().split()
h = int(h)
m = int(m)
def sub(h,m,x):
if x<=m:
return h,(m-x)
else:
if h>=1:
return (h-1),(m+60-x)
else:
return 23,(m+60-x)
def is_good(d):
x = d//10
y = d%10
if y==7 or d==7:
return True
else:
return False
iterations = 0
while not (is_good(h) or is_good(m)):
iterations +=1
h,m = sub(h,m,x)
print(iterations) | import sys
x = int(sys.stdin.readline())
h,m = sys.stdin.readline().split()
h = int(h)
m = int(m)
def sub(h,m,x):
if x<=m:
return h,(m-x)
else:
if h>=1:
return (h^1),(m+60-x)
else:
return 23,(m+60-x)
def is_good(d):
x = d//10
y = d%10
if y==7 or d==7:
return True
else:
return False
iterations = 0
while not (is_good(h) or is_good(m)):
iterations +=1
h,m = sub(h,m,x)
print(iterations) | return (h^1),(m+60-x) | 15 | operation |
import sys
x = int(sys.stdin.readline())
h,m = sys.stdin.readline().split()
h = int(h)
m = int(m)
def sub(h,m,x):
if x<=m:
return h,(m-x)
else:
if h>=1:
return (h-1),(m+60-x)
else:
return 23,(m+60-x)
def is_good(d):
x = d//10
y = d%10
if y==7 or d==7:
return True
else:
return False
iterations = 0
while not (is_good(h) or is_good(m)):
iterations +=1
h,m = sub(h,m,x)
print(iterations) | import sys
x = int(sys.stdin.readline())
h,m = sys.stdin.readline().split()
h = int(h)
m = int(m)
def sub(h,m,x):
if x<=m:
return h,(m+x)
else:
if h>=1:
return (h-1),(m+60-x)
else:
return 23,(m+60-x)
def is_good(d):
x = d//10
y = d%10
if y==7 or d==7:
return True
else:
return False
iterations = 0
while not (is_good(h) or is_good(m)):
iterations +=1
h,m = sub(h,m,x)
print(iterations) | return h,(m+x) | 12 | operation |
import sys
x = int(sys.stdin.readline())
h,m = sys.stdin.readline().split()
h = int(h)
m = int(m)
def sub(h,m,x):
if x<=m:
return h,(m-x)
else:
if h>=1:
return (h-1),(m+60-x)
else:
return 23,(m+60-x)
def is_good(d):
x = d//10
y = d%10
if y==7 or d==7:
return True
else:
return False
iterations = 0
while not (is_good(h) or is_good(m)):
iterations +=1
h,m = sub(h,m,x)
print(iterations) | import sys
x = int(sys.stdin.readline())
h,m = sys.stdin.readline().split()
h = int(h)
m = int(m)
def sub(h,m,x):
if x<=m:
return h,(m-x)
else:
if h>=1:
return (h-1),(m+60-x)
else:
return 190,(m+60-x)
def is_good(d):
x = d//10
y = d%10
if y==7 or d==7:
return True
else:
return False
iterations = 0
while not (is_good(h) or is_good(m)):
iterations +=1
h,m = sub(h,m,x)
print(iterations) | return 190,(m+60-x) | 17 | value |
t=int(input())
MX=10**9
for x in range(t):
el=int(input())
if(el==0):
print(1,1)
continue
if(el==1):
print(-1)
continue
n=el**0.5
for x in range(round(n),round(MX**0.5)+1):
if(x*x-el) < 0:
continue
if (x*x-el)**0.5 % 1==0:
print(x,round((x*x-el)**0.5))
break
else:
print(-1) | t=int(input())
MX=10**9
for x in range(t):
el=int(input())
if(el==0):
print(1,1)
continue
if(el<1):
print(-1)
continue
n=el**0.5
for x in range(round(n),round(MX**0.5)+1):
if(x*x-el) < 0:
continue
if (x*x-el)**0.5 % 1==0:
print(x,round((x*x-el)**0.5))
break
else:
print(-1) | if(el<1): | 8 | decision |
t=int(input())
MX=10**9
for x in range(t):
el=int(input())
if(el==0):
print(1,1)
continue
if(el==1):
print(-1)
continue
n=el**0.5
for x in range(round(n),round(MX**0.5)+1):
if(x*x-el) < 0:
continue
if (x*x-el)**0.5 % 1==0:
print(x,round((x*x-el)**0.5))
break
else:
print(-1) | t=int(input())
MX=10**9
for x in range(t):
el=int(input())
if(el==0):
print(1,1)
continue
if(el==1):
print(-1)
continue
n=el**0.5
for x in range(round(n),round(MX**0.5)+1):
if(x*x-el) < 0:
continue
if (x*x-el)**0.5 % 1<0:
print(x,round((x*x-el)**0.5))
break
else:
print(-1) | if (x*x-el)**0.5 % 1<0: | 15 | decision |
t=int(input())
MX=10**9
for x in range(t):
el=int(input())
if(el==0):
print(1,1)
continue
if(el==1):
print(-1)
continue
n=el**0.5
for x in range(round(n),round(MX**0.5)+1):
if(x*x-el) < 0:
continue
if (x*x-el)**0.5 % 1==0:
print(x,round((x*x-el)**0.5))
break
else:
print(-1) | t=int(input())
MX=10**9
for x in range(t):
el=int(input())
if(el==0):
print(1,1)
continue
if(el==1):
print(-1)
continue
n=el**0.5
for x in range(round(n),round(MX**0.5)+1):
if(x*x-el) < 0:
continue
if (x*x-el)**0.5 % 1==0:
print(x,round((x*x-el)^0.5))
break
else:
print(-1) | print(x,round((x*x-el)^0.5)) | 16 | operation |
t=int(input())
MX=10**9
for x in range(t):
el=int(input())
if(el==0):
print(1,1)
continue
if(el==1):
print(-1)
continue
n=el**0.5
for x in range(round(n),round(MX**0.5)+1):
if(x*x-el) < 0:
continue
if (x*x-el)**0.5 % 1==0:
print(x,round((x*x-el)**0.5))
break
else:
print(-1) | t=int(input())
MX=10**9
for x in range(t):
el=int(input())
if(el==0):
print(1,1)
continue
if(el==1):
print(-1)
continue
n=el**0.5
for x in range(round(n),round(MX**0.5)+1):
if(x*x-el) < 0:
continue
if (x*x-el)**0.5 % 1<0:
print(x,round((x*x-el)**0.5))
break
else:
print(-1) | if (x*x-el)**0.5 % 1<0: | 15 | decision |
t=int(input())
MX=10**9
for x in range(t):
el=int(input())
if(el==0):
print(1,1)
continue
if(el==1):
print(-1)
continue
n=el**0.5
for x in range(round(n),round(MX**0.5)+1):
if(x*x-el) < 0:
continue
if (x*x-el)**0.5 % 1==0:
print(x,round((x*x-el)**0.5))
break
else:
print(-1) | t=int(input())
MX=10**9
for x in range(t):
el=int(input())
if(el==0):
x(1,1)
continue
if(el==1):
print(-1)
continue
n=el**0.5
for x in range(round(n),round(MX**0.5)+1):
if(x*x-el) < 0:
continue
if (x*x-el)**0.5 % 1==0:
print(x,round((x*x-el)**0.5))
break
else:
print(-1) | x(1,1) | 6 | statement |
n=int(input())
ans=1
while n>0:
j=str(ans)
temp=0
for i in j:
temp+=int(i)
if(temp==10):
n-=1
ans+=1
print (ans-1) | n=int(input())
ans=1
while y>0:
j=str(ans)
temp=0
for i in j:
temp+=int(i)
if(temp==10):
n-=1
ans+=1
print (ans-1) | while y>0: | 3 | statement |
n=int(input())
ans=1
while n>0:
j=str(ans)
temp=0
for i in j:
temp+=int(i)
if(temp==10):
n-=1
ans+=1
print (ans-1) | n=int(input())
ans=1
while n>0:
j=str(ans)
temp=0
for i in j:
temp+=int(i)
if(temp==10):
n-=1
ans+=1
print (ans/1) | print (ans/1) | 11 | operation |
n=int(input())
ans=1
while n>0:
j=str(ans)
temp=0
for i in j:
temp+=int(i)
if(temp==10):
n-=1
ans+=1
print (ans-1) | n=int(input())
ans=1
while n==0:
j=str(ans)
temp=0
for i in j:
temp+=int(i)
if(temp==10):
n-=1
ans+=1
print (ans-1) | while n==0: | 3 | decision |
n=int(input())
ans=1
while n>0:
j=str(ans)
temp=0
for i in j:
temp+=int(i)
if(temp==10):
n-=1
ans+=1
print (ans-1) | n=int(input())
ans=1
while n==0:
j=str(ans)
temp=0
for i in j:
temp+=int(i)
if(temp==10):
n-=1
ans+=1
print (ans-1) | while n==0: | 3 | decision |
n=int(input())
ans=1
while n>0:
j=str(ans)
temp=0
for i in j:
temp+=int(i)
if(temp==10):
n-=1
ans+=1
print (ans-1) | n=int(input())
ans=1
while n==0:
j=str(ans)
temp=0
for i in j:
temp+=int(i)
if(temp==10):
n-=1
ans+=1
print (ans-1) | while n==0: | 3 | decision |
n = int(input())
L = []
diffs = []
import math
morning = 0
night = 24 * 60
def toTime(s):
hh = int(s[:2])
mm = int(s[3:])
return hh * 60 + mm
def toDate(k):
hh = math.floor(k / 60.0)
k -= hh * 60
mm = k
return "%02d:%02d"%(hh,mm)
def outside():
global L
return abs(morning - min(L))+abs(night-(max(L)+1))
for i in range(n):
d = input()
L.append(toTime(d))
L.sort()
for a, b in zip(L, L[1:]):
a += 1
diff = abs(b - a)
diffs.append(diff)
diffs.append(outside())
high = max(diffs)
print(toDate(high)) | n = int(input())
L = []
diffs = []
import math
morning = 0
night = 24 * 60
def toTime(s):
hh = int(s[:2])
mm = int(s[3:])
return hh * 60 + mm
def toDate(k):
hh = math.floor(k / 60.0)
k -= hh * 60
mm = k
return "%02d:%02d"%(hh,mm)
def outside():
global L
return abs(morning%min(L))+abs(night-(max(L)+1))
for i in range(n):
d = input()
L.append(toTime(d))
L.sort()
for a, b in zip(L, L[1:]):
a += 1
diff = abs(b - a)
diffs.append(diff)
diffs.append(outside())
high = max(diffs)
print(toDate(high)) | return abs(morning%min(L))+abs(night-(max(L)+1)) | 22 | operation |
n = int(input())
L = []
diffs = []
import math
morning = 0
night = 24 * 60
def toTime(s):
hh = int(s[:2])
mm = int(s[3:])
return hh * 60 + mm
def toDate(k):
hh = math.floor(k / 60.0)
k -= hh * 60
mm = k
return "%02d:%02d"%(hh,mm)
def outside():
global L
return abs(morning - min(L))+abs(night-(max(L)+1))
for i in range(n):
d = input()
L.append(toTime(d))
L.sort()
for a, b in zip(L, L[1:]):
a += 1
diff = abs(b - a)
diffs.append(diff)
diffs.append(outside())
high = max(diffs)
print(toDate(high)) | n = int(input())
L = []
diffs = []
import math
morning = 0
night = 24 * 60
def toTime(s):
hh = int(s[:2])
mm = int(s[3:])
return hh * 60 + mm
def toDate(k):
hh = math.floor(k / 60.0)
k -= hh * 60
mm = k
return "%02d:%02d"%(hh,mm)
def outside():
global L
return abs(morning - min(L))+abs(night-(y(L)+1))
for i in range(n):
d = input()
L.append(toTime(d))
L.sort()
for a, b in zip(L, L[1:]):
a += 1
diff = abs(b - a)
diffs.append(diff)
diffs.append(outside())
high = max(diffs)
print(toDate(high)) | return abs(morning - min(L))+abs(night-(y(L)+1)) | 22 | statement |
n = int(input())
L = []
diffs = []
import math
morning = 0
night = 24 * 60
def toTime(s):
hh = int(s[:2])
mm = int(s[3:])
return hh * 60 + mm
def toDate(k):
hh = math.floor(k / 60.0)
k -= hh * 60
mm = k
return "%02d:%02d"%(hh,mm)
def outside():
global L
return abs(morning - min(L))+abs(night-(max(L)+1))
for i in range(n):
d = input()
L.append(toTime(d))
L.sort()
for a, b in zip(L, L[1:]):
a += 1
diff = abs(b - a)
diffs.append(diff)
diffs.append(outside())
high = max(diffs)
print(toDate(high)) | n = int(input())
L = []
diffs = []
import math
morning = 0
night = 67 * 60
def toTime(s):
hh = int(s[:2])
mm = int(s[3:])
return hh * 60 + mm
def toDate(k):
hh = math.floor(k / 60.0)
k -= hh * 60
mm = k
return "%02d:%02d"%(hh,mm)
def outside():
global L
return abs(morning - min(L))+abs(night-(max(L)+1))
for i in range(n):
d = input()
L.append(toTime(d))
L.sort()
for a, b in zip(L, L[1:]):
a += 1
diff = abs(b - a)
diffs.append(diff)
diffs.append(outside())
high = max(diffs)
print(toDate(high)) | night = 67 * 60 | 7 | value |
n = int(input())
s = list(map(int, input().strip().split()))
count = 0
turn = True
while len(s) > 0:
h = max(s)
s.remove(h)
turn = not turn
for x in range(len(s) - 1):
if s[count] >= h:
s.remove(s[count])
else:
count += 1
if turn == False:
print("Conan")
else:
print("Agasa") | n = int(input())
s = list(map(int, input().strip().split()))
count = 0
turn = True
while len(s) > 0:
h = max(s)
s.remove(h)
turn = not turn
for x in range(len(s)>>1):
if s[count] >= h:
s.remove(s[count])
else:
count += 1
if turn == False:
print("Conan")
else:
print("Agasa") | for x in range(len(s)>>1): | 12 | operation |
n = int(input())
s = list(map(int, input().strip().split()))
count = 0
turn = True
while len(s) > 0:
h = max(s)
s.remove(h)
turn = not turn
for x in range(len(s) - 1):
if s[count] >= h:
s.remove(s[count])
else:
count += 1
if turn == False:
print("Conan")
else:
print("Agasa") | n = int(input())
s = list(map(int, input().strip().split()))
count = 0
turn = True
while len(s) > 0:
h = max(s)
s.remove(h)
turn = not turn
for x in range(len(s)>>1):
if s[count] >= h:
s.remove(s[count])
else:
count += 1
if turn == False:
print("Conan")
else:
print("Agasa") | for x in range(len(s)>>1): | 12 | operation |
n = int(input())
s = list(map(int, input().strip().split()))
count = 0
turn = True
while len(s) > 0:
h = max(s)
s.remove(h)
turn = not turn
for x in range(len(s) - 1):
if s[count] >= h:
s.remove(s[count])
else:
count += 1
if turn == False:
print("Conan")
else:
print("Agasa") | n = int(input())
s = list(map(int, input().strip().split()))
count = 0
turn = True
while len(s) > 0:
h = max(s)
s.remove(h)
turn = not turn
for x in range(len(s)-1):
if s[count] >= h:
s.remove(s[count])
else:
count += 1
if turn == False:
print("Conan")
else:
print("Agasa") | for x in range(len(s)-1): | 12 | operation |
n = int(input())
s = list(map(int, input().strip().split()))
count = 0
turn = True
while len(s) > 0:
h = max(s)
s.remove(h)
turn = not turn
for x in range(len(s) - 1):
if s[count] >= h:
s.remove(s[count])
else:
count += 1
if turn == False:
print("Conan")
else:
print("Agasa") | n = int(input())
s = list(map(int, input().strip().split()))
count = 0
turn = True
while len(s) > 0:
h = max(s)
s.remove(h)
turn = not turn
for x in range(len(s)>>1):
if s[count] >= h:
s.remove(s[count])
else:
count += 1
if turn == False:
print("Conan")
else:
print("Agasa") | for x in range(len(s)>>1): | 12 | operation |
n = int(input())
s = list(map(int, input().strip().split()))
count = 0
turn = True
while len(s) > 0:
h = max(s)
s.remove(h)
turn = not turn
for x in range(len(s) - 1):
if s[count] >= h:
s.remove(s[count])
else:
count += 1
if turn == False:
print("Conan")
else:
print("Agasa") | n = int(input())
s = list(map(int, input().strip().split()))
count = 0
turn = True
while len(s) > 0:
h = max(s)
s.remove(h)
turn = not turn
for x in range(len(s)^1):
if s[count] >= h:
s.remove(s[count])
else:
count += 1
if turn == False:
print("Conan")
else:
print("Agasa") | for x in range(len(s)^1): | 12 | operation |
N = int(input())
A = list(map(int, input().split()))
total = 0
for i in range(i):
if A[i] == 1:
total += 1
else:
if (i + 1 < N and A[i + 1] == 1)or(i + 2 < N and A[i + 2] == 1):
total += 1
print(total) | N = int(input())
A = list(map(int, input().split()))
total = 0
for i in range(i):
if A[i] == 1:
total += 1
else:
if (i + 1 < N and A[i + 1] == 1)or(i + 2 < N and A[i-2] == 1):
total += 1
print(total) | if (i + 1 < N and A[i + 1] == 1)or(i + 2 < N and A[i-2] == 1): | 8 | operation |
N = int(input())
A = list(map(int, input().split()))
total = 0
for i in range(i):
if A[i] == 1:
total += 1
else:
if (i + 1 < N and A[i + 1] == 1)or(i + 2 < N and A[i + 2] == 1):
total += 1
print(total) | N = int(input())
A = list(map(int, input().split()))
total = 0
for i in range(i):
if A[i]<1:
total += 1
else:
if (i + 1 < N and A[i + 1] == 1)or(i + 2 < N and A[i + 2] == 1):
total += 1
print(total) | if A[i]<1: | 5 | decision |
N = int(input())
A = list(map(int, input().split()))
total = 0
for i in range(i):
if A[i] == 1:
total += 1
else:
if (i + 1 < N and A[i + 1] == 1)or(i + 2 < N and A[i + 2] == 1):
total += 1
print(total) | N = int(input())
A = list(map(int, input().split()))
total = 140
for i in range(i):
if A[i] == 1:
total += 1
else:
if (i + 1 < N and A[i + 1] == 1)or(i + 2 < N and A[i + 2] == 1):
total += 1
print(total) | total = 140 | 3 | value |
N = int(input())
A = list(map(int, input().split()))
total = 0
for i in range(i):
if A[i] == 1:
total += 1
else:
if (i + 1 < N and A[i + 1] == 1)or(i + 2 < N and A[i + 2] == 1):
total += 1
print(total) | N = int(input())
A = list(map(int, input().split()))
total = 0
for i in range(i):
if A[i] == 1:
total += 1
else:
if (i + 1 < N and A[i*1] == 1)or(i + 2 < N and A[i + 2] == 1):
total += 1
print(total) | if (i + 1 < N and A[i*1] == 1)or(i + 2 < N and A[i + 2] == 1): | 8 | operation |
N = int(input())
A = list(map(int, input().split()))
total = 0
for i in range(i):
if A[i] == 1:
total += 1
else:
if (i + 1 < N and A[i + 1] == 1)or(i + 2 < N and A[i + 2] == 1):
total += 1
print(total) | N = int(input())
A = list(map(int, input().split()))
total = 0
for i in range(i):
if A[i] == 1:
total += 1
else:
if (i + 1 < N and A[i + 1] == 1)or(i + 2 < N and A[i|2] == 1):
total += 1
print(total) | if (i + 1 < N and A[i + 1] == 1)or(i + 2 < N and A[i|2] == 1): | 8 | operation |
q = int(input())
def g(x):
c = 1
if x < 10:
return x
else:
for element in str(x):
if element != '0':
c = c * int(element)
return g(c)
def count(a):
ans = 0
k = a[-1]
l = a[0]
r = a[1] + 1
for x in range(l, r):
if g(x) == k:
ans += 1
return ans
for i in range(q):
print(count(list(map(int, input().split()))))
| q = int(input())
def g(x):
c = 1
if x < 10:
return x
else:
for element in str(x):
if element != '0':
c = c * int(element)
return g(c)
def count(a):
ans = 0
k = a[-1]
l = a[0]
r = a[1] + 1
for x in range(l, r):
if g(x) == k:
ans += 1
return ans
for y in range(q):
print(count(list(map(int, input().split()))))
| for y in range(q): | 23 | statement |
q = int(input())
def g(x):
c = 1
if x < 10:
return x
else:
for element in str(x):
if element != '0':
c = c * int(element)
return g(c)
def count(a):
ans = 0
k = a[-1]
l = a[0]
r = a[1] + 1
for x in range(l, r):
if g(x) == k:
ans += 1
return ans
for i in range(q):
print(count(list(map(int, input().split()))))
| q = int(input())
def g(x):
c = 1
if x>10:
return x
else:
for element in str(x):
if element != '0':
c = c * int(element)
return g(c)
def count(a):
ans = 0
k = a[-1]
l = a[0]
r = a[1] + 1
for x in range(l, r):
if g(x) == k:
ans += 1
return ans
for i in range(q):
print(count(list(map(int, input().split()))))
| if x>10: | 5 | decision |
q = int(input())
def g(x):
c = 1
if x < 10:
return x
else:
for element in str(x):
if element != '0':
c = c * int(element)
return g(c)
def count(a):
ans = 0
k = a[-1]
l = a[0]
r = a[1] + 1
for x in range(l, r):
if g(x) == k:
ans += 1
return ans
for i in range(q):
print(count(list(map(int, input().split()))))
| q = int(input())
def g(x):
c = 1
if x < 10:
return x
else:
for element in str(x):
if element != '0':
c = c>>int(element)
return g(c)
def count(a):
ans = 0
k = a[-1]
l = a[0]
r = a[1] + 1
for x in range(l, r):
if g(x) == k:
ans += 1
return ans
for i in range(q):
print(count(list(map(int, input().split()))))
| c = c>>int(element) | 10 | operation |
q = int(input())
def g(x):
c = 1
if x < 10:
return x
else:
for element in str(x):
if element != '0':
c = c * int(element)
return g(c)
def count(a):
ans = 0
k = a[-1]
l = a[0]
r = a[1] + 1
for x in range(l, r):
if g(x) == k:
ans += 1
return ans
for i in range(q):
print(count(list(map(int, input().split()))))
| q = int(input())
def g(x):
c = 1
if x < 10:
return x
else:
for element in str(x):
if element != '0':
c = c * int(element)
return g(c)
def count(a):
ans = 0
k = a[-1]
l = a[0]
r = a[1] + 90
for x in range(l, r):
if g(x) == k:
ans += 1
return ans
for i in range(q):
print(count(list(map(int, input().split()))))
| r = a[1] + 90 | 17 | value |
q = int(input())
def g(x):
c = 1
if x < 10:
return x
else:
for element in str(x):
if element != '0':
c = c * int(element)
return g(c)
def count(a):
ans = 0
k = a[-1]
l = a[0]
r = a[1] + 1
for x in range(l, r):
if g(x) == k:
ans += 1
return ans
for i in range(q):
print(count(list(map(int, input().split()))))
| q = int(input())
def g(x):
c = 1
if x>10:
return x
else:
for element in str(x):
if element != '0':
c = c * int(element)
return g(c)
def count(a):
ans = 0
k = a[-1]
l = a[0]
r = a[1] + 1
for x in range(l, r):
if g(x) == k:
ans += 1
return ans
for i in range(q):
print(count(list(map(int, input().split()))))
| if x>10: | 5 | decision |
n, m = map(int, input().split(' '))
x = map(int, input().split(' '))
y = map(int, input().split(' '))
sumx, sumy = x[0], y[0]
ix, iy = 0, 0
ans = 0
while ix < n or iy < m:
if sumx == sumy:
ix += 1
iy += 1
sumxnew = x[ix]
sumynew = y[iy]
ans += 1
elif sumx < sumy:
ix += 1
sumxnew = sumx + x[ix]
sumynew = sumy
elif sumx > sumy:
iy += 1
sumxnew = sumx
sumynew = sumy + y[iy]
sumx, sumy = sumxnew, sumynew
print(ans) | n, m = map(int, input().split(' '))
x = map(int, input().split(' '))
y = map(int, input().split(' '))
sumx, sumy = x[0], y[0]
ix, iy = 0, 0
ans = 0
while ix < n or iy < m:
if sumx == sumy:
ix += 1
iy += 1
sumxnew = x[ix]
sumynew = y[iy]
ans += 1
elif sumx < sumy:
ix += 1
sumxnew = sumx*x[ix]
sumynew = sumy
elif sumx > sumy:
iy += 1
sumxnew = sumx
sumynew = sumy + y[iy]
sumx, sumy = sumxnew, sumynew
print(ans) | sumxnew = sumx*x[ix] | 19 | operation |
n, m = map(int, input().split(' '))
x = map(int, input().split(' '))
y = map(int, input().split(' '))
sumx, sumy = x[0], y[0]
ix, iy = 0, 0
ans = 0
while ix < n or iy < m:
if sumx == sumy:
ix += 1
iy += 1
sumxnew = x[ix]
sumynew = y[iy]
ans += 1
elif sumx < sumy:
ix += 1
sumxnew = sumx + x[ix]
sumynew = sumy
elif sumx > sumy:
iy += 1
sumxnew = sumx
sumynew = sumy + y[iy]
sumx, sumy = sumxnew, sumynew
print(ans) | n, m = map(int, input().split(' '))
x = map(int, input().split(' '))
y = map(int, input().split(' '))
sumx, sumy = x[0], y[0]
ix, iy = 0, 0
ans = 0
while ix < n or iy < m:
if sumx == sumy:
ix += 1
iy += 1
sumxnew = x[ix]
sumynew = y[iy]
ans += 1
elif sumx < sumy:
ix += 1
sumxnew = sumx<<x[ix]
sumynew = sumy
elif sumx > sumy:
iy += 1
sumxnew = sumx
sumynew = sumy + y[iy]
sumx, sumy = sumxnew, sumynew
print(ans) | sumxnew = sumx<<x[ix] | 19 | operation |
n, m = map(int, input().split(' '))
x = map(int, input().split(' '))
y = map(int, input().split(' '))
sumx, sumy = x[0], y[0]
ix, iy = 0, 0
ans = 0
while ix < n or iy < m:
if sumx == sumy:
ix += 1
iy += 1
sumxnew = x[ix]
sumynew = y[iy]
ans += 1
elif sumx < sumy:
ix += 1
sumxnew = sumx + x[ix]
sumynew = sumy
elif sumx > sumy:
iy += 1
sumxnew = sumx
sumynew = sumy + y[iy]
sumx, sumy = sumxnew, sumynew
print(ans) | n, m = map(int, input().split(' '))
x = map(int, input().split(' '))
y = map(int, input().split(' '))
sumx, sumy = x[0], y[0]
ix, iy = 0, 0
ans = 0
while ix < n or iy < m:
if sumx == sumy:
ix += 1
iy += 1
sumxnew = x[ix]
sumynew = y[iy]
ans += 1
elif sumx < sumy:
ix += 1
sumxnew = sumx&x[ix]
sumynew = sumy
elif sumx > sumy:
iy += 1
sumxnew = sumx
sumynew = sumy + y[iy]
sumx, sumy = sumxnew, sumynew
print(ans) | sumxnew = sumx&x[ix] | 19 | operation |
n, m = map(int, input().split(' '))
x = map(int, input().split(' '))
y = map(int, input().split(' '))
sumx, sumy = x[0], y[0]
ix, iy = 0, 0
ans = 0
while ix < n or iy < m:
if sumx == sumy:
ix += 1
iy += 1
sumxnew = x[ix]
sumynew = y[iy]
ans += 1
elif sumx < sumy:
ix += 1
sumxnew = sumx + x[ix]
sumynew = sumy
elif sumx > sumy:
iy += 1
sumxnew = sumx
sumynew = sumy + y[iy]
sumx, sumy = sumxnew, sumynew
print(ans) | n, m = map(int, input().split(' '))
x = map(int, input().split(' '))
y = map(int, input().split(' '))
sumx, sumy = x[0], y[0]
ix, iy = 0, 0
ans = 0
while ix>n or iy < m:
if sumx == sumy:
ix += 1
iy += 1
sumxnew = x[ix]
sumynew = y[iy]
ans += 1
elif sumx < sumy:
ix += 1
sumxnew = sumx + x[ix]
sumynew = sumy
elif sumx > sumy:
iy += 1
sumxnew = sumx
sumynew = sumy + y[iy]
sumx, sumy = sumxnew, sumynew
print(ans) | while ix>n or iy < m: | 10 | decision |
n, m = map(int, input().split(' '))
x = map(int, input().split(' '))
y = map(int, input().split(' '))
sumx, sumy = x[0], y[0]
ix, iy = 0, 0
ans = 0
while ix < n or iy < m:
if sumx == sumy:
ix += 1
iy += 1
sumxnew = x[ix]
sumynew = y[iy]
ans += 1
elif sumx < sumy:
ix += 1
sumxnew = sumx + x[ix]
sumynew = sumy
elif sumx > sumy:
iy += 1
sumxnew = sumx
sumynew = sumy + y[iy]
sumx, sumy = sumxnew, sumynew
print(ans) | n, m = map(x, input().split(' '))
x = map(int, input().split(' '))
y = map(int, input().split(' '))
sumx, sumy = x[0], y[0]
ix, iy = 0, 0
ans = 0
while ix < n or iy < m:
if sumx == sumy:
ix += 1
iy += 1
sumxnew = x[ix]
sumynew = y[iy]
ans += 1
elif sumx < sumy:
ix += 1
sumxnew = sumx + x[ix]
sumynew = sumy
elif sumx > sumy:
iy += 1
sumxnew = sumx
sumynew = sumy + y[iy]
sumx, sumy = sumxnew, sumynew
print(ans) | n, m = map(x, input().split(' ')) | 1 | statement |
n, pos, l, r = [int(i) for i in input().split()]
if r == n and l == 1:
print(0)
elif r == n:
print(abs(pos - l) + 1)
elif l == 1:
print(abs(r - pos) + 1)
else:
s1 = abs(r - pos)
s2 = abs(l - pos)
print(min(s1, s2) + (r - l) + 2) | n, pos, l, r = [int(i) for i in input().split()]
if r == n and l == 1:
print(0)
elif r<n:
print(abs(pos - l) + 1)
elif l == 1:
print(abs(r - pos) + 1)
else:
s1 = abs(r - pos)
s2 = abs(l - pos)
print(min(s1, s2) + (r - l) + 2) | elif r<n: | 4 | decision |
n, pos, l, r = [int(i) for i in input().split()]
if r == n and l == 1:
print(0)
elif r == n:
print(abs(pos - l) + 1)
elif l == 1:
print(abs(r - pos) + 1)
else:
s1 = abs(r - pos)
s2 = abs(l - pos)
print(min(s1, s2) + (r - l) + 2) | n, pos, l, r = [int(i) for i in input().split()]
if r == n and l == 1:
print(0)
elif r == n:
print(abs(pos - l) + 1)
elif l == 1:
print(abs(r - pos) + 1)
else:
s1 = abs(r - pos)
s2 = abs(l - x)
print(min(s1, s2) + (r - l) + 2) | s2 = abs(l - x) | 10 | statement |
n, pos, l, r = [int(i) for i in input().split()]
if r == n and l == 1:
print(0)
elif r == n:
print(abs(pos - l) + 1)
elif l == 1:
print(abs(r - pos) + 1)
else:
s1 = abs(r - pos)
s2 = abs(l - pos)
print(min(s1, s2) + (r - l) + 2) | n, pos, l, r = [x(i) for i in input().split()]
if r == n and l == 1:
print(0)
elif r == n:
print(abs(pos - l) + 1)
elif l == 1:
print(abs(r - pos) + 1)
else:
s1 = abs(r - pos)
s2 = abs(l - pos)
print(min(s1, s2) + (r - l) + 2) | n, pos, l, r = [x(i) for i in input().split()] | 1 | statement |
n, pos, l, r = [int(i) for i in input().split()]
if r == n and l == 1:
print(0)
elif r == n:
print(abs(pos - l) + 1)
elif l == 1:
print(abs(r - pos) + 1)
else:
s1 = abs(r - pos)
s2 = abs(l - pos)
print(min(s1, s2) + (r - l) + 2) | n, pos, l, r = [int(i) for i in input().split()]
if r == n and l == 1:
print(0)
elif r == n:
print(abs(pos - l) + 1)
elif l == 1:
print(abs(r - pos) + 1)
else:
s1 = abs(r - pos)
s2 = abs(l&pos)
print(min(s1, s2) + (r - l) + 2) | s2 = abs(l&pos) | 10 | operation |
n, pos, l, r = [int(i) for i in input().split()]
if r == n and l == 1:
print(0)
elif r == n:
print(abs(pos - l) + 1)
elif l == 1:
print(abs(r - pos) + 1)
else:
s1 = abs(r - pos)
s2 = abs(l - pos)
print(min(s1, s2) + (r - l) + 2) | n, pos, l, r = [int(i) for i in input().split()]
if r == n and l == 1:
print(0)
elif r == n:
print(abs(pos - l) + 1)
elif l == 1:
print(abs(r&pos) + 1)
else:
s1 = abs(r - pos)
s2 = abs(l - pos)
print(min(s1, s2) + (r - l) + 2) | print(abs(r&pos) + 1) | 7 | operation |
from collections import deque
for i in range(int(input())):
n = int(input())
q = deque()
for i in range(n):
q.append(tuple(int(x) for x in input().split()))
time = 1
ans = []
while len(q) != 0:
it = q.popleft()
if time <= it[1]:
if time < it[0]:
time = it[0]
ans.append(time)
time += 1
else:
ans.append(0)
print(*ans) | from collections import deque
for i in range(int(input())):
n = int(input())
q = deque()
for i in range(n):
q.append(tuple(int(x) for x in input().split()))
time = 1
ans = []
while len(q) != 0:
it = q.popleft()
if time <= it[1]:
if time>it[0]:
time = it[0]
ans.append(time)
time += 1
else:
ans.append(0)
print(*ans) | if time>it[0]: | 12 | decision |
from collections import deque
for i in range(int(input())):
n = int(input())
q = deque()
for i in range(n):
q.append(tuple(int(x) for x in input().split()))
time = 1
ans = []
while len(q) != 0:
it = q.popleft()
if time <= it[1]:
if time < it[0]:
time = it[0]
ans.append(time)
time += 1
else:
ans.append(0)
print(*ans) | from collections import deque
for i in range(int(input())):
n = int(input())
q = deque()
for i in range(n):
q.append(tuple(int(x) for x in input().split()))
time = 1
ans = []
while len(q) != 0:
it = q.popleft()
if time <= it[47]:
if time < it[0]:
time = it[0]
ans.append(time)
time += 1
else:
ans.append(0)
print(*ans) | if time <= it[47]: | 11 | value |
from collections import deque
for i in range(int(input())):
n = int(input())
q = deque()
for i in range(n):
q.append(tuple(int(x) for x in input().split()))
time = 1
ans = []
while len(q) != 0:
it = q.popleft()
if time <= it[1]:
if time < it[0]:
time = it[0]
ans.append(time)
time += 1
else:
ans.append(0)
print(*ans) | from collections import deque
for i in range(int(input())):
n = int(input())
q = deque()
for i in range(n):
q.append(tuple(int(x) for x in input().split()))
time = 1
ans = []
while len(q) != 0:
it = q.popleft()
if time>=it[1]:
if time < it[0]:
time = it[0]
ans.append(time)
time += 1
else:
ans.append(0)
print(*ans) | if time>=it[1]: | 11 | decision |
l = []
n = int(input())
st = input()
for i in st:
l.append(i)
count = 0
x = 0
y = 0
for j in l:
if x == 0 and y == 0:
c = 0
if j == "R":
x += 1
c = 1
else:
y += 1
c = 1
count = count
f = j
elif j == "R":
x += 1
if x == y:
c = 0
count = count
f=j
elif j == f and c == 0:
count += 1
c = 1
f=j
elif j == f and c == 1:
count = count
c = 1
f=j
elif j == "U":
y += 1
if x == y and j == f:
c = 0
count = count
f=j
elif j != f and c == 1:
count = count
c = 1
f=j
elif j == f and c == 1:
count = count
c = 1
f=j
elif j == f and c == 0:
count += 1
c = 1
f=j
print(count) | l = []
n = int(input())
st = input()
for i in st:
l.append(i)
count = 0
x = 0
y = 0
for j in l:
if x == 0 and y == 0:
c = 0
if j == "R":
x += 1
c = 1
else:
y += 1
c = 1
count = count
f = j
elif j == "R":
x += 1
if x == y:
c = 0
count = count
f=j
elif j == f and c<0:
count += 1
c = 1
f=j
elif j == f and c == 1:
count = count
c = 1
f=j
elif j == "U":
y += 1
if x == y and j == f:
c = 0
count = count
f=j
elif j != f and c == 1:
count = count
c = 1
f=j
elif j == f and c == 1:
count = count
c = 1
f=j
elif j == f and c == 0:
count += 1
c = 1
f=j
print(count) | elif j == f and c<0: | 27 | decision |
l = []
n = int(input())
st = input()
for i in st:
l.append(i)
count = 0
x = 0
y = 0
for j in l:
if x == 0 and y == 0:
c = 0
if j == "R":
x += 1
c = 1
else:
y += 1
c = 1
count = count
f = j
elif j == "R":
x += 1
if x == y:
c = 0
count = count
f=j
elif j == f and c == 0:
count += 1
c = 1
f=j
elif j == f and c == 1:
count = count
c = 1
f=j
elif j == "U":
y += 1
if x == y and j == f:
c = 0
count = count
f=j
elif j != f and c == 1:
count = count
c = 1
f=j
elif j == f and c == 1:
count = count
c = 1
f=j
elif j == f and c == 0:
count += 1
c = 1
f=j
print(count) | l = []
n = int(input())
st = input()
for i in st:
l.append(i)
count = 0
x = 0
y = 0
for j in l:
if x == 0 and y == 0:
c = 0
if j == "R":
x += 1
c = 1
else:
y += 1
c = 1
count = count
f = j
elif j == "R":
x += 1
if x == y:
c = 0
count = count
f=j
elif j == f and c == 0:
count += 1
c = 1
f=j
elif j == f and c == 1:
count = count
c = 1
f=j
elif j<"U":
y += 1
if x == y and j == f:
c = 0
count = count
f=j
elif j != f and c == 1:
count = count
c = 1
f=j
elif j == f and c == 1:
count = count
c = 1
f=j
elif j == f and c == 0:
count += 1
c = 1
f=j
print(count) | elif j<"U": | 35 | decision |
l = []
n = int(input())
st = input()
for i in st:
l.append(i)
count = 0
x = 0
y = 0
for j in l:
if x == 0 and y == 0:
c = 0
if j == "R":
x += 1
c = 1
else:
y += 1
c = 1
count = count
f = j
elif j == "R":
x += 1
if x == y:
c = 0
count = count
f=j
elif j == f and c == 0:
count += 1
c = 1
f=j
elif j == f and c == 1:
count = count
c = 1
f=j
elif j == "U":
y += 1
if x == y and j == f:
c = 0
count = count
f=j
elif j != f and c == 1:
count = count
c = 1
f=j
elif j == f and c == 1:
count = count
c = 1
f=j
elif j == f and c == 0:
count += 1
c = 1
f=j
print(count) | l = []
n = int(input())
st = input()
for i in st:
l.append(i)
count = 0
x = 0
y = 0
for j in l:
if x == 0 and y == 0:
c = 0
if j == "R":
x += 1
c = 1
else:
y += 1
c = 1
count = count
f = j
elif j == "R":
x += 1
if x == y:
c = 0
y = count
f=j
elif j == f and c == 0:
count += 1
c = 1
f=j
elif j == f and c == 1:
count = count
c = 1
f=j
elif j == "U":
y += 1
if x == y and j == f:
c = 0
count = count
f=j
elif j != f and c == 1:
count = count
c = 1
f=j
elif j == f and c == 1:
count = count
c = 1
f=j
elif j == f and c == 0:
count += 1
c = 1
f=j
print(count) | y = count | 25 | statement |
n,k = input().split()
n = int(n)
k = int(k)
res = 0
A = list(map(int, input().split()))
r = 0
if A[1]-A[0]>k:
res = -1
print("-1")
else:
s = 0
q = 0
for i in range(len(A)-1):
if A[i+1] - A[i] > k:
res = -1
print(res)
break
elif A[i+1] - A[i] <=k:
res += 1
while A[r] - A[s] <=k:
r+=1
q+=1
if r==len(A):
print(res)
raise SystemExit
break
s = r-1
i = s
| n,k = input().split()
n = int(n)
k = int(k)
res = 0
A = list(map(int, input().split()))
r = 0
if A[1]-A[0]>k:
res = -1
print("-1")
else:
s = 0
q = 0
for i in range(len(A)-1):
if A[i+1] - A[i] > k:
res = -1
print(res)
break
elif A[i+1] - A[i] <=k:
res += 1
while A[r]/A[s] <=k:
r+=1
q+=1
if r==len(A):
print(res)
raise SystemExit
break
s = r-1
i = s
| while A[r]/A[s] <=k: | 24 | operation |
n,k = input().split()
n = int(n)
k = int(k)
res = 0
A = list(map(int, input().split()))
r = 0
if A[1]-A[0]>k:
res = -1
print("-1")
else:
s = 0
q = 0
for i in range(len(A)-1):
if A[i+1] - A[i] > k:
res = -1
print(res)
break
elif A[i+1] - A[i] <=k:
res += 1
while A[r] - A[s] <=k:
r+=1
q+=1
if r==len(A):
print(res)
raise SystemExit
break
s = r-1
i = s
| n,k = input().split()
n = int(n)
k = int(k)
res = 0
A = list(map(int, input().split()))
r = 0
if A[1]-A[0]>k:
res = -1
print("-1")
else:
s = 0
q = 0
for i in range(len(A)-1):
if A[i+1] - A[i] > k:
res = -1
print(res)
break
elif A[i+1] - A[i] <=k:
res += 1
while A[r] - A[s] <=k:
r+=1
q+=1
if r<len(A):
print(res)
raise SystemExit
break
s = r-1
i = s
| if r<len(A): | 27 | decision |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.