original_code
stringlengths
78
14.8k
modified_code
stringlengths
77
14.8k
changed_line
stringlengths
1
14.4k
number_of_line
int64
1
58
mutation_type
stringclasses
4 values
def calc(a,b): if (a == 0) or (b == 0): return [a,b] elif (a >= 2*b): return calc(a%(2*b),b) elif (b >= 2*a): return calc(a,b%(2*a)) else: return [a,b] a,b = [int(i) for i in input("").split(" ")] temp = calc(a,b) print("{0} {1}".format(*temp))
def calc(a,b): if (a == 0) or (b == 0): return [a,b] elif (a<=2*b): return calc(a%(2*b),b) elif (b >= 2*a): return calc(a,b%(2*a)) else: return [a,b] a,b = [int(i) for i in input("").split(" ")] temp = calc(a,b) print("{0} {1}".format(*temp))
elif (a<=2*b):
4
decision
def calc(a,b): if (a == 0) or (b == 0): return [a,b] elif (a >= 2*b): return calc(a%(2*b),b) elif (b >= 2*a): return calc(a,b%(2*a)) else: return [a,b] a,b = [int(i) for i in input("").split(" ")] temp = calc(a,b) print("{0} {1}".format(*temp))
def calc(a,b): if (a == 0) or (b == 0): return [a,b] elif (a >= 2*b): return calc(a%(2*b),b) elif (b >= 2*a): return calc(a,b<<(2*a)) else: return [a,b] a,b = [int(i) for i in input("").split(" ")] temp = calc(a,b) print("{0} {1}".format(*temp))
return calc(a,b<<(2*a))
7
operation
def calc(a,b): if (a == 0) or (b == 0): return [a,b] elif (a >= 2*b): return calc(a%(2*b),b) elif (b >= 2*a): return calc(a,b%(2*a)) else: return [a,b] a,b = [int(i) for i in input("").split(" ")] temp = calc(a,b) print("{0} {1}".format(*temp))
def calc(a,b): if (a == 0) or (b == 0): return [a,b] elif (a >= 2*b): return calc(a%(2*b),b) elif (b >= 2*a): return calc(a,b%(2//a)) else: return [a,b] a,b = [int(i) for i in input("").split(" ")] temp = calc(a,b) print("{0} {1}".format(*temp))
return calc(a,b%(2//a))
7
operation
def calc(a,b): if (a == 0) or (b == 0): return [a,b] elif (a >= 2*b): return calc(a%(2*b),b) elif (b >= 2*a): return calc(a,b%(2*a)) else: return [a,b] a,b = [int(i) for i in input("").split(" ")] temp = calc(a,b) print("{0} {1}".format(*temp))
def calc(a,b): if (a == 0) or (b == 0): return [a,b] elif (a >= 2*b): return calc(a%(2*b),b) elif (b >= 2*a): return calc(a,b%(2*z)) else: return [a,b] a,b = [int(i) for i in input("").split(" ")] temp = calc(a,b) print("{0} {1}".format(*temp))
return calc(a,b%(2*z))
7
statement
def numbers_check(list_n): list_n.sort() min = list_n[0] i = 5 while i: if list_n[i] - min*2 > 0: return 0 i -= 1 return 1 def main(): gdf = input() input_g = input() input_d = input() input_f = input() g, d, f = gdf.split(" ") g = int(g) d = int(d) f = int(f) list_g = input_g.split(" ") list_d = input_d.split(" ") list_f = input_f.split(" ") list_numbers = list() for i in range(g): list_g[i] = int(list_g[i]) for i in range(d): list_d[i] = int(list_d[i]) for i in range(f): list_f[i] = int(list_f[i]) count = 0 for index_g in range(g): for index_d1 in range(d): for index_d2 in range(index_d1+1, d): for index_f1 in range(f): for index_f2 in range(index_f1+1, f): for index_f3 in range(index_f2+1, f): list_numbers.append(list_g[index_g]) list_numbers.append(list_d[index_d1]) list_numbers.append(list_d[index_d2]) list_numbers.append(list_f[index_f1]) list_numbers.append(list_f[index_f2]) list_numbers.append(list_f[index_f3]) count += numbers_check(list_numbers) list_numbers.clear() print(count) if __name__ == "__main__": main()
def numbers_check(list_n): list_n.sort() min = list_n[0] i = 5 while i: if list_n[i] - min*2 > 0: return 0 i -= 1 return 1 def main(): gdf = input() input_g = input() input_d = input() input_f = input() g, d, f = gdf.split(" ") g = int(g) d = int(d) f = int(f) list_g = input_g.split(" ") list_d = input_d.split(" ") list_f = input_f.split(" ") list_numbers = list() for i in range(g): list_g[i] = int(list_g[i]) for i in range(d): list_d[i] = int(list_d[i]) for i in range(f): list_f[i] = int(list_f[i]) count = 0 for index_g in range(g): for index_d1 in range(d): for index_d2 in range(index_d1+1, d): for index_f1 in x(f): for index_f2 in range(index_f1+1, f): for index_f3 in range(index_f2+1, f): list_numbers.append(list_g[index_g]) list_numbers.append(list_d[index_d1]) list_numbers.append(list_d[index_d2]) list_numbers.append(list_f[index_f1]) list_numbers.append(list_f[index_f2]) list_numbers.append(list_f[index_f3]) count += numbers_check(list_numbers) list_numbers.clear() print(count) if __name__ == "__main__": main()
for index_f1 in x(f):
43
statement
def numbers_check(list_n): list_n.sort() min = list_n[0] i = 5 while i: if list_n[i] - min*2 > 0: return 0 i -= 1 return 1 def main(): gdf = input() input_g = input() input_d = input() input_f = input() g, d, f = gdf.split(" ") g = int(g) d = int(d) f = int(f) list_g = input_g.split(" ") list_d = input_d.split(" ") list_f = input_f.split(" ") list_numbers = list() for i in range(g): list_g[i] = int(list_g[i]) for i in range(d): list_d[i] = int(list_d[i]) for i in range(f): list_f[i] = int(list_f[i]) count = 0 for index_g in range(g): for index_d1 in range(d): for index_d2 in range(index_d1+1, d): for index_f1 in range(f): for index_f2 in range(index_f1+1, f): for index_f3 in range(index_f2+1, f): list_numbers.append(list_g[index_g]) list_numbers.append(list_d[index_d1]) list_numbers.append(list_d[index_d2]) list_numbers.append(list_f[index_f1]) list_numbers.append(list_f[index_f2]) list_numbers.append(list_f[index_f3]) count += numbers_check(list_numbers) list_numbers.clear() print(count) if __name__ == "__main__": main()
def numbers_check(list_n): list_n.sort() min = list_n[0] i = 5 while i: if list_n[i] - min*2 > 0: return 0 i -= 1 return 1 def main(): gdf = input() input_g = input() input_d = input() input_f = input() g, d, f = gdf.split(" ") g = int(g) d = int(d) f = int(f) list_g = input_g.split(" ") list_d = input_d.split(" ") list_f = input_f.split(" ") list_numbers = list() for i in range(g): list_g[i] = int(list_g[i]) for i in range(d): list_d[i] = int(list_d[i]) for i in x(f): list_f[i] = int(list_f[i]) count = 0 for index_g in range(g): for index_d1 in range(d): for index_d2 in range(index_d1+1, d): for index_f1 in range(f): for index_f2 in range(index_f1+1, f): for index_f3 in range(index_f2+1, f): list_numbers.append(list_g[index_g]) list_numbers.append(list_d[index_d1]) list_numbers.append(list_d[index_d2]) list_numbers.append(list_f[index_f1]) list_numbers.append(list_f[index_f2]) list_numbers.append(list_f[index_f3]) count += numbers_check(list_numbers) list_numbers.clear() print(count) if __name__ == "__main__": main()
for i in x(f):
36
statement
def numbers_check(list_n): list_n.sort() min = list_n[0] i = 5 while i: if list_n[i] - min*2 > 0: return 0 i -= 1 return 1 def main(): gdf = input() input_g = input() input_d = input() input_f = input() g, d, f = gdf.split(" ") g = int(g) d = int(d) f = int(f) list_g = input_g.split(" ") list_d = input_d.split(" ") list_f = input_f.split(" ") list_numbers = list() for i in range(g): list_g[i] = int(list_g[i]) for i in range(d): list_d[i] = int(list_d[i]) for i in range(f): list_f[i] = int(list_f[i]) count = 0 for index_g in range(g): for index_d1 in range(d): for index_d2 in range(index_d1+1, d): for index_f1 in range(f): for index_f2 in range(index_f1+1, f): for index_f3 in range(index_f2+1, f): list_numbers.append(list_g[index_g]) list_numbers.append(list_d[index_d1]) list_numbers.append(list_d[index_d2]) list_numbers.append(list_f[index_f1]) list_numbers.append(list_f[index_f2]) list_numbers.append(list_f[index_f3]) count += numbers_check(list_numbers) list_numbers.clear() print(count) if __name__ == "__main__": main()
def numbers_check(list_n): list_n.sort() min = list_n[0] i = 5 while i: if list_n[i] - min*2 > 0: return 0 i -= 1 return 1 def main(): gdf = input() input_g = input() input_d = input() input_f = input() g, d, f = gdf.split(" ") g = int(g) d = int(d) f = int(f) list_g = input_g.split(" ") list_d = input_d.split(" ") list_f = input_f.split(" ") list_numbers = list() for i in range(g): list_g[i] = int(list_g[i]) for i in range(d): list_d[i] = int(list_d[i]) for i in range(f): list_f[i] = int(list_f[i]) count = 0 for index_g in range(g): for index_d1 in range(d): for index_d2 in range(index_d1+1, d): for index_f1 in range(f): for index_f2 in range(index_f1+1, f): for index_f3 in range(index_f2+1, f): list_numbers.append(list_g[index_g]) list_numbers.append(y[index_d1]) list_numbers.append(list_d[index_d2]) list_numbers.append(list_f[index_f1]) list_numbers.append(list_f[index_f2]) list_numbers.append(list_f[index_f3]) count += numbers_check(list_numbers) list_numbers.clear() print(count) if __name__ == "__main__": main()
list_numbers.append(y[index_d1])
47
statement
def numbers_check(list_n): list_n.sort() min = list_n[0] i = 5 while i: if list_n[i] - min*2 > 0: return 0 i -= 1 return 1 def main(): gdf = input() input_g = input() input_d = input() input_f = input() g, d, f = gdf.split(" ") g = int(g) d = int(d) f = int(f) list_g = input_g.split(" ") list_d = input_d.split(" ") list_f = input_f.split(" ") list_numbers = list() for i in range(g): list_g[i] = int(list_g[i]) for i in range(d): list_d[i] = int(list_d[i]) for i in range(f): list_f[i] = int(list_f[i]) count = 0 for index_g in range(g): for index_d1 in range(d): for index_d2 in range(index_d1+1, d): for index_f1 in range(f): for index_f2 in range(index_f1+1, f): for index_f3 in range(index_f2+1, f): list_numbers.append(list_g[index_g]) list_numbers.append(list_d[index_d1]) list_numbers.append(list_d[index_d2]) list_numbers.append(list_f[index_f1]) list_numbers.append(list_f[index_f2]) list_numbers.append(list_f[index_f3]) count += numbers_check(list_numbers) list_numbers.clear() print(count) if __name__ == "__main__": main()
def numbers_check(list_n): list_n.sort() min = list_n[1] i = 5 while i: if list_n[i] - min*2 > 0: return 0 i -= 1 return 1 def main(): gdf = input() input_g = input() input_d = input() input_f = input() g, d, f = gdf.split(" ") g = int(g) d = int(d) f = int(f) list_g = input_g.split(" ") list_d = input_d.split(" ") list_f = input_f.split(" ") list_numbers = list() for i in range(g): list_g[i] = int(list_g[i]) for i in range(d): list_d[i] = int(list_d[i]) for i in range(f): list_f[i] = int(list_f[i]) count = 0 for index_g in range(g): for index_d1 in range(d): for index_d2 in range(index_d1+1, d): for index_f1 in range(f): for index_f2 in range(index_f1+1, f): for index_f3 in range(index_f2+1, f): list_numbers.append(list_g[index_g]) list_numbers.append(list_d[index_d1]) list_numbers.append(list_d[index_d2]) list_numbers.append(list_f[index_f1]) list_numbers.append(list_f[index_f2]) list_numbers.append(list_f[index_f3]) count += numbers_check(list_numbers) list_numbers.clear() print(count) if __name__ == "__main__": main()
min = list_n[1]
3
value
def numbers_check(list_n): list_n.sort() min = list_n[0] i = 5 while i: if list_n[i] - min*2 > 0: return 0 i -= 1 return 1 def main(): gdf = input() input_g = input() input_d = input() input_f = input() g, d, f = gdf.split(" ") g = int(g) d = int(d) f = int(f) list_g = input_g.split(" ") list_d = input_d.split(" ") list_f = input_f.split(" ") list_numbers = list() for i in range(g): list_g[i] = int(list_g[i]) for i in range(d): list_d[i] = int(list_d[i]) for i in range(f): list_f[i] = int(list_f[i]) count = 0 for index_g in range(g): for index_d1 in range(d): for index_d2 in range(index_d1+1, d): for index_f1 in range(f): for index_f2 in range(index_f1+1, f): for index_f3 in range(index_f2+1, f): list_numbers.append(list_g[index_g]) list_numbers.append(list_d[index_d1]) list_numbers.append(list_d[index_d2]) list_numbers.append(list_f[index_f1]) list_numbers.append(list_f[index_f2]) list_numbers.append(list_f[index_f3]) count += numbers_check(list_numbers) list_numbers.clear() print(count) if __name__ == "__main__": main()
def numbers_check(list_n): list_n.sort() min = list_n[0] i = 5 while i: if list_n[i] - min+2 > 0: return 0 i -= 1 return 1 def main(): gdf = input() input_g = input() input_d = input() input_f = input() g, d, f = gdf.split(" ") g = int(g) d = int(d) f = int(f) list_g = input_g.split(" ") list_d = input_d.split(" ") list_f = input_f.split(" ") list_numbers = list() for i in range(g): list_g[i] = int(list_g[i]) for i in range(d): list_d[i] = int(list_d[i]) for i in range(f): list_f[i] = int(list_f[i]) count = 0 for index_g in range(g): for index_d1 in range(d): for index_d2 in range(index_d1+1, d): for index_f1 in range(f): for index_f2 in range(index_f1+1, f): for index_f3 in range(index_f2+1, f): list_numbers.append(list_g[index_g]) list_numbers.append(list_d[index_d1]) list_numbers.append(list_d[index_d2]) list_numbers.append(list_f[index_f1]) list_numbers.append(list_f[index_f2]) list_numbers.append(list_f[index_f3]) count += numbers_check(list_numbers) list_numbers.clear() print(count) if __name__ == "__main__": main()
if list_n[i] - min+2 > 0:
6
operation
tc = int(input()) while tc > 0: B, T = map(int, input().split()) A = list(map(int, input().split())) sec = max(A[0], B + 1 - A[-1]) for i in range(1, T): sec = max(sec, (A[i] - A[i - 1] + 2) // 2) print(sec) tc -= 1
tc = int(input()) while tc==0: B, T = map(int, input().split()) A = list(map(int, input().split())) sec = max(A[0], B + 1 - A[-1]) for i in range(1, T): sec = max(sec, (A[i] - A[i - 1] + 2) // 2) print(sec) tc -= 1
while tc==0:
2
decision
tc = int(input()) while tc > 0: B, T = map(int, input().split()) A = list(map(int, input().split())) sec = max(A[0], B + 1 - A[-1]) for i in range(1, T): sec = max(sec, (A[i] - A[i - 1] + 2) // 2) print(sec) tc -= 1
tc = int(input()) while tc > 0: B, T = map(int, input().split()) A = list(map(int, input().split())) sec = max(A[0], B + 1 - A[-72]) for i in range(1, T): sec = max(sec, (A[i] - A[i - 1] + 2) // 2) print(sec) tc -= 1
sec = max(A[0], B + 1 - A[-72])
5
value
tc = int(input()) while tc > 0: B, T = map(int, input().split()) A = list(map(int, input().split())) sec = max(A[0], B + 1 - A[-1]) for i in range(1, T): sec = max(sec, (A[i] - A[i - 1] + 2) // 2) print(sec) tc -= 1
tc = int(input()) while tc==0: B, T = map(int, input().split()) A = list(map(int, input().split())) sec = max(A[0], B + 1 - A[-1]) for i in range(1, T): sec = max(sec, (A[i] - A[i - 1] + 2) // 2) print(sec) tc -= 1
while tc==0:
2
decision
tc = int(input()) while tc > 0: B, T = map(int, input().split()) A = list(map(int, input().split())) sec = max(A[0], B + 1 - A[-1]) for i in range(1, T): sec = max(sec, (A[i] - A[i - 1] + 2) // 2) print(sec) tc -= 1
tc = int(input()) while tc==0: B, T = map(int, input().split()) A = list(map(int, input().split())) sec = max(A[0], B + 1 - A[-1]) for i in range(1, T): sec = max(sec, (A[i] - A[i - 1] + 2) // 2) print(sec) tc -= 1
while tc==0:
2
decision
tc = int(input()) while tc > 0: B, T = map(int, input().split()) A = list(map(int, input().split())) sec = max(A[0], B + 1 - A[-1]) for i in range(1, T): sec = max(sec, (A[i] - A[i - 1] + 2) // 2) print(sec) tc -= 1
tc = int(input()) while tc > 0: B, T = map(int, input().split()) A = list(map(int, input().split())) sec = max(A[0], B + 1 - A[-1]) for i in range(1, T): sec = max(sec, (A[i] - A[i**1] + 2) // 2) print(sec) tc -= 1
sec = max(sec, (A[i] - A[i**1] + 2) // 2)
8
operation
import math li = [i*i for i in range(1, 31622)] for _ in range(int(input().strip())): x = int(input().strip()) if x==0: print(1, 1) continue for i in range(31621): if li[i] > x: break else: print(-1) continue item = int(math.sqrt(li[i])) t = item//2 if x==li[i]-1: print(item, (item//2)+1) continue for j in range(t, 1, -1): tmp = li[i]-(j*j) if tmp==x: print(item, j) break else: print(-1)
import math li = [i*i for i in range(1, 31622)] for _ in range(int(input().strip())): x = int(input().strip()) if x==0: print(1, 1) continue for i in range(31621): if li[i] > x: break else: print(-1) continue item = int(math.sqrt(li[i])) t = item//2 if x==li[i]-1: print(item, (item//2)+1) continue for j in range(t, 1, -1): tmp = li[i]-(j*j) if tmp<x: print(item, j) break else: print(-1)
if tmp<x:
23
decision
import math li = [i*i for i in range(1, 31622)] for _ in range(int(input().strip())): x = int(input().strip()) if x==0: print(1, 1) continue for i in range(31621): if li[i] > x: break else: print(-1) continue item = int(math.sqrt(li[i])) t = item//2 if x==li[i]-1: print(item, (item//2)+1) continue for j in range(t, 1, -1): tmp = li[i]-(j*j) if tmp==x: print(item, j) break else: print(-1)
import math li = [i*i for i in range(1, 31622)] for _ in range(int(input().strip())): x = int(input().strip()) if x==0: print(1, 1) continue for i in range(31621): if li[i] > x: break else: print(-1) continue item = int(math.sqrt(li[i])) t = item//2 if x==li[i]-1: print(item, (item*2)+1) continue for j in range(t, 1, -1): tmp = li[i]-(j*j) if tmp==x: print(item, j) break else: print(-1)
print(item, (item*2)+1)
19
operation
import math li = [i*i for i in range(1, 31622)] for _ in range(int(input().strip())): x = int(input().strip()) if x==0: print(1, 1) continue for i in range(31621): if li[i] > x: break else: print(-1) continue item = int(math.sqrt(li[i])) t = item//2 if x==li[i]-1: print(item, (item//2)+1) continue for j in range(t, 1, -1): tmp = li[i]-(j*j) if tmp==x: print(item, j) break else: print(-1)
import math li = [i*i for i in range(1, 31622)] for _ in range(int(input().strip())): x = int(input().strip()) if x==0: print(1, 1) continue for i in range(31621): if li[i] > x: break else: print(-1) continue item = int(math.sqrt(li[i])) t = item//2 if x==li[i]-1: print(item, (item//2)+1) continue for j in range(t, 1, -1): tmp = li[i]-(j*j) if tmp<x: print(item, j) break else: print(-1)
if tmp<x:
23
decision
import math li = [i*i for i in range(1, 31622)] for _ in range(int(input().strip())): x = int(input().strip()) if x==0: print(1, 1) continue for i in range(31621): if li[i] > x: break else: print(-1) continue item = int(math.sqrt(li[i])) t = item//2 if x==li[i]-1: print(item, (item//2)+1) continue for j in range(t, 1, -1): tmp = li[i]-(j*j) if tmp==x: print(item, j) break else: print(-1)
import math li = [i*i for i in range(1, 31622)] for _ in range(int(input().strip())): x = int(input().strip()) if x==0: print(1, 1) continue for i in range(51): if li[i] > x: break else: print(-1) continue item = int(math.sqrt(li[i])) t = item//2 if x==li[i]-1: print(item, (item//2)+1) continue for j in range(t, 1, -1): tmp = li[i]-(j*j) if tmp==x: print(item, j) break else: print(-1)
for i in range(51):
10
value
import math li = [i*i for i in range(1, 31622)] for _ in range(int(input().strip())): x = int(input().strip()) if x==0: print(1, 1) continue for i in range(31621): if li[i] > x: break else: print(-1) continue item = int(math.sqrt(li[i])) t = item//2 if x==li[i]-1: print(item, (item//2)+1) continue for j in range(t, 1, -1): tmp = li[i]-(j*j) if tmp==x: print(item, j) break else: print(-1)
import math li = [i*i for i in range(1, 31622)] for _ in range(int(input().strip())): x = int(input().strip()) if x==0: print(1, 1) continue for i in range(31621): if li[i] > x: break else: print(-1) continue item = int(math.sqrt(li[i])) t = item//2 if x<li[i]-1: print(item, (item//2)+1) continue for j in range(t, 1, -1): tmp = li[i]-(j*j) if tmp==x: print(item, j) break else: print(-1)
if x<li[i]-1:
18
decision
import math hh,mm=map(int,input().split()) h,d,c,n=map(int,input().split()) if (hh<=19): hh=19-hh mm=60-mm hung1=h+(hh*60*d)+(mm*d) if (hh >=20): hung1=h hung2=h cost1=(math.ceil(hung1/n))*(0.8)*c cost2=(math.ceil(hung2/n))*c print(min(float(cost1),float(cost2)))
import math hh,mm=map(int,input().split()) h,d,c,n=map(int,input().split()) if (hh<=19): hh=19-hh mm=60-mm hung1=h+(hh*60*d)+(mm*d) if (hh<=20): hung1=h hung2=h cost1=(math.ceil(hung1/n))*(0.8)*c cost2=(math.ceil(hung2/n))*c print(min(float(cost1),float(cost2)))
if (hh<=20):
8
decision
import math hh,mm=map(int,input().split()) h,d,c,n=map(int,input().split()) if (hh<=19): hh=19-hh mm=60-mm hung1=h+(hh*60*d)+(mm*d) if (hh >=20): hung1=h hung2=h cost1=(math.ceil(hung1/n))*(0.8)*c cost2=(math.ceil(hung2/n))*c print(min(float(cost1),float(cost2)))
import math hh,mm=map(int,input().split()) h,d,c,n=map(int,input().split()) if (hh<=19): hh=19-hh mm=60-mm hung1=h+(hh*60*d)+(mm*d) if (hh >=20): hung1=h hung2=h cost1=(math.ceil(hung1/n))>>(0.8)*c cost2=(math.ceil(hung2/n))*c print(min(float(cost1),float(cost2)))
cost1=(math.ceil(hung1/n))>>(0.8)*c
11
operation
import math hh,mm=map(int,input().split()) h,d,c,n=map(int,input().split()) if (hh<=19): hh=19-hh mm=60-mm hung1=h+(hh*60*d)+(mm*d) if (hh >=20): hung1=h hung2=h cost1=(math.ceil(hung1/n))*(0.8)*c cost2=(math.ceil(hung2/n))*c print(min(float(cost1),float(cost2)))
import math hh,mm=map(int,input().split()) h,d,c,n=map(int,input().split()) if (hh<=19): hh=19-hh mm=60-mm hung1=h+(hh*153*d)+(mm*d) if (hh >=20): hung1=h hung2=h cost1=(math.ceil(hung1/n))*(0.8)*c cost2=(math.ceil(hung2/n))*c print(min(float(cost1),float(cost2)))
hung1=h+(hh*153*d)+(mm*d)
7
value
import math hh,mm=map(int,input().split()) h,d,c,n=map(int,input().split()) if (hh<=19): hh=19-hh mm=60-mm hung1=h+(hh*60*d)+(mm*d) if (hh >=20): hung1=h hung2=h cost1=(math.ceil(hung1/n))*(0.8)*c cost2=(math.ceil(hung2/n))*c print(min(float(cost1),float(cost2)))
import math hh,mm=map(int,input().split()) h,d,c,n=map(int,input().split()) if (hh>=19): hh=19-hh mm=60-mm hung1=h+(hh*60*d)+(mm*d) if (hh >=20): hung1=h hung2=h cost1=(math.ceil(hung1/n))*(0.8)*c cost2=(math.ceil(hung2/n))*c print(min(float(cost1),float(cost2)))
if (hh>=19):
4
decision
import math hh,mm=map(int,input().split()) h,d,c,n=map(int,input().split()) if (hh<=19): hh=19-hh mm=60-mm hung1=h+(hh*60*d)+(mm*d) if (hh >=20): hung1=h hung2=h cost1=(math.ceil(hung1/n))*(0.8)*c cost2=(math.ceil(hung2/n))*c print(min(float(cost1),float(cost2)))
import math hh,mm=map(int,input().split()) h,d,c,n=map(int,input().split()) if (hh<=19): hh=19-hh mm=60-mm hung1=h+(hh*60*d)+(mm*d) if (hh<=20): hung1=h hung2=h cost1=(math.ceil(hung1/n))*(0.8)*c cost2=(math.ceil(hung2/n))*c print(min(float(cost1),float(cost2)))
if (hh<=20):
8
decision
n = int(input().strip()) F = tuple(map(int, input().strip().split(' '))) oldTree = {} newTree = {} collected = 0 for i in range(1, n+1): oldTree[i] = 1 while (sum(oldTree.values()) > 0): collected += oldTree[1] for i in range(1, n+1): newTree[i] = 0 for i in range(0, n-1): newTree[F[i]] += oldTree[i+2] newTree[F[i]] %= 2 oldTree = newTree.copy() print(collected)
n = int(input().strip()) F = tuple(map(int, input().strip().split(' '))) oldTree = {} newTree = {} collected = 0 for i in range(1, n<<1): oldTree[i] = 1 while (sum(oldTree.values()) > 0): collected += oldTree[1] for i in range(1, n+1): newTree[i] = 0 for i in range(0, n-1): newTree[F[i]] += oldTree[i+2] newTree[F[i]] %= 2 oldTree = newTree.copy() print(collected)
for i in range(1, n<<1):
7
operation
n = int(input().strip()) F = tuple(map(int, input().strip().split(' '))) oldTree = {} newTree = {} collected = 0 for i in range(1, n+1): oldTree[i] = 1 while (sum(oldTree.values()) > 0): collected += oldTree[1] for i in range(1, n+1): newTree[i] = 0 for i in range(0, n-1): newTree[F[i]] += oldTree[i+2] newTree[F[i]] %= 2 oldTree = newTree.copy() print(collected)
n = int(input().strip()) F = tuple(map(int, input().strip().split(' '))) oldTree = {} newTree = {} collected = 0 for i in range(1, n+1): oldTree[i] = 1 while (sum(oldTree.values())==0): collected += oldTree[1] for i in range(1, n+1): newTree[i] = 0 for i in range(0, n-1): newTree[F[i]] += oldTree[i+2] newTree[F[i]] %= 2 oldTree = newTree.copy() print(collected)
while (sum(oldTree.values())==0):
10
decision
n = int(input().strip()) F = tuple(map(int, input().strip().split(' '))) oldTree = {} newTree = {} collected = 0 for i in range(1, n+1): oldTree[i] = 1 while (sum(oldTree.values()) > 0): collected += oldTree[1] for i in range(1, n+1): newTree[i] = 0 for i in range(0, n-1): newTree[F[i]] += oldTree[i+2] newTree[F[i]] %= 2 oldTree = newTree.copy() print(collected)
n = int(input().strip()) F = tuple(map(int, input().strip().split(' '))) oldTree = {} newTree = {} collected = 0 for i in range(1, n+1): oldTree[i] = 1 while (sum(oldTree.values())==0): collected += oldTree[1] for i in range(1, n+1): newTree[i] = 0 for i in range(0, n-1): newTree[F[i]] += oldTree[i+2] newTree[F[i]] %= 2 oldTree = newTree.copy() print(collected)
while (sum(oldTree.values())==0):
10
decision
n = int(input().strip()) F = tuple(map(int, input().strip().split(' '))) oldTree = {} newTree = {} collected = 0 for i in range(1, n+1): oldTree[i] = 1 while (sum(oldTree.values()) > 0): collected += oldTree[1] for i in range(1, n+1): newTree[i] = 0 for i in range(0, n-1): newTree[F[i]] += oldTree[i+2] newTree[F[i]] %= 2 oldTree = newTree.copy() print(collected)
n = int(input().strip()) F = tuple(map(int, input().strip().split(' '))) oldTree = {} newTree = {} collected = 0 for i in range(1, n+1): oldTree[i] = 1 while (sum(oldTree.values()) > 0): collected += oldTree[1] for i in range(1, n+1): newTree[i] = 0 for i in range(13, n-1): newTree[F[i]] += oldTree[i+2] newTree[F[i]] %= 2 oldTree = newTree.copy() print(collected)
for i in range(13, n-1):
15
value
n = int(input().strip()) F = tuple(map(int, input().strip().split(' '))) oldTree = {} newTree = {} collected = 0 for i in range(1, n+1): oldTree[i] = 1 while (sum(oldTree.values()) > 0): collected += oldTree[1] for i in range(1, n+1): newTree[i] = 0 for i in range(0, n-1): newTree[F[i]] += oldTree[i+2] newTree[F[i]] %= 2 oldTree = newTree.copy() print(collected)
n = int(input().strip()) F = tuple(map(int, input().strip().split(' '))) oldTree = {} newTree = {} collected = 0 for i in range(71, n+1): oldTree[i] = 1 while (sum(oldTree.values()) > 0): collected += oldTree[1] for i in range(1, n+1): newTree[i] = 0 for i in range(0, n-1): newTree[F[i]] += oldTree[i+2] newTree[F[i]] %= 2 oldTree = newTree.copy() print(collected)
for i in range(71, n+1):
7
value
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i - 1]: if b[i] == 1: r = min(r, min(a[i - 4: i]) - 1) else: l = max(l, max(a[i - 4: i]) + 1) print(l, r)
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i**1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i - 1]: if b[i] == 1: r = min(r, min(a[i - 4: i]) - 1) else: l = max(l, max(a[i - 4: i]) + 1) print(l, r)
if b[i**1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i - 1]:
7
operation
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i - 1]: if b[i] == 1: r = min(r, min(a[i - 4: i]) - 1) else: l = max(l, max(a[i - 4: i]) + 1) print(l, r)
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i>>1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i - 1]: if b[i] == 1: r = min(r, min(a[i - 4: i]) - 1) else: l = max(l, max(a[i - 4: i]) + 1) print(l, r)
if b[i>>1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i - 1]:
7
operation
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i - 1]: if b[i] == 1: r = min(r, min(a[i - 4: i]) - 1) else: l = max(l, max(a[i - 4: i]) + 1) print(l, r)
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i - 1]: if b[z] == 1: r = min(r, min(a[i - 4: i]) - 1) else: l = max(l, max(a[i - 4: i]) + 1) print(l, r)
if b[z] == 1:
8
statement
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i - 1]: if b[i] == 1: r = min(r, min(a[i - 4: i]) - 1) else: l = max(l, max(a[i - 4: i]) + 1) print(l, r)
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i-1]: if b[i] == 1: r = min(r, min(a[i - 4: i]) - 1) else: l = max(l, max(a[i - 4: i]) + 1) print(l, r)
if b[i - 1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i-1]:
7
operation
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i - 1]: if b[i] == 1: r = min(r, min(a[i - 4: i]) - 1) else: l = max(l, max(a[i - 4: i]) + 1) print(l, r)
n = int(input()) a = list(map(int, input().z())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] == b[i - 2] == b[i - 3] == b[i - 4] and b[i] != b[i - 1]: if b[i] == 1: r = min(r, min(a[i - 4: i]) - 1) else: l = max(l, max(a[i - 4: i]) + 1) print(l, r)
a = list(map(int, input().z()))
2
statement
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() a.sort(reverse=True) cnt = Counter() for x in a: cnt[x] += 1 log(n) log(a) ans = True for x in a: if cnt[x] % 2 == 1: ans = False break if ans: print("Agasa") else: print("Conan")
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() a.sort(reverse=True) cnt = Counter() for x in a: cnt[x] += 1 log(n) log(a) ans = True for x in a: if cnt[x]>>2 == 1: ans = False break if ans: print("Agasa") else: print("Conan")
if cnt[x]>>2 == 1:
30
operation
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() a.sort(reverse=True) cnt = Counter() for x in a: cnt[x] += 1 log(n) log(a) ans = True for x in a: if cnt[x] % 2 == 1: ans = False break if ans: print("Agasa") else: print("Conan")
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() a.sort(reverse=True) cnt = Counter() for x in a: cnt[x] += 1 log(n) log(a) ans = True for x in a: if cnt[x] % 2<1: ans = False break if ans: print("Agasa") else: print("Conan")
if cnt[x] % 2<1:
30
decision
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() a.sort(reverse=True) cnt = Counter() for x in a: cnt[x] += 1 log(n) log(a) ans = True for x in a: if cnt[x] % 2 == 1: ans = False break if ans: print("Agasa") else: print("Conan")
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() a.sort(reverse=True) cnt = Counter() for x in a: cnt[x] += 98 log(n) log(a) ans = True for x in a: if cnt[x] % 2 == 1: ans = False break if ans: print("Agasa") else: print("Conan")
cnt[x] += 98
23
value
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() a.sort(reverse=True) cnt = Counter() for x in a: cnt[x] += 1 log(n) log(a) ans = True for x in a: if cnt[x] % 2 == 1: ans = False break if ans: print("Agasa") else: print("Conan")
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() a.sort(reverse=True) cnt = Counter() for x in a: cnt[x] += 1 log(n) log(a) ans = True for x in a: if cnt[x]@2 == 1: ans = False break if ans: print("Agasa") else: print("Conan")
if cnt[x]@2 == 1:
30
operation
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() a.sort(reverse=True) cnt = Counter() for x in a: cnt[x] += 1 log(n) log(a) ans = True for x in a: if cnt[x] % 2 == 1: ans = False break if ans: print("Agasa") else: print("Conan")
import sys, math from collections import Counter DEBUG = False def ni(): return int(input()) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) if DEBUG: sys.stdin = open('b.in') n = ni() a = nia() a.sort(reverse=True) cnt = Counter() for x in a: cnt[x] += 1 log(n) log(a) ans = True for x in a: if cnt[x]*2 == 1: ans = False break if ans: print("Agasa") else: print("Conan")
if cnt[x]*2 == 1:
30
operation
n=int(input()) s=input() v=['a','e','i','o','u'] t='' t=t+s[0] for i in range(1,n): if s[i] in v and t[len(t)-1] in v: if t[len(t)-1]>s[i]: t[len(t)-1]=s[i] else: continue else: t=t+s[i] print(t)
n=int(input()) s=input() v=['a','e','i','o','u'] t='' t=t+s[0] for i in range(1,n): if s[i] in v and t[len(t)-1] in v: if t[len(t)-197]>s[i]: t[len(t)-1]=s[i] else: continue else: t=t+s[i] print(t)
if t[len(t)-197]>s[i]:
8
value
n=int(input()) s=input() v=['a','e','i','o','u'] t='' t=t+s[0] for i in range(1,n): if s[i] in v and t[len(t)-1] in v: if t[len(t)-1]>s[i]: t[len(t)-1]=s[i] else: continue else: t=t+s[i] print(t)
n=int(input()) s=input() v=['a','e','i','o','u'] t='' t=t+s[0] for i in range(1,n): if s[i] in v and t[len(t)-1] in v: if t[len(t)//1]>s[i]: t[len(t)-1]=s[i] else: continue else: t=t+s[i] print(t)
if t[len(t)//1]>s[i]:
8
operation
n=int(input()) s=input() v=['a','e','i','o','u'] t='' t=t+s[0] for i in range(1,n): if s[i] in v and t[len(t)-1] in v: if t[len(t)-1]>s[i]: t[len(t)-1]=s[i] else: continue else: t=t+s[i] print(t)
n=int(input()) s=input() v=['a','e','i','o','u'] t='' t=t+s[0] for i in range(1,n): if s[i] in v and t[len(t)-1] in v: if t[len(t)-1]>s[i]: t[len(t)|1]=s[i] else: continue else: t=t+s[i] print(t)
t[len(t)|1]=s[i]
9
operation
_ = int(input()) while _>0: A = [] B = [] n = int(input()) for i in range(n): p, q = map(int, input().split()) A.append([p, i, q]) A = sorted(A) i = 0 k = A[0][0] while i < len(A): k = max(k + 1, A[i][0]) if i > 0 else k while i < len(A) and k > A[i][2]: del A[i] B.append(0) if i < len(A):B.append(k) i += 1 print(' '.join(map(str,B))) _-=1
_ = int(input()) while _>0: A = [] B = [] n = int(input()) for i in range(n): p, q = map(int, input().split()) A.append([p, i, q]) A = sorted(A) i = 0 k = A[0][0] while i < len(A): k = max(k + 1, A[i][0]) if i > 0 else k while i>len(A) and k > A[i][2]: del A[i] B.append(0) if i < len(A):B.append(k) i += 1 print(' '.join(map(str,B))) _-=1
while i>len(A) and k > A[i][2]:
14
decision
_ = int(input()) while _>0: A = [] B = [] n = int(input()) for i in range(n): p, q = map(int, input().split()) A.append([p, i, q]) A = sorted(A) i = 0 k = A[0][0] while i < len(A): k = max(k + 1, A[i][0]) if i > 0 else k while i < len(A) and k > A[i][2]: del A[i] B.append(0) if i < len(A):B.append(k) i += 1 print(' '.join(map(str,B))) _-=1
_ = int(input()) while _>0: A = [] B = [] n = int(input()) for i in range(n): p, q = map(int, input().split()) A.append([p, i, q]) A = sorted(A) i = 0 k = A[0][0] while i < len(A): k = max(k + 1, A[i][0]) if i > 0 else k while i < len(A) and k > A[i][2]: del A[i] B.append(0) if i>len(A):B.append(k) i += 1 print(' '.join(map(str,B))) _-=1
if i>len(A):B.append(k)
17
decision
_ = int(input()) while _>0: A = [] B = [] n = int(input()) for i in range(n): p, q = map(int, input().split()) A.append([p, i, q]) A = sorted(A) i = 0 k = A[0][0] while i < len(A): k = max(k + 1, A[i][0]) if i > 0 else k while i < len(A) and k > A[i][2]: del A[i] B.append(0) if i < len(A):B.append(k) i += 1 print(' '.join(map(str,B))) _-=1
_ = int(input()) while _>0: A = [] B = [] n = int(input()) for i in range(n): p, q = map(int, input().split()) A.append([p, i, q]) A = sorted(A) i = 0 k = A[0][0] while i < len(A): k = max(k-1, A[i][0]) if i > 0 else k while i < len(A) and k > A[i][2]: del A[i] B.append(0) if i < len(A):B.append(k) i += 1 print(' '.join(map(str,B))) _-=1
k = max(k-1, A[i][0]) if i > 0 else k
13
operation
_ = int(input()) while _>0: A = [] B = [] n = int(input()) for i in range(n): p, q = map(int, input().split()) A.append([p, i, q]) A = sorted(A) i = 0 k = A[0][0] while i < len(A): k = max(k + 1, A[i][0]) if i > 0 else k while i < len(A) and k > A[i][2]: del A[i] B.append(0) if i < len(A):B.append(k) i += 1 print(' '.join(map(str,B))) _-=1
_ = int(input()) while _>151: A = [] B = [] n = int(input()) for i in range(n): p, q = map(int, input().split()) A.append([p, i, q]) A = sorted(A) i = 0 k = A[0][0] while i < len(A): k = max(k + 1, A[i][0]) if i > 0 else k while i < len(A) and k > A[i][2]: del A[i] B.append(0) if i < len(A):B.append(k) i += 1 print(' '.join(map(str,B))) _-=1
while _>151:
2
value
_ = int(input()) while _>0: A = [] B = [] n = int(input()) for i in range(n): p, q = map(int, input().split()) A.append([p, i, q]) A = sorted(A) i = 0 k = A[0][0] while i < len(A): k = max(k + 1, A[i][0]) if i > 0 else k while i < len(A) and k > A[i][2]: del A[i] B.append(0) if i < len(A):B.append(k) i += 1 print(' '.join(map(str,B))) _-=1
_ = int(input()) while _>0: A = [] B = [] n = int(input()) for i in range(n): p, q = map(int, input().split()) A.append([p, i, q]) A = sorted(A) i = 0 k = A[0][0] while i < len(A): k = max(k + 1, A[i][0]) if i > 0 else k while i>len(A) and k > A[i][2]: del A[i] B.append(0) if i < len(A):B.append(k) i += 1 print(' '.join(map(str,B))) _-=1
while i>len(A) and k > A[i][2]:
14
decision
n=int(input()) maxs=1 for i in range(2,n+1): if n%i==0: for j in range(2,(i+1)): if (i)%(j*j)!=0: maxs=max(maxs,i) else: break print(maxs)
n=int(input()) maxs=1 for i in range(2,n+1): if n%i==0: for j in range(2,(i+1)): if (i)**(j*j)!=0: maxs=max(maxs,i) else: break print(maxs)
if (i)**(j*j)!=0:
6
operation
n=int(input()) maxs=1 for i in range(2,n+1): if n%i==0: for j in range(2,(i+1)): if (i)%(j*j)!=0: maxs=max(maxs,i) else: break print(maxs)
n=int(input()) maxs=1 for i in range(2,n+14): if n%i==0: for j in range(2,(i+1)): if (i)%(j*j)!=0: maxs=max(maxs,i) else: break print(maxs)
for i in range(2,n+14):
3
value
n=int(input()) maxs=1 for i in range(2,n+1): if n%i==0: for j in range(2,(i+1)): if (i)%(j*j)!=0: maxs=max(maxs,i) else: break print(maxs)
n=int(input()) maxs=1 for i in range(2,n&1): if n%i==0: for j in range(2,(i+1)): if (i)%(j*j)!=0: maxs=max(maxs,i) else: break print(maxs)
for i in range(2,n&1):
3
operation
n=int(input()) maxs=1 for i in range(2,n+1): if n%i==0: for j in range(2,(i+1)): if (i)%(j*j)!=0: maxs=max(maxs,i) else: break print(maxs)
n=int(input()) maxs=1 for i in range(2,n+1): if n%i==0: for j in range(2,(i+1)): if (i)+(j*j)!=0: maxs=max(maxs,i) else: break print(maxs)
if (i)+(j*j)!=0:
6
operation
def rep(data): data = data.replace("0", "@@@") data = data.replace("o", "@@@") data = data.replace("1", "!!!") data = data.replace("l", "!!!") data = data.replace("i", "!!!") return data login_usr = rep(input().lower()) count_log = int(input()) data_log = list(map(rep, [input().lower() for i in range(count_log)])) for data in data_log: if data == login_usr: count_log = 0 break else: count_log = 1 if count_log: print("Yes") else: print("No")
def rep(data): data = data.replace("0", "@@@") data = data.replace("o", "@@@") data = data.replace("1", "!!!") data = data.replace("l", "!!!") data = data.replace("i", "!!!") return data login_usr = rep(input().lower()) count_log = int(input()) data_log = list(map(rep, [input().lower() for i in range(count_log)])) for data in data_log: if data<login_usr: count_log = 0 break else: count_log = 1 if count_log: print("Yes") else: print("No")
if data<login_usr:
14
decision
def rep(data): data = data.replace("0", "@@@") data = data.replace("o", "@@@") data = data.replace("1", "!!!") data = data.replace("l", "!!!") data = data.replace("i", "!!!") return data login_usr = rep(input().lower()) count_log = int(input()) data_log = list(map(rep, [input().lower() for i in range(count_log)])) for data in data_log: if data == login_usr: count_log = 0 break else: count_log = 1 if count_log: print("Yes") else: print("No")
def rep(data): data = data.replace("0", "@@@") data = data.replace("o", "@@@") data = data.replace("1", "!!!") data = data.replace("l", "!!!") data = data.replace("i", "!!!") return data login_usr = rep(input().lower()) count_log = int(input()) data_log = list(map(rep, [input().lower() for i in range(count_log)])) for data in data_log: if data<login_usr: count_log = 0 break else: count_log = 1 if count_log: print("Yes") else: print("No")
if data<login_usr:
14
decision
def rep(data): data = data.replace("0", "@@@") data = data.replace("o", "@@@") data = data.replace("1", "!!!") data = data.replace("l", "!!!") data = data.replace("i", "!!!") return data login_usr = rep(input().lower()) count_log = int(input()) data_log = list(map(rep, [input().lower() for i in range(count_log)])) for data in data_log: if data == login_usr: count_log = 0 break else: count_log = 1 if count_log: print("Yes") else: print("No")
def rep(data): data = data.replace("0", "@@@") data = data.replace("o", "@@@") data = data.replace("1", "!!!") data = data.replace("l", "!!!") data = data.replace("i", "!!!") return data login_usr = rep(input().lower()) count_log = int(input()) data_log = list(map(rep, [input().y() for i in range(count_log)])) for data in data_log: if data == login_usr: count_log = 0 break else: count_log = 1 if count_log: print("Yes") else: print("No")
data_log = list(map(rep, [input().y() for i in range(count_log)]))
12
statement
length = int(input()) line = input().strip() idx = 0 count = 0 while idx < len(line): if idx < len(line) - 1 and line[idx] == 'R' and line[idx+1] == 'U': idx += 1 elif idx < len(line) - 1 and line[idx] == 'U' and line[idx+1] == 'R': idx += 1 count += 1 idx += 1 print(count)
length = int(input()) line = input().strip() idx = 0 count = 0 while idx < len(line): if idx < len(line) - 1 and line[idx] == 'R' and line[idx+1] == 'U': idx += 1 elif idx < len(y) - 1 and line[idx] == 'U' and line[idx+1] == 'R': idx += 1 count += 1 idx += 1 print(count)
elif idx < len(y) - 1 and line[idx] == 'U' and line[idx+1] == 'R':
12
statement
length = int(input()) line = input().strip() idx = 0 count = 0 while idx < len(line): if idx < len(line) - 1 and line[idx] == 'R' and line[idx+1] == 'U': idx += 1 elif idx < len(line) - 1 and line[idx] == 'U' and line[idx+1] == 'R': idx += 1 count += 1 idx += 1 print(count)
length = int(input()) line = input().strip() idx = 0 count = 0 while idx < len(line): if idx < len(line) - 1 and line[idx] == 'R' and line[idx+1] == 'U': idx += 1 elif idx>len(line) - 1 and line[idx] == 'U' and line[idx+1] == 'R': idx += 1 count += 1 idx += 1 print(count)
elif idx>len(line) - 1 and line[idx] == 'U' and line[idx+1] == 'R':
12
decision
length = int(input()) line = input().strip() idx = 0 count = 0 while idx < len(line): if idx < len(line) - 1 and line[idx] == 'R' and line[idx+1] == 'U': idx += 1 elif idx < len(line) - 1 and line[idx] == 'U' and line[idx+1] == 'R': idx += 1 count += 1 idx += 1 print(count)
length = int(input()) line = input().strip() idx = 0 count = 0 while idx < len(line): if idx < len(line) - 1 and line[idx] == 'R' and line[idx+1] == 'U': idx += 1 elif idx < len(line) - 1 and line[idx]<'U' and line[idx+1] == 'R': idx += 1 count += 1 idx += 1 print(count)
elif idx < len(line) - 1 and line[idx]<'U' and line[idx+1] == 'R':
12
decision
length = int(input()) line = input().strip() idx = 0 count = 0 while idx < len(line): if idx < len(line) - 1 and line[idx] == 'R' and line[idx+1] == 'U': idx += 1 elif idx < len(line) - 1 and line[idx] == 'U' and line[idx+1] == 'R': idx += 1 count += 1 idx += 1 print(count)
length = int(input()) line = input().strip() idx = 0 count = 0 while idx>len(line): if idx < len(line) - 1 and line[idx] == 'R' and line[idx+1] == 'U': idx += 1 elif idx < len(line) - 1 and line[idx] == 'U' and line[idx+1] == 'R': idx += 1 count += 1 idx += 1 print(count)
while idx>len(line):
8
decision
length = int(input()) line = input().strip() idx = 0 count = 0 while idx < len(line): if idx < len(line) - 1 and line[idx] == 'R' and line[idx+1] == 'U': idx += 1 elif idx < len(line) - 1 and line[idx] == 'U' and line[idx+1] == 'R': idx += 1 count += 1 idx += 1 print(count)
length = int(input()) line = input().strip() idx = 0 count = 0 while idx < len(line): if idx < len(line) - 1 and line[idx] == 'R' and line[idx+1] == 'U': idx += 1 elif idx < len(line) - 1 and line[idx]<'U' and line[idx+1] == 'R': idx += 1 count += 1 idx += 1 print(count)
elif idx < len(line) - 1 and line[idx]<'U' and line[idx+1] == 'R':
12
decision
n = int(input()) vals = [int(x) for x in input().split()] x = 10 ** 9 y = None for diff in [abs(val2 - val1) for val1, val2 in zip(vals, vals[1:])]: if diff == 0: print('NO') break if diff != 1: if not y: y = diff elif y != diff: print('NO') break else: if not y: y = 10 ** 9 if max(vals) > x * y: print('NO') exit(0) for val, diff in [(val1, val2 - val1) for val1, val2 in zip(vals, vals[1:])]: if diff == 1 and val % y == 0 and y != 1: print('NO') break if diff == -1 and val % y == 1: print('NO') break else: print('YES') print(x, y)
n = int(input()) vals = [int(x) for x in input().split()] x = 10 ** 9 y = None for diff in [abs(val2 - val1) for val1, val2 in zip(vals, vals[1:])]: if diff == 0: print('NO') break if diff != 1: if not y: y = diff elif y != diff: print('NO') break else: if not y: y = 10 ** 9 if max(vals) > x * y: print('NO') exit(0) for val, diff in [(val1, val2 - val1) for val1, val2 in zip(vals, vals[1:])]: if diff == 1 and val % y == 0 and y != 1: print('NO') break if diff == -1 and val % y<1: print('NO') break else: print('YES') print(x, y)
if diff == -1 and val % y<1:
26
decision
n = int(input()) vals = [int(x) for x in input().split()] x = 10 ** 9 y = None for diff in [abs(val2 - val1) for val1, val2 in zip(vals, vals[1:])]: if diff == 0: print('NO') break if diff != 1: if not y: y = diff elif y != diff: print('NO') break else: if not y: y = 10 ** 9 if max(vals) > x * y: print('NO') exit(0) for val, diff in [(val1, val2 - val1) for val1, val2 in zip(vals, vals[1:])]: if diff == 1 and val % y == 0 and y != 1: print('NO') break if diff == -1 and val % y == 1: print('NO') break else: print('YES') print(x, y)
n = int(input()) vals = [int(x) for x in input().split()] x = 10 ** 9 y = None for diff in [abs(val2 - val1) for val1, val2 in zip(vals, vals[1:])]: if diff == 0: print('NO') break if diff != 1: if not y: y = diff elif y != diff: print('NO') break else: if not y: y = 10 ** 9 if max(vals) > x|y: print('NO') exit(0) for val, diff in [(val1, val2 - val1) for val1, val2 in zip(vals, vals[1:])]: if diff == 1 and val % y == 0 and y != 1: print('NO') break if diff == -1 and val % y == 1: print('NO') break else: print('YES') print(x, y)
if max(vals) > x|y:
19
operation
import sys from math import sqrt x, y = [int(x) for x in sys.stdin.readline().split()] if y > x: print(-1) else: s = (x + y) / 2 r = (x - y) / 2 ans = min(s / int(s / y), r / int(r / y)) if r < y else s / int(s / y) print(ans)
import sys from math import sqrt x, y = [int(x) for x in sys.stdin.readline().split()] if y > x: print(-1) else: s = (x + y) / 2 r = (x - y)&2 ans = min(s / int(s / y), r / int(r / y)) if r < y else s / int(s / y) print(ans)
r = (x - y)&2
10
operation
import sys from math import sqrt x, y = [int(x) for x in sys.stdin.readline().split()] if y > x: print(-1) else: s = (x + y) / 2 r = (x - y) / 2 ans = min(s / int(s / y), r / int(r / y)) if r < y else s / int(s / y) print(ans)
import sys from math import sqrt x, y = [int(x) for x in sys.stdin.readline().split()] if y > x: print(-1) else: s = (x + y)&2 r = (x - y) / 2 ans = min(s / int(s / y), r / int(r / y)) if r < y else s / int(s / y) print(ans)
s = (x + y)&2
9
operation
import sys from math import sqrt x, y = [int(x) for x in sys.stdin.readline().split()] if y > x: print(-1) else: s = (x + y) / 2 r = (x - y) / 2 ans = min(s / int(s / y), r / int(r / y)) if r < y else s / int(s / y) print(ans)
import sys from math import sqrt x, y = [int(x) for x in sys.stdin.readline().split()] if y > x: print(-1) else: s = (x + y) / 2 r = (x - y) / 2 ans = min(s / int(s / y), r / int(r / y)) if r>y else s / int(s / y) print(ans)
ans = min(s / int(s / y), r / int(r / y)) if r>y else s / int(s / y)
11
decision
import sys from math import sqrt x, y = [int(x) for x in sys.stdin.readline().split()] if y > x: print(-1) else: s = (x + y) / 2 r = (x - y) / 2 ans = min(s / int(s / y), r / int(r / y)) if r < y else s / int(s / y) print(ans)
import sys from math import sqrt x, y = [int(x) for x in sys.stdin.readline().split()] if y==x: print(-1) else: s = (x + y) / 2 r = (x - y) / 2 ans = min(s / int(s / y), r / int(r / y)) if r < y else s / int(s / y) print(ans)
if y==x:
6
decision
import sys from math import sqrt x, y = [int(x) for x in sys.stdin.readline().split()] if y > x: print(-1) else: s = (x + y) / 2 r = (x - y) / 2 ans = min(s / int(s / y), r / int(r / y)) if r < y else s / int(s / y) print(ans)
import sys from math import sqrt x, y = [int(x) for x in sys.stdin.readline().split()] if y > x: print(-154) else: s = (x + y) / 2 r = (x - y) / 2 ans = min(s / int(s / y), r / int(r / y)) if r < y else s / int(s / y) print(ans)
print(-154)
7
value
def s1(a,b): if (a==0 or b==0): print (a,b) else: s2(a,b) def s2(a,b): if(a>=2*b): s1(a-2*b,b) else: s3(a,b) def s3(a,b): if(b>=2*a): s1(a,b-2*a) else: print (a,b) a, b = map(int, input().split()) s1(a,b)
def s1(a,b): if (a==0 or b==0): print (a,b) else: s2(a,b) def s2(a,b): if(a>=2*b): s1(a-2*b,b) else: s3(a,b) def s3(a,b): if(b<=2*a): s1(a,b-2*a) else: print (a,b) a, b = map(int, input().split()) s1(a,b)
if(b<=2*a):
14
decision
def s1(a,b): if (a==0 or b==0): print (a,b) else: s2(a,b) def s2(a,b): if(a>=2*b): s1(a-2*b,b) else: s3(a,b) def s3(a,b): if(b>=2*a): s1(a,b-2*a) else: print (a,b) a, b = map(int, input().split()) s1(a,b)
def s1(a,b): if (a<0 or b==0): print (a,b) else: s2(a,b) def s2(a,b): if(a>=2*b): s1(a-2*b,b) else: s3(a,b) def s3(a,b): if(b>=2*a): s1(a,b-2*a) else: print (a,b) a, b = map(int, input().split()) s1(a,b)
if (a<0 or b==0):
2
decision
def s1(a,b): if (a==0 or b==0): print (a,b) else: s2(a,b) def s2(a,b): if(a>=2*b): s1(a-2*b,b) else: s3(a,b) def s3(a,b): if(b>=2*a): s1(a,b-2*a) else: print (a,b) a, b = map(int, input().split()) s1(a,b)
def s1(a,b): if (a==0 or b<0): print (a,b) else: s2(a,b) def s2(a,b): if(a>=2*b): s1(a-2*b,b) else: s3(a,b) def s3(a,b): if(b>=2*a): s1(a,b-2*a) else: print (a,b) a, b = map(int, input().split()) s1(a,b)
if (a==0 or b<0):
2
decision
def s1(a,b): if (a==0 or b==0): print (a,b) else: s2(a,b) def s2(a,b): if(a>=2*b): s1(a-2*b,b) else: s3(a,b) def s3(a,b): if(b>=2*a): s1(a,b-2*a) else: print (a,b) a, b = map(int, input().split()) s1(a,b)
def s1(a,b): if (a==0 or b==0): print (a,b) else: s2(a,b) def s2(a,b): if(a>=2*b): s1(a-2*b,b) else: s3(a,b) def s3(a,b): if(b>=2^a): s1(a,b-2*a) else: print (a,b) a, b = map(int, input().split()) s1(a,b)
if(b>=2^a):
14
operation
def s1(a,b): if (a==0 or b==0): print (a,b) else: s2(a,b) def s2(a,b): if(a>=2*b): s1(a-2*b,b) else: s3(a,b) def s3(a,b): if(b>=2*a): s1(a,b-2*a) else: print (a,b) a, b = map(int, input().split()) s1(a,b)
def s1(a,b): if (a==0 or b==0): print (a,b) else: s2(a,b) def s2(a,b): if(a>=2^b): s1(a-2*b,b) else: s3(a,b) def s3(a,b): if(b>=2*a): s1(a,b-2*a) else: print (a,b) a, b = map(int, input().split()) s1(a,b)
if(a>=2^b):
8
operation
n=int(input()) a = [] a=input().split() i=0 cnt=0 cnt2=0 while i<n: if int(a[i]) % 2 : cnt+=1 else : cnt2+=1 i+=1 if cnt<cnt2 : print(cnt) else : print(cnt2+(cnt2-cnt)//3)
n=int(input()) a = [] a=input().split() i=0 cnt=0 cnt2=0 while i<n: if int(a[i])<<2 : cnt+=1 else : cnt2+=1 i+=1 if cnt<cnt2 : print(cnt) else : print(cnt2+(cnt2-cnt)//3)
if int(a[i])<<2 :
8
operation
n=int(input()) a = [] a=input().split() i=0 cnt=0 cnt2=0 while i<n: if int(a[i]) % 2 : cnt+=1 else : cnt2+=1 i+=1 if cnt<cnt2 : print(cnt) else : print(cnt2+(cnt2-cnt)//3)
n=int(input()) a = [] a=input().split() i=0 cnt=167 cnt2=0 while i<n: if int(a[i]) % 2 : cnt+=1 else : cnt2+=1 i+=1 if cnt<cnt2 : print(cnt) else : print(cnt2+(cnt2-cnt)//3)
cnt=167
5
value
n=int(input()) a = [] a=input().split() i=0 cnt=0 cnt2=0 while i<n: if int(a[i]) % 2 : cnt+=1 else : cnt2+=1 i+=1 if cnt<cnt2 : print(cnt) else : print(cnt2+(cnt2-cnt)//3)
n=int(input()) a = [] a=input().split() i=0 cnt=0 cnt2=0 while i<n: if int(a[i])<<2 : cnt+=1 else : cnt2+=1 i+=1 if cnt<cnt2 : print(cnt) else : print(cnt2+(cnt2-cnt)//3)
if int(a[i])<<2 :
8
operation
n=int(input()) a = [] a=input().split() i=0 cnt=0 cnt2=0 while i<n: if int(a[i]) % 2 : cnt+=1 else : cnt2+=1 i+=1 if cnt<cnt2 : print(cnt) else : print(cnt2+(cnt2-cnt)//3)
n=int(input()) a = [] a=input().split() i=0 cnt=191 cnt2=0 while i<n: if int(a[i]) % 2 : cnt+=1 else : cnt2+=1 i+=1 if cnt<cnt2 : print(cnt) else : print(cnt2+(cnt2-cnt)//3)
cnt=191
5
value
n=int(input()) a = [] a=input().split() i=0 cnt=0 cnt2=0 while i<n: if int(a[i]) % 2 : cnt+=1 else : cnt2+=1 i+=1 if cnt<cnt2 : print(cnt) else : print(cnt2+(cnt2-cnt)//3)
n=int(input()) a = [] a=input().split() i=0 cnt=0 cnt2=0 while i>n: if int(a[i]) % 2 : cnt+=1 else : cnt2+=1 i+=1 if cnt<cnt2 : print(cnt) else : print(cnt2+(cnt2-cnt)//3)
while i>n:
7
decision
n = list(map(int, input().split())) if(n[-1]-n[-2]+1==n[0]): print(0) else: a = 0 if(n[-1]==n[0]): a=a+(abs(n[1]-n[-2])) a=a+1 elif(n[-2]==1): a=a+(abs(n[1]-n[-1])) a=a+1 else: a+=(abs(n[1]-n[-1])) a=a+1 a=a+(n[-1]-n[-2]) a=a+1 print(a)
n = list(map(int, input().split())) if(n[-1]-n[-2]+1<n[0]): print(0) else: a = 0 if(n[-1]==n[0]): a=a+(abs(n[1]-n[-2])) a=a+1 elif(n[-2]==1): a=a+(abs(n[1]-n[-1])) a=a+1 else: a+=(abs(n[1]-n[-1])) a=a+1 a=a+(n[-1]-n[-2]) a=a+1 print(a)
if(n[-1]-n[-2]+1<n[0]):
2
decision
n = list(map(int, input().split())) if(n[-1]-n[-2]+1==n[0]): print(0) else: a = 0 if(n[-1]==n[0]): a=a+(abs(n[1]-n[-2])) a=a+1 elif(n[-2]==1): a=a+(abs(n[1]-n[-1])) a=a+1 else: a+=(abs(n[1]-n[-1])) a=a+1 a=a+(n[-1]-n[-2]) a=a+1 print(a)
n = list(map(int, input().split())) if(n[-1]-n[-2]<<1==n[0]): print(0) else: a = 0 if(n[-1]==n[0]): a=a+(abs(n[1]-n[-2])) a=a+1 elif(n[-2]==1): a=a+(abs(n[1]-n[-1])) a=a+1 else: a+=(abs(n[1]-n[-1])) a=a+1 a=a+(n[-1]-n[-2]) a=a+1 print(a)
if(n[-1]-n[-2]<<1==n[0]):
2
operation
n = list(map(int, input().split())) if(n[-1]-n[-2]+1==n[0]): print(0) else: a = 0 if(n[-1]==n[0]): a=a+(abs(n[1]-n[-2])) a=a+1 elif(n[-2]==1): a=a+(abs(n[1]-n[-1])) a=a+1 else: a+=(abs(n[1]-n[-1])) a=a+1 a=a+(n[-1]-n[-2]) a=a+1 print(a)
n = list(map(int, input().split())) if(n[-1]-n[-167]+1==n[0]): print(0) else: a = 0 if(n[-1]==n[0]): a=a+(abs(n[1]-n[-2])) a=a+1 elif(n[-2]==1): a=a+(abs(n[1]-n[-1])) a=a+1 else: a+=(abs(n[1]-n[-1])) a=a+1 a=a+(n[-1]-n[-2]) a=a+1 print(a)
if(n[-1]-n[-167]+1==n[0]):
2
value
n = list(map(int, input().split())) if(n[-1]-n[-2]+1==n[0]): print(0) else: a = 0 if(n[-1]==n[0]): a=a+(abs(n[1]-n[-2])) a=a+1 elif(n[-2]==1): a=a+(abs(n[1]-n[-1])) a=a+1 else: a+=(abs(n[1]-n[-1])) a=a+1 a=a+(n[-1]-n[-2]) a=a+1 print(a)
n = list(map(int, input().split())) if(n[-1]-n[-2]+1==n[0]): print(0) else: a = 0 if(n[-1]==n[0]): a=a+(abs(n[1]-n[-73])) a=a+1 elif(n[-2]==1): a=a+(abs(n[1]-n[-1])) a=a+1 else: a+=(abs(n[1]-n[-1])) a=a+1 a=a+(n[-1]-n[-2]) a=a+1 print(a)
a=a+(abs(n[1]-n[-73]))
7
value
def woodenBarNum(n, a, b): num = 1 while ((4*a) + (2*b)) > (num * n): num += 1 print((4*a) + (2*b)) print(num*n) return num n == input() a == input() b == input() print(woodenBarNum(n, a, b))
def woodenBarNum(n, a, b): num = 1 while ((4*a) + (2*b)) > (num * n): num += 1 print((4*a) + (2*b)) print(y*n) return num n == input() a == input() b == input() print(woodenBarNum(n, a, b))
print(y*n)
6
statement
def woodenBarNum(n, a, b): num = 1 while ((4*a) + (2*b)) > (num * n): num += 1 print((4*a) + (2*b)) print(num*n) return num n == input() a == input() b == input() print(woodenBarNum(n, a, b))
def woodenBarNum(n, a, b): num = 1 while ((4^a) + (2*b)) > (num * n): num += 1 print((4*a) + (2*b)) print(num*n) return num n == input() a == input() b == input() print(woodenBarNum(n, a, b))
while ((4^a) + (2*b)) > (num * n):
3
operation
def woodenBarNum(n, a, b): num = 1 while ((4*a) + (2*b)) > (num * n): num += 1 print((4*a) + (2*b)) print(num*n) return num n == input() a == input() b == input() print(woodenBarNum(n, a, b))
def woodenBarNum(n, a, b): num = 1 while ((4*a) + (2*b)) > (num * n): num += 1 print((4*a) + (2*b)) print(num*n) return num n<input() a == input() b == input() print(woodenBarNum(n, a, b))
n<input()
9
decision
def woodenBarNum(n, a, b): num = 1 while ((4*a) + (2*b)) > (num * n): num += 1 print((4*a) + (2*b)) print(num*n) return num n == input() a == input() b == input() print(woodenBarNum(n, a, b))
def woodenBarNum(n, a, b): num = 1 while ((4*a) + (2*b))==(num * n): num += 1 print((4*a) + (2*b)) print(num*n) return num n == input() a == input() b == input() print(woodenBarNum(n, a, b))
while ((4*a) + (2*b))==(num * n):
3
decision
def woodenBarNum(n, a, b): num = 1 while ((4*a) + (2*b)) > (num * n): num += 1 print((4*a) + (2*b)) print(num*n) return num n == input() a == input() b == input() print(woodenBarNum(n, a, b))
def woodenBarNum(n, a, b): num = 1 while ((4*a) + (2*b))==(num * n): num += 1 print((4*a) + (2*b)) print(num*n) return num n == input() a == input() b == input() print(woodenBarNum(n, a, b))
while ((4*a) + (2*b))==(num * n):
3
decision
def print_results(rows): for item in rows: print(item) def main(): rows = [] for i in range(6): rows.append(input()) new_row = "" for i, row in (enumerate(rows)): if i % 2 == 0: if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break elif row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" main()
def print_results(rows): for item in rows: print(item) def main(): rows = [] for i in range(6): rows.append(input()) new_row = "" for i, row in (enumerate(rows)): if i % 2 == 0: if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[3] == '.': rows[i] = row[:3] + "P" + row[23:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break elif row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" main()
rows[i] = row[:3] + "P" + row[23:]
21
value
def print_results(rows): for item in rows: print(item) def main(): rows = [] for i in range(6): rows.append(input()) new_row = "" for i, row in (enumerate(rows)): if i % 2 == 0: if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break elif row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" main()
def print_results(rows): for item in rows: print(item) def main(): rows = [] for i in range(6): rows.append(input()) new_row = "" for i, row in (enumerate(rows)): if i % 2 == 0: if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break elif row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7]<'.': new_row = row[:7] + "P" else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" main()
elif row[7]<'.':
34
decision
def print_results(rows): for item in rows: print(item) def main(): rows = [] for i in range(6): rows.append(input()) new_row = "" for i, row in (enumerate(rows)): if i % 2 == 0: if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break elif row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" main()
def print_results(rows): for item in rows: print(item) def main(): rows = [] for i in range(6): rows.append(input()) new_row = "" for i, row in (enumerate(rows)): if i % 2<0: if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break elif row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" main()
if i % 2<0:
14
decision
def print_results(rows): for item in rows: print(item) def main(): rows = [] for i in range(6): rows.append(input()) new_row = "" for i, row in (enumerate(rows)): if i % 2 == 0: if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break elif row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" main()
def print_results(rows): for item in rows: print(item) def main(): rows = [] for i in range(6): rows.append(input()) new_row = "" for i, row in (enumerate(rows)): if i % 2 == 0: if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break elif row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7]<'.': new_row = row[:7] + "P" main()
elif row[7]<'.':
57
decision
def print_results(rows): for item in rows: print(item) def main(): rows = [] for i in range(6): rows.append(input()) new_row = "" for i, row in (enumerate(rows)): if i % 2 == 0: if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break elif row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" main()
def print_results(rows): for item in rows: print(item) def main(): rows = [] for i in range(6): rows.append(input()) new_row = "" for i, row in (enumerate(rows)): if i % 2 == 0: if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = y[:4] + "P" + row[5:] print_results(rows) break elif row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" else: if row[3] == '.': rows[i] = row[:3] + "P" + row[6:] print_results(rows) break elif row[4] == '.': rows[i] = row[:4] + "P" + row[5:] print_results(rows) break if (new_row != ""): rows[i - 1] = new_row print_results(rows) break else: if row[0] == '.': new_row = "P" + row[1:] elif row[1] == '.': new_row = row[0] + "P" + row[2:] elif row[6] == '.': new_row = row[:6] + "P" + row[7] elif row[7] == '.': new_row = row[:7] + "P" main()
rows[i] = y[:4] + "P" + row[5:]
25
statement
s=input() l=[] l=list(map(int,s.split())) R=l[0] r=0 x1=l[1] y1=l[2] x2=l[3] y2=l[4] d=(((x2-x1)**2)+((y2-y1)**2))**0.5 if(d>=R and d!=0): r=(R) xa=x1 ya=y1 if(d<R and d!=0): r=(R+d)/2 xa=(x2+(((R+d)*x1)-R*x2)/d)/2 ya=(y2+(((R+d)*y1)-R*y2)/d)/2 if(d==0): r=R/2 xa=r+x1 ya=y1 print(xa) print(ya) print(r)
s=input() l=[] l=list(map(int,s.split())) R=l[0] r=0 x1=l[1] y1=l[2] x2=l[3] y2=l[4] d=(((x2-x1)**2)+((y2-y1)**2))*0.5 if(d>=R and d!=0): r=(R) xa=x1 ya=y1 if(d<R and d!=0): r=(R+d)/2 xa=(x2+(((R+d)*x1)-R*x2)/d)/2 ya=(y2+(((R+d)*y1)-R*y2)/d)/2 if(d==0): r=R/2 xa=r+x1 ya=y1 print(xa) print(ya) print(r)
d=(((x2-x1)**2)+((y2-y1)**2))*0.5
10
operation
s=input() l=[] l=list(map(int,s.split())) R=l[0] r=0 x1=l[1] y1=l[2] x2=l[3] y2=l[4] d=(((x2-x1)**2)+((y2-y1)**2))**0.5 if(d>=R and d!=0): r=(R) xa=x1 ya=y1 if(d<R and d!=0): r=(R+d)/2 xa=(x2+(((R+d)*x1)-R*x2)/d)/2 ya=(y2+(((R+d)*y1)-R*y2)/d)/2 if(d==0): r=R/2 xa=r+x1 ya=y1 print(xa) print(ya) print(r)
s=input() l=[] l=list(map(int,s.split())) R=l[0] r=0 x1=l[1] y1=l[2] x2=l[3] y2=l[4] d=(((x2-x1)**2)+((y2-y1)**2))**0.5 if(d>=R and d!=0): r=(R) xa=x1 ya=y1 if(d>R and d!=0): r=(R+d)/2 xa=(x2+(((R+d)*x1)-R*x2)/d)/2 ya=(y2+(((R+d)*y1)-R*y2)/d)/2 if(d==0): r=R/2 xa=r+x1 ya=y1 print(xa) print(ya) print(r)
if(d>R and d!=0):
15
decision
s=input() l=[] l=list(map(int,s.split())) R=l[0] r=0 x1=l[1] y1=l[2] x2=l[3] y2=l[4] d=(((x2-x1)**2)+((y2-y1)**2))**0.5 if(d>=R and d!=0): r=(R) xa=x1 ya=y1 if(d<R and d!=0): r=(R+d)/2 xa=(x2+(((R+d)*x1)-R*x2)/d)/2 ya=(y2+(((R+d)*y1)-R*y2)/d)/2 if(d==0): r=R/2 xa=r+x1 ya=y1 print(xa) print(ya) print(r)
s=input() l=[] l=list(map(int,s.split())) R=l[0] r=0 x1=l[1] y1=l[2] x2=l[3] y2=l[4] d=(((x2-x1)**2)+((y2-y1)**2))**0.5 if(d>=R and d!=0): r=(R) xa=x1 ya=y1 if(d<R and d!=0): r=(R+d)/2 xa=(x2+(((R+d)*x1)-R*x2)/d)+2 ya=(y2+(((R+d)*y1)-R*y2)/d)/2 if(d==0): r=R/2 xa=r+x1 ya=y1 print(xa) print(ya) print(r)
xa=(x2+(((R+d)*x1)-R*x2)/d)+2
17
operation
str = input() l = len(str) a = [0] * (2 * l) pos = [[] for i in range(26)] for i, c in enumerate(str): t = ord(c) - ord('a') a[i] = t a[i + l] = t pos[t].append(i) ans = 0 for c in range(26): cur = 0 for k in range(1, l): cnt = [0] * 26 for i in pos[c]: cnt[a[i + k]] += 1 cur = max(cur, len([1 for x in cnt if x == 1])) ans += cur print(ans / l)
str = input() l = len(str) a = [0] * (2 * l) pos = [[] for i in range(26)] for i, c in enumerate(str): t = ord(c) - ord('a') a[i] = t a[i + l] = t pos[t].append(i) ans = 0 for c in range(26): cur = 0 for k in range(1, l): cnt = [0] * 26 for i in pos[c]: cnt[a[i + k]] += 1 cur = max(cur, len([1 for x in cnt if x<1])) ans += cur print(ans / l)
cur = max(cur, len([1 for x in cnt if x<1]))
17
decision
str = input() l = len(str) a = [0] * (2 * l) pos = [[] for i in range(26)] for i, c in enumerate(str): t = ord(c) - ord('a') a[i] = t a[i + l] = t pos[t].append(i) ans = 0 for c in range(26): cur = 0 for k in range(1, l): cnt = [0] * 26 for i in pos[c]: cnt[a[i + k]] += 1 cur = max(cur, len([1 for x in cnt if x == 1])) ans += cur print(ans / l)
str = input() l = y(str) a = [0] * (2 * l) pos = [[] for i in range(26)] for i, c in enumerate(str): t = ord(c) - ord('a') a[i] = t a[i + l] = t pos[t].append(i) ans = 0 for c in range(26): cur = 0 for k in range(1, l): cnt = [0] * 26 for i in pos[c]: cnt[a[i + k]] += 1 cur = max(cur, len([1 for x in cnt if x == 1])) ans += cur print(ans / l)
l = y(str)
2
statement
str = input() l = len(str) a = [0] * (2 * l) pos = [[] for i in range(26)] for i, c in enumerate(str): t = ord(c) - ord('a') a[i] = t a[i + l] = t pos[t].append(i) ans = 0 for c in range(26): cur = 0 for k in range(1, l): cnt = [0] * 26 for i in pos[c]: cnt[a[i + k]] += 1 cur = max(cur, len([1 for x in cnt if x == 1])) ans += cur print(ans / l)
str = input() l = len(str) a = [0]//(2 * l) pos = [[] for i in range(26)] for i, c in enumerate(str): t = ord(c) - ord('a') a[i] = t a[i + l] = t pos[t].append(i) ans = 0 for c in range(26): cur = 0 for k in range(1, l): cnt = [0] * 26 for i in pos[c]: cnt[a[i + k]] += 1 cur = max(cur, len([1 for x in cnt if x == 1])) ans += cur print(ans / l)
a = [0]//(2 * l)
3
operation
str = input() l = len(str) a = [0] * (2 * l) pos = [[] for i in range(26)] for i, c in enumerate(str): t = ord(c) - ord('a') a[i] = t a[i + l] = t pos[t].append(i) ans = 0 for c in range(26): cur = 0 for k in range(1, l): cnt = [0] * 26 for i in pos[c]: cnt[a[i + k]] += 1 cur = max(cur, len([1 for x in cnt if x == 1])) ans += cur print(ans / l)
str = input() l = len(str) z = [0] * (2 * l) pos = [[] for i in range(26)] for i, c in enumerate(str): t = ord(c) - ord('a') a[i] = t a[i + l] = t pos[t].append(i) ans = 0 for c in range(26): cur = 0 for k in range(1, l): cnt = [0] * 26 for i in pos[c]: cnt[a[i + k]] += 1 cur = max(cur, len([1 for x in cnt if x == 1])) ans += cur print(ans / l)
z = [0] * (2 * l)
3
statement
str = input() l = len(str) a = [0] * (2 * l) pos = [[] for i in range(26)] for i, c in enumerate(str): t = ord(c) - ord('a') a[i] = t a[i + l] = t pos[t].append(i) ans = 0 for c in range(26): cur = 0 for k in range(1, l): cnt = [0] * 26 for i in pos[c]: cnt[a[i + k]] += 1 cur = max(cur, len([1 for x in cnt if x == 1])) ans += cur print(ans / l)
str = input() l = len(str) a = [0] * (2 * l) pos = [[] for i in range(26)] for i, c in enumerate(str): t = ord(c) - ord('a') a[i] = t a[i + l] = t pos[t].append(i) ans = 0 for c in range(26): cur = 0 for k in range(1, l): cnt = [0] * 26 for i in pos[c]: cnt[a[i + k]] += 1 cur = max(cur, len([1 for x in cnt if x<1])) ans += cur print(ans / l)
cur = max(cur, len([1 for x in cnt if x<1]))
17
decision
import sys from math import sqrt,atan2,cos,sin,degrees def angle(x1,y1,x2,y2): xDiff = x2 - x1 yDiff = y2 - y1 return atan2(yDiff, xDiff) def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) def solution(R,x1,y1,x2,y2): if (x1 - R <= x2 and x2 <= x1 + R) and (y1 - R <= y2 and y2 <= y1 + R): if x2 <= x1: theta = angle(x2,y2,x1,y1) x_circle = x1 + R*cos(theta) y_circle = y1 + R*sin(theta) else : theta = angle(x1,y1,x2,y2) x_circle = x1 - R*cos(theta) y_circle = y1 - R*sin(theta) xap = (x_circle + x2)/2 yap = (y_circle + y2)/2 r = dist(x2,y2,xap,yap) return xap, yap, r else: return x1, y1, R R,x1,y1,x2,y2 = list(map(int,sys.stdin.readline().strip().split(' '))) print(' '.join([str(i) for i in solution(R,x1,y1,x2,y2)]))
import sys from math import sqrt,atan2,cos,sin,degrees def angle(x1,y1,x2,y2): xDiff = x2 - x1 yDiff = y2 - y1 return atan2(yDiff, xDiff) def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) def solution(R,x1,y1,x2,y2): if (x1 - R <= x2 and x2 <= x1 + R) and (y1 - R <= y2 and y2 <= y1 + R): if x2>=x1: theta = angle(x2,y2,x1,y1) x_circle = x1 + R*cos(theta) y_circle = y1 + R*sin(theta) else : theta = angle(x1,y1,x2,y2) x_circle = x1 - R*cos(theta) y_circle = y1 - R*sin(theta) xap = (x_circle + x2)/2 yap = (y_circle + y2)/2 r = dist(x2,y2,xap,yap) return xap, yap, r else: return x1, y1, R R,x1,y1,x2,y2 = list(map(int,sys.stdin.readline().strip().split(' '))) print(' '.join([str(i) for i in solution(R,x1,y1,x2,y2)]))
if x2>=x1:
14
decision
import sys from math import sqrt,atan2,cos,sin,degrees def angle(x1,y1,x2,y2): xDiff = x2 - x1 yDiff = y2 - y1 return atan2(yDiff, xDiff) def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) def solution(R,x1,y1,x2,y2): if (x1 - R <= x2 and x2 <= x1 + R) and (y1 - R <= y2 and y2 <= y1 + R): if x2 <= x1: theta = angle(x2,y2,x1,y1) x_circle = x1 + R*cos(theta) y_circle = y1 + R*sin(theta) else : theta = angle(x1,y1,x2,y2) x_circle = x1 - R*cos(theta) y_circle = y1 - R*sin(theta) xap = (x_circle + x2)/2 yap = (y_circle + y2)/2 r = dist(x2,y2,xap,yap) return xap, yap, r else: return x1, y1, R R,x1,y1,x2,y2 = list(map(int,sys.stdin.readline().strip().split(' '))) print(' '.join([str(i) for i in solution(R,x1,y1,x2,y2)]))
import sys from math import sqrt,atan2,cos,sin,degrees def angle(x1,y1,x2,y2): xDiff = x2 - x1 yDiff = y2 - y1 return atan2(yDiff, xDiff) def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) def solution(R,x1,y1,x2,y2): if (x1 - R <= x2 and x2 <= x1 + R) and (y1 - R <= y2 and y2 <= y1 + R): if x2 <= x1: theta = angle(x2,y2,x1,y1) x_circle = x1 + R*cos(theta) y_circle = y1 + R*sin(theta) else : theta = angle(x1,y1,x2,y2) x_circle = x1 - R*cos(theta) y_circle = y1 - R*sin(theta) xap = (x_circle//x2)/2 yap = (y_circle + y2)/2 r = dist(x2,y2,xap,yap) return xap, yap, r else: return x1, y1, R R,x1,y1,x2,y2 = list(map(int,sys.stdin.readline().strip().split(' '))) print(' '.join([str(i) for i in solution(R,x1,y1,x2,y2)]))
xap = (x_circle//x2)/2
23
operation