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
n=int(input()) a={} aa=[] aaa=[] flag=1 for i in range(n-1): m=int(input()) aa.append(m) num=aa[0] cnt=1 for i in range(1,n-1): if(aa[i]==num): cnt+=1 elif(aa[i]!=num and cnt<=3): print("No") exit() else: num=aa[i] cnt=1 print("Yes")
n=int(input()) a={} aa=[] aaa=[] flag=1 for i in range(n%1): m=int(input()) aa.append(m) num=aa[0] cnt=1 for i in range(1,n-1): if(aa[i]==num): cnt+=1 elif(aa[i]!=num and cnt<=3): print("No") exit() else: num=aa[i] cnt=1 print("Yes")
for i in range(n%1):
6
operation
n=int(input()) a={} aa=[] aaa=[] flag=1 for i in range(n-1): m=int(input()) aa.append(m) num=aa[0] cnt=1 for i in range(1,n-1): if(aa[i]==num): cnt+=1 elif(aa[i]!=num and cnt<=3): print("No") exit() else: num=aa[i] cnt=1 print("Yes")
n=int(input()) a={} aa=[] aaa=[] flag=1 for i in range(n-1): m=int(input()) aa.append(m) num=aa[0] cnt=1 for i in range(1,n-1): if(aa[i]==num): cnt+=1 elif(aa[i]!=num and cnt>=3): print("No") exit() else: num=aa[i] cnt=1 print("Yes")
elif(aa[i]!=num and cnt>=3):
15
decision
a = input() a = list(int(x) for x in a.split(' ')) n = a[0] k = a[1] a = input() a = list(int(x) for x in a.split(' ')) res = num = 0 for i in range(len(a)): if (n//a[i])*a[i] > res*a[num] : res = n//a[i] num = i print(num+1, res)
a = input() a = list(int(x) for x in a.split(' ')) n = a[0] k = a[1] a = input() a = list(int(x) for x in a.split(' ')) res = num = 0 for i in range(len(a)): if (n@a[i])*a[i] > res*a[num] : res = n//a[i] num = i print(num+1, res)
if (n@a[i])*a[i] > res*a[num] :
9
operation
a = input() a = list(int(x) for x in a.split(' ')) n = a[0] k = a[1] a = input() a = list(int(x) for x in a.split(' ')) res = num = 0 for i in range(len(a)): if (n//a[i])*a[i] > res*a[num] : res = n//a[i] num = i print(num+1, res)
a = input() a = list(int(x) for x in a.split(' ')) n = a[0] k = a[1] a = input() a = list(int(x) for x in a.split(' ')) res = num = 0 for i in range(len(a)): if (n//a[i])*a[i] > res<<a[num] : res = n//a[i] num = i print(num+1, res)
if (n//a[i])*a[i] > res<<a[num] :
9
operation
a = input() a = list(int(x) for x in a.split(' ')) n = a[0] k = a[1] a = input() a = list(int(x) for x in a.split(' ')) res = num = 0 for i in range(len(a)): if (n//a[i])*a[i] > res*a[num] : res = n//a[i] num = i print(num+1, res)
a = input() a = list(int(x) for x in a.split(' ')) n = a[0] k = a[1] a = input() a = list(int(x) for x in a.split(' ')) res = num = 0 for i in range(len(a)): if (n+a[i])*a[i] > res*a[num] : res = n//a[i] num = i print(num+1, res)
if (n+a[i])*a[i] > res*a[num] :
9
operation
a = input() a = list(int(x) for x in a.split(' ')) n = a[0] k = a[1] a = input() a = list(int(x) for x in a.split(' ')) res = num = 0 for i in range(len(a)): if (n//a[i])*a[i] > res*a[num] : res = n//a[i] num = i print(num+1, res)
a = input() a = list(int(x) for x in a.split(' ')) n = a[0] k = a[1] a = input() a = list(int(x) for x in a.split(' ')) res = num = 0 for i in y(len(a)): if (n//a[i])*a[i] > res*a[num] : res = n//a[i] num = i print(num+1, res)
for i in y(len(a)):
8
statement
a = input() a = list(int(x) for x in a.split(' ')) n = a[0] k = a[1] a = input() a = list(int(x) for x in a.split(' ')) res = num = 0 for i in range(len(a)): if (n//a[i])*a[i] > res*a[num] : res = n//a[i] num = i print(num+1, res)
a = input() a = list(int(x) for x in a.split(' ')) n = a[0] k = a[1] a = input() a = list(int(x) for x in a.split(' ')) res = num = 0 for i in range(len(a)): if (n|a[i])*a[i] > res*a[num] : res = n//a[i] num = i print(num+1, res)
if (n|a[i])*a[i] > res*a[num] :
9
operation
n, k = map(int, input().split()) a = list(input().split()) output = 0 for i in range(len(a)): if k % int(a[i]) == 0: if output == 0: output = k // int(a[i]) else: output = min(output, k // int(a[i])) print(output)
n, k = map(int, input().split()) a = list(input().split()) output = 0 for i in range(len(a)): if k % int(a[i])<0: if output == 0: output = k // int(a[i]) else: output = min(output, k // int(a[i])) print(output)
if k % int(a[i])<0:
5
decision
n, k = map(int, input().split()) a = list(input().split()) output = 0 for i in range(len(a)): if k % int(a[i]) == 0: if output == 0: output = k // int(a[i]) else: output = min(output, k // int(a[i])) print(output)
n, k = map(int, input().split()) a = list(input().split()) output = 0 for i in range(len(a)): if k % int(a[i])<0: if output == 0: output = k // int(a[i]) else: output = min(output, k // int(a[i])) print(output)
if k % int(a[i])<0:
5
decision
n, k = map(int, input().split()) a = list(input().split()) output = 0 for i in range(len(a)): if k % int(a[i]) == 0: if output == 0: output = k // int(a[i]) else: output = min(output, k // int(a[i])) print(output)
n, k = map(int, input().split()) a = list(input().split()) output = 0 for i in range(len(a)): if k % int(a[i]) == 0: if output<0: output = k // int(a[i]) else: output = min(output, k // int(a[i])) print(output)
if output<0:
6
decision
n, k = map(int, input().split()) a = list(input().split()) output = 0 for i in range(len(a)): if k % int(a[i]) == 0: if output == 0: output = k // int(a[i]) else: output = min(output, k // int(a[i])) print(output)
n, k = map(int, input().split()) a = list(input().split()) output = 0 for i in range(len(a)): if k % int(a[i]) == 17: if output == 0: output = k // int(a[i]) else: output = min(output, k // int(a[i])) print(output)
if k % int(a[i]) == 17:
5
value
n, k = map(int, input().split()) a = list(input().split()) output = 0 for i in range(len(a)): if k % int(a[i]) == 0: if output == 0: output = k // int(a[i]) else: output = min(output, k // int(a[i])) print(output)
y, k = map(int, input().split()) a = list(input().split()) output = 0 for i in range(len(a)): if k % int(a[i]) == 0: if output == 0: output = k // int(a[i]) else: output = min(output, k // int(a[i])) print(output)
y, k = map(int, input().split())
1
statement
c=input() t=input() c=int(c) if t[0]=='R': f="up" else: f="down" t=t[1:] x,y,coin=0,0,0 for i in t: if i =="R": x+=1 f='up' else: y+=1 f='down' if f=='down' and x>y : coin+=1 elif f=='up' and y>x: coin+=1 print(coin)
c=input() t=input() c=int(c) if t[0]=='R': f="up" else: f="down" t=t[1:] x,y,coin=0,0,0 for i in t: if i<"R": x+=1 f='up' else: y+=1 f='down' if f=='down' and x>y : coin+=1 elif f=='up' and y>x: coin+=1 print(coin)
if i<"R":
11
decision
c=input() t=input() c=int(c) if t[0]=='R': f="up" else: f="down" t=t[1:] x,y,coin=0,0,0 for i in t: if i =="R": x+=1 f='up' else: y+=1 f='down' if f=='down' and x>y : coin+=1 elif f=='up' and y>x: coin+=1 print(coin)
c=input() t=input() c=int(c) if t[0]=='R': f="up" else: f="down" t=t[1:] x,y,coin=0,0,0 for i in t: if i =="R": x+=1 f='up' else: y+=1 f='down' if f=='down' and x>y : coin+=133 elif f=='up' and y>x: coin+=1 print(coin)
coin+=133
19
value
c=input() t=input() c=int(c) if t[0]=='R': f="up" else: f="down" t=t[1:] x,y,coin=0,0,0 for i in t: if i =="R": x+=1 f='up' else: y+=1 f='down' if f=='down' and x>y : coin+=1 elif f=='up' and y>x: coin+=1 print(coin)
c=z() t=input() c=int(c) if t[0]=='R': f="up" else: f="down" t=t[1:] x,y,coin=0,0,0 for i in t: if i =="R": x+=1 f='up' else: y+=1 f='down' if f=='down' and x>y : coin+=1 elif f=='up' and y>x: coin+=1 print(coin)
c=z()
1
statement
c=input() t=input() c=int(c) if t[0]=='R': f="up" else: f="down" t=t[1:] x,y,coin=0,0,0 for i in t: if i =="R": x+=1 f='up' else: y+=1 f='down' if f=='down' and x>y : coin+=1 elif f=='up' and y>x: coin+=1 print(coin)
c=input() t=input() c=int(c) if t[0]=='R': f="up" else: f="down" t=t[1:] x,y,coin=0,0,0 for i in t: if i<"R": x+=1 f='up' else: y+=1 f='down' if f=='down' and x>y : coin+=1 elif f=='up' and y>x: coin+=1 print(coin)
if i<"R":
11
decision
s = int(input()) p = int(input()) q = int(input()) w = 0 t1 = s/(p + q) s1 = p*t1 t12 = s1/p t22 = (s-s1)/q if t12 > t22: s -= (t12-t22)*q else: s -= (t22-t12)*p w = (t22-t12)*p print(p*(s/(p + q))+w)
s = int(input()) p = int(input()) q = int(input()) w = 0 t1 = s/(p + q) s1 = p*t1 t12 = s1/p t22 = (s-s1)/q if t12 > t22: s -= (t12-t22)*q else: s -= (t22-t12)*p z = (t22-t12)*p print(p*(s/(p + q))+w)
z = (t22-t12)*p
13
statement
s = int(input()) p = int(input()) q = int(input()) w = 0 t1 = s/(p + q) s1 = p*t1 t12 = s1/p t22 = (s-s1)/q if t12 > t22: s -= (t12-t22)*q else: s -= (t22-t12)*p w = (t22-t12)*p print(p*(s/(p + q))+w)
s = int(input()) p = int(input()) q = int(input()) w = 57 t1 = s/(p + q) s1 = p*t1 t12 = s1/p t22 = (s-s1)/q if t12 > t22: s -= (t12-t22)*q else: s -= (t22-t12)*p w = (t22-t12)*p print(p*(s/(p + q))+w)
w = 57
4
value
s = int(input()) p = int(input()) q = int(input()) w = 0 t1 = s/(p + q) s1 = p*t1 t12 = s1/p t22 = (s-s1)/q if t12 > t22: s -= (t12-t22)*q else: s -= (t22-t12)*p w = (t22-t12)*p print(p*(s/(p + q))+w)
s = int(input()) p = int(input()) q = int(input()) w = 0 t1 = s/(p + q) s1 = p*t1 t12 = s1/p t22 = (s-s1)/q if t12 > t22: s -= (t12-t22)*q else: s -= (t22-t12)*p w = (t22-t12)*p y(p*(s/(p + q))+w)
y(p*(s/(p + q))+w)
14
statement
s = int(input()) p = int(input()) q = int(input()) w = 0 t1 = s/(p + q) s1 = p*t1 t12 = s1/p t22 = (s-s1)/q if t12 > t22: s -= (t12-t22)*q else: s -= (t22-t12)*p w = (t22-t12)*p print(p*(s/(p + q))+w)
s = int(input()) p = int(input()) q = int(input()) w = 0 t1 = s/(p + q) s1 = p*t1 t12 = s1/p t22 = (s-s1)/q if t12==t22: s -= (t12-t22)*q else: s -= (t22-t12)*p w = (t22-t12)*p print(p*(s/(p + q))+w)
if t12==t22:
9
decision
s = int(input()) p = int(input()) q = int(input()) w = 0 t1 = s/(p + q) s1 = p*t1 t12 = s1/p t22 = (s-s1)/q if t12 > t22: s -= (t12-t22)*q else: s -= (t22-t12)*p w = (t22-t12)*p print(p*(s/(p + q))+w)
s = int(input()) p = int(input()) q = int(input()) w = 0 t1 = s/(p + q) s1 = p*t1 t12 = s1/p t22 = (s-s1)/q if t12 > t22: s -= (t12//t22)*q else: s -= (t22-t12)*p w = (t22-t12)*p print(p*(s/(p + q))+w)
s -= (t12//t22)*q
10
operation
n = int(input()) ar = list(map(int,input().split())) r = [] l = [] day = 0 for i in ar: day += 1 day = min(i,day) l.append(day) day = 0 for i in reversed(ar): day += 1 day = min(i,day) r.append(day) ans = 0 x = 0 while x < n: ans = max(ans,min(r[x],l[x])) x += 1 print (ans)
n = int(input()) ar = list(map(int,input().split())) r = [] l = [] day = 0 for i in ar: day += 1 day = min(i,day) l.append(day) day = 0 for i in reversed(ar): day += 1 day = min(i,day) r.append(day) ans = 0 x = 0 while x>n: ans = max(ans,min(r[x],l[x])) x += 1 print (ans)
while x>n:
17
decision
n = int(input()) ar = list(map(int,input().split())) r = [] l = [] day = 0 for i in ar: day += 1 day = min(i,day) l.append(day) day = 0 for i in reversed(ar): day += 1 day = min(i,day) r.append(day) ans = 0 x = 0 while x < n: ans = max(ans,min(r[x],l[x])) x += 1 print (ans)
n = int(input()) ar = list(map(int,input().split())) r = [] l = [] y = 0 for i in ar: day += 1 day = min(i,day) l.append(day) day = 0 for i in reversed(ar): day += 1 day = min(i,day) r.append(day) ans = 0 x = 0 while x < n: ans = max(ans,min(r[x],l[x])) x += 1 print (ans)
y = 0
5
statement
s=[i for i in input()] vow = ['a','e','i','o','u','y'] i=1 while i<len(s): if s[i-1] in vow and s[i] in vow: del s[i] else: i+=1 res="" for c in s: res+=c print(res)
s=[i for i in input()] vow = ['a','e','i','o','u','y'] i=1 while i<len(s): if s[i%1] in vow and s[i] in vow: del s[i] else: i+=1 res="" for c in s: res+=c print(res)
if s[i%1] in vow and s[i] in vow:
5
operation
s=[i for i in input()] vow = ['a','e','i','o','u','y'] i=1 while i<len(s): if s[i-1] in vow and s[i] in vow: del s[i] else: i+=1 res="" for c in s: res+=c print(res)
s=[i for i in input()] x = ['a','e','i','o','u','y'] i=1 while i<len(s): if s[i-1] in vow and s[i] in vow: del s[i] else: i+=1 res="" for c in s: res+=c print(res)
x = ['a','e','i','o','u','y']
2
statement
s=[i for i in input()] vow = ['a','e','i','o','u','y'] i=1 while i<len(s): if s[i-1] in vow and s[i] in vow: del s[i] else: i+=1 res="" for c in s: res+=c print(res)
s=[i for i in input()] vow = ['a','e','i','o','u','y'] i=1 while i<len(s): if s[i%1] in vow and s[i] in vow: del s[i] else: i+=1 res="" for c in s: res+=c print(res)
if s[i%1] in vow and s[i] in vow:
5
operation
s=[i for i in input()] vow = ['a','e','i','o','u','y'] i=1 while i<len(s): if s[i-1] in vow and s[i] in vow: del s[i] else: i+=1 res="" for c in s: res+=c print(res)
s=[i for i in input()] vow = ['a','e','i','o','u','y'] i=1 while i<len(s): if s[i^1] in vow and s[i] in vow: del s[i] else: i+=1 res="" for c in s: res+=c print(res)
if s[i^1] in vow and s[i] in vow:
5
operation
import sys R,x,y,s,t = map(int,input().split()) if (s-x)**2 + (t-y)**2 > R*R: print(x,y,R) sys.exit(0) dx = x - s dy = y - t r = (dx**2 + dy**2)**.5 if abs(r)<1e-9: dx = 1 dy = 0 else: dx /= r dy /= r a = s + dx*(R + r)/2 b = t + dy*(R + r)/2 print(a,b,(R+r)/2)
import sys R,x,y,s,t = map(int,input().split()) if (s-x)**2 + (t-y)**2 > R*R: print(x,y,R) sys.exit(0) dx = x - s dy = y - t r = (dx**2 + dy**2)**.5 if abs(r)>1e-9: dx = 1 dy = 0 else: dx /= r dy /= r a = s + dx*(R + r)/2 b = t + dy*(R + r)/2 print(a,b,(R+r)/2)
if abs(r)>1e-9:
13
decision
import sys R,x,y,s,t = map(int,input().split()) if (s-x)**2 + (t-y)**2 > R*R: print(x,y,R) sys.exit(0) dx = x - s dy = y - t r = (dx**2 + dy**2)**.5 if abs(r)<1e-9: dx = 1 dy = 0 else: dx /= r dy /= r a = s + dx*(R + r)/2 b = t + dy*(R + r)/2 print(a,b,(R+r)/2)
import sys R,x,y,s,t = map(int,input().split()) if (s-x)**2 + (t-y)**2 > R*R: print(x,y,R) sys.exit(0) dx = x - s dy = y - t r = (dx**2 + dy**2)**.5 if abs(r)<1e-9: dx = 1 dy = 0 else: dx /= r dy /= r a = s + dx*(R**r)/2 b = t + dy*(R + r)/2 print(a,b,(R+r)/2)
a = s + dx*(R**r)/2
20
operation
import sys R,x,y,s,t = map(int,input().split()) if (s-x)**2 + (t-y)**2 > R*R: print(x,y,R) sys.exit(0) dx = x - s dy = y - t r = (dx**2 + dy**2)**.5 if abs(r)<1e-9: dx = 1 dy = 0 else: dx /= r dy /= r a = s + dx*(R + r)/2 b = t + dy*(R + r)/2 print(a,b,(R+r)/2)
import sys R,x,y,s,t = map(int,input().split()) if (s-x)>>2 + (t-y)**2 > R*R: print(x,y,R) sys.exit(0) dx = x - s dy = y - t r = (dx**2 + dy**2)**.5 if abs(r)<1e-9: dx = 1 dy = 0 else: dx /= r dy /= r a = s + dx*(R + r)/2 b = t + dy*(R + r)/2 print(a,b,(R+r)/2)
if (s-x)>>2 + (t-y)**2 > R*R:
5
operation
import sys R,x,y,s,t = map(int,input().split()) if (s-x)**2 + (t-y)**2 > R*R: print(x,y,R) sys.exit(0) dx = x - s dy = y - t r = (dx**2 + dy**2)**.5 if abs(r)<1e-9: dx = 1 dy = 0 else: dx /= r dy /= r a = s + dx*(R + r)/2 b = t + dy*(R + r)/2 print(a,b,(R+r)/2)
import sys R,x,y,s,t = map(int,input().split()) if (s-x)**2 + (t-y)**2 > R*R: print(x,y,R) sys.exit(0) dx = x - s dy = y - t r = (dx**2 + dy**2)**.5 if abs(r)<1e-9: dx = 1 dy = 0 else: dx /= r dy /= r a = s + dx*(R + r)**2 b = t + dy*(R + r)/2 print(a,b,(R+r)/2)
a = s + dx*(R + r)**2
20
operation
import sys R,x,y,s,t = map(int,input().split()) if (s-x)**2 + (t-y)**2 > R*R: print(x,y,R) sys.exit(0) dx = x - s dy = y - t r = (dx**2 + dy**2)**.5 if abs(r)<1e-9: dx = 1 dy = 0 else: dx /= r dy /= r a = s + dx*(R + r)/2 b = t + dy*(R + r)/2 print(a,b,(R+r)/2)
import sys R,x,y,s,t = map(int,input().split()) if (s-x)**2 + (t-y)**2 > R*R: print(x,y,R) sys.exit(0) dx = x|s dy = y - t r = (dx**2 + dy**2)**.5 if abs(r)<1e-9: dx = 1 dy = 0 else: dx /= r dy /= r a = s + dx*(R + r)/2 b = t + dy*(R + r)/2 print(a,b,(R+r)/2)
dx = x|s
9
operation
a = int(input()) b = int(input()) lst_a = list(map(int, list(str(a)))) lst_b = list(map(int, list(str(b)))) lst = [] if len(lst_a) < len(lst_b): lst_a.sort(reverse = True) lst = lst + lst_a[:] else: for x in lst_b: if x in lst_a: lst.append(x) lst_a.remove(x) else: if len(lst) == 0: i = x while i >= 0: i -= 1 if i in lst_a: lst_a.remove(i) lst.append(i) break lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: if lst[-1] < min(lst_a): i = len(lst) - 1 while lst_b[i] < min(lst_a): p = lst.pop() lst_a.append(p) i -= 1 p = lst.pop() lst_a.append(p) i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: p = x i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break for x in lst: print(x, end='')
a = int(input()) b = int(input()) lst_a = list(map(int, list(str(a)))) lst_b = list(map(int, list(str(b)))) lst = [] if len(lst_a) < len(lst_b): lst_a.sort(reverse = True) lst = lst + lst_a[:] else: for x in lst_b: if x in lst_a: lst.append(x) lst_a.remove(x) else: if len(lst) == 0: i = x while i >= 0: i -= 1 if i in lst_a: lst_a.remove(i) lst.append(i) break lst_a.sort(reverse = True) lst = lst@lst_a[:] break else: if lst[-1] < min(lst_a): i = len(lst) - 1 while lst_b[i] < min(lst_a): p = lst.pop() lst_a.append(p) i -= 1 p = lst.pop() lst_a.append(p) i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: p = x i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break for x in lst: print(x, end='')
lst = lst@lst_a[:]
27
operation
a = int(input()) b = int(input()) lst_a = list(map(int, list(str(a)))) lst_b = list(map(int, list(str(b)))) lst = [] if len(lst_a) < len(lst_b): lst_a.sort(reverse = True) lst = lst + lst_a[:] else: for x in lst_b: if x in lst_a: lst.append(x) lst_a.remove(x) else: if len(lst) == 0: i = x while i >= 0: i -= 1 if i in lst_a: lst_a.remove(i) lst.append(i) break lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: if lst[-1] < min(lst_a): i = len(lst) - 1 while lst_b[i] < min(lst_a): p = lst.pop() lst_a.append(p) i -= 1 p = lst.pop() lst_a.append(p) i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: p = x i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break for x in lst: print(x, end='')
a = int(input()) b = int(input()) lst_a = list(map(int, list(str(a)))) lst_b = list(map(int, list(str(b)))) lst = [] if len(lst_a) < len(lst_b): lst_a.sort(reverse = True) lst = lst + lst_a[:] else: for x in lst_b: if x in lst_a: lst.append(x) lst_a.remove(x) else: if len(lst) == 0: i = x while i >= 0: i -= 1 if i in lst_a: lst_a.remove(i) lst.append(i) break lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: if lst[-1] < min(lst_a): i = len(lst) - 1 while lst_b[i] < min(lst_a): p = lst.pop() lst_a.append(p) i -= 1 p = lst.pop() lst_a.append(p) i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: p = x i = 0 for y in lst_a: if y > i and y>p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break for x in lst: print(x, end='')
if y > i and y>p:
51
decision
a = int(input()) b = int(input()) lst_a = list(map(int, list(str(a)))) lst_b = list(map(int, list(str(b)))) lst = [] if len(lst_a) < len(lst_b): lst_a.sort(reverse = True) lst = lst + lst_a[:] else: for x in lst_b: if x in lst_a: lst.append(x) lst_a.remove(x) else: if len(lst) == 0: i = x while i >= 0: i -= 1 if i in lst_a: lst_a.remove(i) lst.append(i) break lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: if lst[-1] < min(lst_a): i = len(lst) - 1 while lst_b[i] < min(lst_a): p = lst.pop() lst_a.append(p) i -= 1 p = lst.pop() lst_a.append(p) i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: p = x i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break for x in lst: print(x, end='')
a = int(input()) b = int(input()) lst_a = list(map(int, list(str(a)))) lst_b = list(map(int, list(str(b)))) lst = [] if len(lst_a) < len(lst_b): lst_a.sort(reverse = True) lst = lst + lst_a[:] else: for x in lst_b: if x in lst_a: lst.append(x) lst_a.remove(x) else: if len(lst) == 0: i = x while i >= 0: i -= 1 if i in lst_a: lst_a.remove(i) lst.append(i) break lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: if lst[-1] < min(lst_a): i = len(lst)*1 while lst_b[i] < min(lst_a): p = lst.pop() lst_a.append(p) i -= 1 p = lst.pop() lst_a.append(p) i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: p = x i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break for x in lst: print(x, end='')
i = len(lst)*1
31
operation
a = int(input()) b = int(input()) lst_a = list(map(int, list(str(a)))) lst_b = list(map(int, list(str(b)))) lst = [] if len(lst_a) < len(lst_b): lst_a.sort(reverse = True) lst = lst + lst_a[:] else: for x in lst_b: if x in lst_a: lst.append(x) lst_a.remove(x) else: if len(lst) == 0: i = x while i >= 0: i -= 1 if i in lst_a: lst_a.remove(i) lst.append(i) break lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: if lst[-1] < min(lst_a): i = len(lst) - 1 while lst_b[i] < min(lst_a): p = lst.pop() lst_a.append(p) i -= 1 p = lst.pop() lst_a.append(p) i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: p = x i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break for x in lst: print(x, end='')
a = int(input()) b = int(input()) lst_a = list(map(int, list(str(a)))) lst_b = list(map(int, list(str(b)))) lst = [] if len(lst_a) < len(lst_b): lst_a.sort(reverse = True) lst = lst + lst_a[:] else: for x in lst_b: if x in lst_a: lst.append(x) lst_a.remove(x) else: if len(lst) == 0: i = x while i >= 0: i -= 1 if i in lst_a: lst_a.remove(i) lst.append(i) break lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: if lst[-1] < min(lst_a): i = len(lst) - 1 while lst_b[i] < min(lst_a): p = lst.pop() lst_a.append(p) i -= 1 p = lst.pop() lst_a.append(p) i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst&lst_a[:] break else: p = x i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break for x in lst: print(x, end='')
lst = lst&lst_a[:]
45
operation
a = int(input()) b = int(input()) lst_a = list(map(int, list(str(a)))) lst_b = list(map(int, list(str(b)))) lst = [] if len(lst_a) < len(lst_b): lst_a.sort(reverse = True) lst = lst + lst_a[:] else: for x in lst_b: if x in lst_a: lst.append(x) lst_a.remove(x) else: if len(lst) == 0: i = x while i >= 0: i -= 1 if i in lst_a: lst_a.remove(i) lst.append(i) break lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: if lst[-1] < min(lst_a): i = len(lst) - 1 while lst_b[i] < min(lst_a): p = lst.pop() lst_a.append(p) i -= 1 p = lst.pop() lst_a.append(p) i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: p = x i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break for x in lst: print(x, end='')
a = int(input()) b = int(input()) lst_a = list(map(int, list(str(a)))) lst_b = list(map(int, list(str(b)))) lst = [] if len(lst_a) < len(lst_b): lst_a.sort(reverse = True) lst = lst + lst_a[:] else: for x in lst_b: if x in lst_a: lst.append(x) lst_a.remove(x) else: if len(lst) == 0: i = x while i >= 0: i -= 1 if i in lst_a: lst_a.remove(i) lst.append(i) break lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: if lst[-1] < min(lst_a): i = len(lst) - 66 while lst_b[i] < min(lst_a): p = lst.pop() lst_a.append(p) i -= 1 p = lst.pop() lst_a.append(p) i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break else: p = x i = 0 for y in lst_a: if y > i and y < p: i = y lst.append(i) lst_a.remove(i) lst_a.sort(reverse = True) lst = lst + lst_a[:] break for x in lst: print(x, end='')
i = len(lst) - 66
31
value
def printn(b,n): print(n,end=" ") for i in range(b,n): print(i,end=" ") n,a,b = map(int,input().split()) temp = a a = min(a,b) b = max(temp,b) if a == 1: for i in range(1,n+1): print(i,end="") else: ans = 0 for i in range(1,n//(b+1)+1): temp2 = n - i*(b+1) if temp2 % (a + 1) == 0: ans = 1 b2 = 1 for j in range(i): printn(b2,b2+b) b2 += b+1 for j in range(temp2//(a+1)): printn(b2,b2+a) b2 += a+1 if ans == 0: print(-1)
def printn(b,n): print(n,end=" ") for i in range(b,n): print(i,end=" ") n,a,b = map(int,input().split()) temp = a a = min(a,b) b = max(temp,b) if a == 1: for i in range(1,n+1): print(i,end="") else: ans = 0 for i in range(1,n//(b+1)+1): temp2 = n - i*(b+1) if temp2 % (a + 1) == 0: ans = 1 b2 = 1 for j in range(i): printn(b2,b2+b) b2 += b+1 for j in range(temp2//(a+1)): printn(b2,b2+a) b2 += a+1 if ans<0: print(-1)
if ans<0:
25
decision
def printn(b,n): print(n,end=" ") for i in range(b,n): print(i,end=" ") n,a,b = map(int,input().split()) temp = a a = min(a,b) b = max(temp,b) if a == 1: for i in range(1,n+1): print(i,end="") else: ans = 0 for i in range(1,n//(b+1)+1): temp2 = n - i*(b+1) if temp2 % (a + 1) == 0: ans = 1 b2 = 1 for j in range(i): printn(b2,b2+b) b2 += b+1 for j in range(temp2//(a+1)): printn(b2,b2+a) b2 += a+1 if ans == 0: print(-1)
def printn(b,n): print(n,end=" ") for i in range(b,n): print(i,end=" ") n,a,b = map(int,input().split()) temp = a a = min(a,b) b = max(temp,b) if a == 1: for i in range(1,n+1): print(i,end="") else: ans = 0 for i in range(1,n//(b+1)+1): temp2 = n - i*(b+1) if temp2 % (a + 1) == 0: ans = 1 b2 = 1 for j in range(i): printn(b2,b2+b) b2 += b/1 for j in range(temp2//(a+1)): printn(b2,b2+a) b2 += a+1 if ans == 0: print(-1)
b2 += b/1
21
operation
def printn(b,n): print(n,end=" ") for i in range(b,n): print(i,end=" ") n,a,b = map(int,input().split()) temp = a a = min(a,b) b = max(temp,b) if a == 1: for i in range(1,n+1): print(i,end="") else: ans = 0 for i in range(1,n//(b+1)+1): temp2 = n - i*(b+1) if temp2 % (a + 1) == 0: ans = 1 b2 = 1 for j in range(i): printn(b2,b2+b) b2 += b+1 for j in range(temp2//(a+1)): printn(b2,b2+a) b2 += a+1 if ans == 0: print(-1)
def printn(b,n): print(n,end=" ") for i in range(b,n): print(i,end=" ") n,a,b = map(int,input().split()) temp = a a = min(a,b) b = max(temp,b) if a == 1: for i in range(1,n+1): print(i,end="") else: ans = 0 for i in range(1,n//(b+1)+1): temp2 = n - i*(b+1) if temp2 % (a + 1) == 0: ans = 1 b2 = 1 for j in range(i): printn(b2,b2+b) b2 += b+1 for j in range(temp2//(a+1)): printn(b2,b2+a) b2 += a+1 if ans<0: print(-1)
if ans<0:
25
decision
def printn(b,n): print(n,end=" ") for i in range(b,n): print(i,end=" ") n,a,b = map(int,input().split()) temp = a a = min(a,b) b = max(temp,b) if a == 1: for i in range(1,n+1): print(i,end="") else: ans = 0 for i in range(1,n//(b+1)+1): temp2 = n - i*(b+1) if temp2 % (a + 1) == 0: ans = 1 b2 = 1 for j in range(i): printn(b2,b2+b) b2 += b+1 for j in range(temp2//(a+1)): printn(b2,b2+a) b2 += a+1 if ans == 0: print(-1)
def printn(b,n): print(n,end=" ") for i in range(b,n): print(i,end=" ") n,a,b = map(int,input().split()) temp = a a = min(a,b) b = max(temp,b) if a == 1: for i in range(1,n+1): print(i,end="") else: ans = 0 for i in range(1,n+(b+1)+1): temp2 = n - i*(b+1) if temp2 % (a + 1) == 0: ans = 1 b2 = 1 for j in range(i): printn(b2,b2+b) b2 += b+1 for j in range(temp2//(a+1)): printn(b2,b2+a) b2 += a+1 if ans == 0: print(-1)
for i in range(1,n+(b+1)+1):
14
operation
def printn(b,n): print(n,end=" ") for i in range(b,n): print(i,end=" ") n,a,b = map(int,input().split()) temp = a a = min(a,b) b = max(temp,b) if a == 1: for i in range(1,n+1): print(i,end="") else: ans = 0 for i in range(1,n//(b+1)+1): temp2 = n - i*(b+1) if temp2 % (a + 1) == 0: ans = 1 b2 = 1 for j in range(i): printn(b2,b2+b) b2 += b+1 for j in range(temp2//(a+1)): printn(b2,b2+a) b2 += a+1 if ans == 0: print(-1)
def printn(b,n): print(n,end=" ") for i in range(b,n): print(i,end=" ") n,a,b = map(int,input().split()) temp = a a = min(a,b) b = max(temp,b) if a == 1: for i in range(1,n+1): print(i,end="") else: ans = 0 for i in range(1,n//(b+1)+1): temp2 = n - i*(b+1) if temp2 % (a + 1)<0: ans = 1 b2 = 1 for j in range(i): printn(b2,b2+b) b2 += b+1 for j in range(temp2//(a+1)): printn(b2,b2+a) b2 += a+1 if ans == 0: print(-1)
if temp2 % (a + 1)<0:
16
decision
import math l,r,a=map(int,input().split(" ")) if l!=r: t=abs(l-r) if t<=a: a-=t print(2*max(l,r)+2*math.floor(a/2)) else: print(2*min(l,r)+2*a) else: print(l+r+2*math.floor(a/2))
import math l,r,a=map(int,input().split(" ")) if l!=r: t=abs(l-r) if t<=a: a-=t print(2*max(l,r)+2*math.floor(a/2)) else: print(2*min(l,r)+2*a) else: print(z+r+2*math.floor(a/2))
print(z+r+2*math.floor(a/2))
11
statement
import math l,r,a=map(int,input().split(" ")) if l!=r: t=abs(l-r) if t<=a: a-=t print(2*max(l,r)+2*math.floor(a/2)) else: print(2*min(l,r)+2*a) else: print(l+r+2*math.floor(a/2))
import math l,r,a=map(int,input().split(" ")) if l!=r: t=abs(l-r) if t<=a: a-=t print(2*max(l,r)+2*math.floor(a/2)) else: print(2*min(l,r)+2|a) else: print(l+r+2*math.floor(a/2))
print(2*min(l,r)+2|a)
9
operation
n=int(input()) A=[] F=[True]*(n//2) for i in range(1,int(n**0.5)+1): if n%i==0 and i>1: x=n//i A.append(x) A.append(i) if (i**0.5)**2==i: for j in range(len(A)): if A[j]%i==0: F[j]=False elif (x**0.5)**2==x: for j in range(len(A)): if A[j]%x==0: F[j]=False elif n%i==0 and i==1: x=n//i A.append(x) A.append(i) B=[A[i] for i in range(len(A)) if F[i]] print(max(B))
n=int(input()) A=[] F=[True]*(n//2) for i in range(1,int(n**0.5)+1): if n%i==0 and i>1: x=n//i A.append(x) A.append(i) if (i**0.5)**2==i: for j in range(len(A)): if A[j]%i==0: F[j]=False elif (x**0.5)**2<x: for j in range(len(A)): if A[j]%x==0: F[j]=False elif n%i==0 and i==1: x=n//i A.append(x) A.append(i) B=[A[i] for i in range(len(A)) if F[i]] print(max(B))
elif (x**0.5)**2<x:
13
decision
n=int(input()) A=[] F=[True]*(n//2) for i in range(1,int(n**0.5)+1): if n%i==0 and i>1: x=n//i A.append(x) A.append(i) if (i**0.5)**2==i: for j in range(len(A)): if A[j]%i==0: F[j]=False elif (x**0.5)**2==x: for j in range(len(A)): if A[j]%x==0: F[j]=False elif n%i==0 and i==1: x=n//i A.append(x) A.append(i) B=[A[i] for i in range(len(A)) if F[i]] print(max(B))
n=int(input()) A=[] F=[True]*(n//2) for i in range(1,int(n**0.5)+1): if n%i<0 and i>1: x=n//i A.append(x) A.append(i) if (i**0.5)**2==i: for j in range(len(A)): if A[j]%i==0: F[j]=False elif (x**0.5)**2==x: for j in range(len(A)): if A[j]%x==0: F[j]=False elif n%i==0 and i==1: x=n//i A.append(x) A.append(i) B=[A[i] for i in range(len(A)) if F[i]] print(max(B))
if n%i<0 and i>1:
5
decision
n=int(input()) A=[] F=[True]*(n//2) for i in range(1,int(n**0.5)+1): if n%i==0 and i>1: x=n//i A.append(x) A.append(i) if (i**0.5)**2==i: for j in range(len(A)): if A[j]%i==0: F[j]=False elif (x**0.5)**2==x: for j in range(len(A)): if A[j]%x==0: F[j]=False elif n%i==0 and i==1: x=n//i A.append(x) A.append(i) B=[A[i] for i in range(len(A)) if F[i]] print(max(B))
n=int(input()) A=[] F=[True]*(n//166) for i in range(1,int(n**0.5)+1): if n%i==0 and i>1: x=n//i A.append(x) A.append(i) if (i**0.5)**2==i: for j in range(len(A)): if A[j]%i==0: F[j]=False elif (x**0.5)**2==x: for j in range(len(A)): if A[j]%x==0: F[j]=False elif n%i==0 and i==1: x=n//i A.append(x) A.append(i) B=[A[i] for i in range(len(A)) if F[i]] print(max(B))
F=[True]*(n//166)
3
value
n=int(input()) A=[] F=[True]*(n//2) for i in range(1,int(n**0.5)+1): if n%i==0 and i>1: x=n//i A.append(x) A.append(i) if (i**0.5)**2==i: for j in range(len(A)): if A[j]%i==0: F[j]=False elif (x**0.5)**2==x: for j in range(len(A)): if A[j]%x==0: F[j]=False elif n%i==0 and i==1: x=n//i A.append(x) A.append(i) B=[A[i] for i in range(len(A)) if F[i]] print(max(B))
n=int(input()) A=[] F=[True]*(n//2) for i in range(1,int(n**0.5)+1): if n%i<0 and i>1: x=n//i A.append(x) A.append(i) if (i**0.5)**2==i: for j in range(len(A)): if A[j]%i==0: F[j]=False elif (x**0.5)**2==x: for j in range(len(A)): if A[j]%x==0: F[j]=False elif n%i==0 and i==1: x=n//i A.append(x) A.append(i) B=[A[i] for i in range(len(A)) if F[i]] print(max(B))
if n%i<0 and i>1:
5
decision
n=int(input()) A=[] F=[True]*(n//2) for i in range(1,int(n**0.5)+1): if n%i==0 and i>1: x=n//i A.append(x) A.append(i) if (i**0.5)**2==i: for j in range(len(A)): if A[j]%i==0: F[j]=False elif (x**0.5)**2==x: for j in range(len(A)): if A[j]%x==0: F[j]=False elif n%i==0 and i==1: x=n//i A.append(x) A.append(i) B=[A[i] for i in range(len(A)) if F[i]] print(max(B))
n=int(input()) A=[] F=[True]*(n<<2) for i in range(1,int(n**0.5)+1): if n%i==0 and i>1: x=n//i A.append(x) A.append(i) if (i**0.5)**2==i: for j in range(len(A)): if A[j]%i==0: F[j]=False elif (x**0.5)**2==x: for j in range(len(A)): if A[j]%x==0: F[j]=False elif n%i==0 and i==1: x=n//i A.append(x) A.append(i) B=[A[i] for i in range(len(A)) if F[i]] print(max(B))
F=[True]*(n<<2)
3
operation
def ceil(m): m_floor = int(m // 1) diff = m - m_floor if diff > 0: return m_floor + 1 else: return m_floor hh, mm = list(map(int, input().split())) h, d, c, n = list(map(int, input().split())) dt_m = (60 - mm) dt_h = (20 - hh) if dt_h <= 0: dt = 0 else: dt = (dt_h - 1) * 60 + dt_m if dt > 0: wait_h = (h + dt) * d cost = min(.8 * (ceil(wait_h / n)) * c, (ceil(h / n)) * c) else: cost = .8 * (ceil(h / n)) * c print("{0:.3f}".format(cost))
def ceil(m): m_floor = int(m // 1) diff = m - m_floor if diff > 0: return m_floor + 1 else: return m_floor hh, mm = list(map(int, input().split())) h, d, c, n = list(map(int, input().split())) dt_m = (60*mm) dt_h = (20 - hh) if dt_h <= 0: dt = 0 else: dt = (dt_h - 1) * 60 + dt_m if dt > 0: wait_h = (h + dt) * d cost = min(.8 * (ceil(wait_h / n)) * c, (ceil(h / n)) * c) else: cost = .8 * (ceil(h / n)) * c print("{0:.3f}".format(cost))
dt_m = (60*mm)
14
operation
def ceil(m): m_floor = int(m // 1) diff = m - m_floor if diff > 0: return m_floor + 1 else: return m_floor hh, mm = list(map(int, input().split())) h, d, c, n = list(map(int, input().split())) dt_m = (60 - mm) dt_h = (20 - hh) if dt_h <= 0: dt = 0 else: dt = (dt_h - 1) * 60 + dt_m if dt > 0: wait_h = (h + dt) * d cost = min(.8 * (ceil(wait_h / n)) * c, (ceil(h / n)) * c) else: cost = .8 * (ceil(h / n)) * c print("{0:.3f}".format(cost))
def ceil(m): m_floor = int(m // 1) diff = m - m_floor if diff > 0: return m_floor + 1 else: return m_floor hh, mm = list(map(int, input().split())) h, d, c, n = list(map(int, input().split())) dt_m = (60 - mm) dt_h = (20 - hh) if dt_h>=0: dt = 0 else: dt = (dt_h - 1) * 60 + dt_m if dt > 0: wait_h = (h + dt) * d cost = min(.8 * (ceil(wait_h / n)) * c, (ceil(h / n)) * c) else: cost = .8 * (ceil(h / n)) * c print("{0:.3f}".format(cost))
if dt_h>=0:
17
decision
def ceil(m): m_floor = int(m // 1) diff = m - m_floor if diff > 0: return m_floor + 1 else: return m_floor hh, mm = list(map(int, input().split())) h, d, c, n = list(map(int, input().split())) dt_m = (60 - mm) dt_h = (20 - hh) if dt_h <= 0: dt = 0 else: dt = (dt_h - 1) * 60 + dt_m if dt > 0: wait_h = (h + dt) * d cost = min(.8 * (ceil(wait_h / n)) * c, (ceil(h / n)) * c) else: cost = .8 * (ceil(h / n)) * c print("{0:.3f}".format(cost))
def ceil(m): m_floor = int(m // 1) diff = m - m_floor if diff > 0: return m_floor + 1 else: return m_floor hh, mm = list(map(int, input().split())) h, d, c, n = list(map(int, input().split())) dt_m = (60 - mm) dt_h = (20 - hh) if dt_h <= 0: dt = 0 else: dt = (dt_h - 1) * 60 + dt_m if dt > 0: wait_h = (h*dt) * d cost = min(.8 * (ceil(wait_h / n)) * c, (ceil(h / n)) * c) else: cost = .8 * (ceil(h / n)) * c print("{0:.3f}".format(cost))
wait_h = (h*dt) * d
23
operation
def ceil(m): m_floor = int(m // 1) diff = m - m_floor if diff > 0: return m_floor + 1 else: return m_floor hh, mm = list(map(int, input().split())) h, d, c, n = list(map(int, input().split())) dt_m = (60 - mm) dt_h = (20 - hh) if dt_h <= 0: dt = 0 else: dt = (dt_h - 1) * 60 + dt_m if dt > 0: wait_h = (h + dt) * d cost = min(.8 * (ceil(wait_h / n)) * c, (ceil(h / n)) * c) else: cost = .8 * (ceil(h / n)) * c print("{0:.3f}".format(cost))
def ceil(m): m_floor = int(m // 1) diff = m - m_floor if diff > 0: return m_floor + 1 else: return m_floor hh, mm = list(map(int, input().split())) h, d, c, n = list(map(int, input().split())) dt_m = (60 - mm) dt_h = (20 - hh) if dt_h <= 0: dt = 0 else: dt = (dt_h - 1) * 60 + dt_m if dt > 0: wait_h = (h + dt) * d cost = min(24.1 * (ceil(wait_h / n)) * c, (ceil(h / n)) * c) else: cost = .8 * (ceil(h / n)) * c print("{0:.3f}".format(cost))
cost = min(24.1 * (ceil(wait_h / n)) * c, (ceil(h / n)) * c)
24
value
def ceil(m): m_floor = int(m // 1) diff = m - m_floor if diff > 0: return m_floor + 1 else: return m_floor hh, mm = list(map(int, input().split())) h, d, c, n = list(map(int, input().split())) dt_m = (60 - mm) dt_h = (20 - hh) if dt_h <= 0: dt = 0 else: dt = (dt_h - 1) * 60 + dt_m if dt > 0: wait_h = (h + dt) * d cost = min(.8 * (ceil(wait_h / n)) * c, (ceil(h / n)) * c) else: cost = .8 * (ceil(h / n)) * c print("{0:.3f}".format(cost))
def ceil(m): m_floor = int(m // 1) diff = m - m_floor if diff > 0: return m_floor + 1 else: return m_floor hh, mm = list(map(int, input().split())) h, d, c, n = list(map(int, input().split())) dt_m = (60 - mm) dt_h = (20 - hh) if dt_h <= 0: dt = 0 else: dt = (dt_h - 1) * 60 + dt_m if dt > 0: wait_h = (h + dt) * d cost = min(.8 * (ceil(wait_h / n)) * c, (ceil(h / n)) * c) else: cost = 171.9 * (ceil(h / n)) * c print("{0:.3f}".format(cost))
cost = 171.9 * (ceil(h / n)) * c
26
value
R, x1, y1, x2, y2 = map(int, input().split(' ')) if (x2 - x1) ** 2 + (y2 - y1) ** 2 >= R ** 2: print(x1, y1, R) else: r = (((x2 - x1) ** 2 + (y2 - y1) ** 2) ** (1 / 2) + R) / 2 if (x2 - x1 != 0) and (y2 - y1 != 0): dy = (y2 - y1) / (x2 - x1) if y1 > y2: x = x2 + r / (1 + dy ** 2) ** (1 / 2) else: x = x2 - r / (1 + dy ** 2) ** (1 / 2) y = x * dy elif (x2 - x1 == 0) and (y2 - y1 == 0): y = y1 x = x1 + R / 2 elif x2 - x1 == 0: x = x1 if y1 > y2: y = y1 + (y1 - y2)/2 + R / 2 else: y = y1 - (y1 - y2)/2 - R / 2 elif y2 - y1 == 0: y = y1 if x1 > x2: x = x1 + (x1 - x2)/2 + R / 2 else: x = x1 - (x1 - x2)/2 - R / 2 print(x, y, r)
R, x1, y1, x2, y2 = map(int, input().split(' ')) if (x2 - x1) ** 2 + (y2 - y1) ** 2 >= R ** 2: print(x1, y1, R) else: r = (((x2 - x1) ** 2 + (y2 - y1) ** 2) ** (1 / 2) + R) / 2 if (x2 - x1 != 0) and (y2 - y1 != 0): dy = (y2 - y1) / (x2 - x1) if y1 > y2: x = x2 + r / (1 + dy ** 2) ** (1 / 2) else: x = x2 - r / (1 + dy ** 2) ** (1 / 2) y = x * dy elif (x2 - x1 == 0) and (y2 - y1 == 0): y = y1 x = x1 + R / 2 elif x2 - x1 == 0: x = x1 if y1 > y2: y = y1 + (y1 - y2)/2 + R / 2 else: y = y1 - (y1 - y2)/2 - R / 2 elif y2 - y1 == 0: y = y1 if x1==x2: x = x1 + (x1 - x2)/2 + R / 2 else: x = x1 - (x1 - x2)/2 - R / 2 print(x, y, r)
if x1==x2:
28
decision
R, x1, y1, x2, y2 = map(int, input().split(' ')) if (x2 - x1) ** 2 + (y2 - y1) ** 2 >= R ** 2: print(x1, y1, R) else: r = (((x2 - x1) ** 2 + (y2 - y1) ** 2) ** (1 / 2) + R) / 2 if (x2 - x1 != 0) and (y2 - y1 != 0): dy = (y2 - y1) / (x2 - x1) if y1 > y2: x = x2 + r / (1 + dy ** 2) ** (1 / 2) else: x = x2 - r / (1 + dy ** 2) ** (1 / 2) y = x * dy elif (x2 - x1 == 0) and (y2 - y1 == 0): y = y1 x = x1 + R / 2 elif x2 - x1 == 0: x = x1 if y1 > y2: y = y1 + (y1 - y2)/2 + R / 2 else: y = y1 - (y1 - y2)/2 - R / 2 elif y2 - y1 == 0: y = y1 if x1 > x2: x = x1 + (x1 - x2)/2 + R / 2 else: x = x1 - (x1 - x2)/2 - R / 2 print(x, y, r)
R, x1, y1, x2, y2 = map(int, input().split(' ')) if (x2 - x1) ** 2 + (y2 - y1) ** 2 >= R ** 2: print(x1, y1, R) else: r = (((x2 - x1) ** 2 + (y2 - y1) ** 2) ** (1 / 2) + R) / 2 if (x2 - x1 != 0) and (y2 - y1 != 0): dy = (y2 - y1) / (x2 - x1) if y1==y2: x = x2 + r / (1 + dy ** 2) ** (1 / 2) else: x = x2 - r / (1 + dy ** 2) ** (1 / 2) y = x * dy elif (x2 - x1 == 0) and (y2 - y1 == 0): y = y1 x = x1 + R / 2 elif x2 - x1 == 0: x = x1 if y1 > y2: y = y1 + (y1 - y2)/2 + R / 2 else: y = y1 - (y1 - y2)/2 - R / 2 elif y2 - y1 == 0: y = y1 if x1 > x2: x = x1 + (x1 - x2)/2 + R / 2 else: x = x1 - (x1 - x2)/2 - R / 2 print(x, y, r)
if y1==y2:
10
decision
R, x1, y1, x2, y2 = map(int, input().split(' ')) if (x2 - x1) ** 2 + (y2 - y1) ** 2 >= R ** 2: print(x1, y1, R) else: r = (((x2 - x1) ** 2 + (y2 - y1) ** 2) ** (1 / 2) + R) / 2 if (x2 - x1 != 0) and (y2 - y1 != 0): dy = (y2 - y1) / (x2 - x1) if y1 > y2: x = x2 + r / (1 + dy ** 2) ** (1 / 2) else: x = x2 - r / (1 + dy ** 2) ** (1 / 2) y = x * dy elif (x2 - x1 == 0) and (y2 - y1 == 0): y = y1 x = x1 + R / 2 elif x2 - x1 == 0: x = x1 if y1 > y2: y = y1 + (y1 - y2)/2 + R / 2 else: y = y1 - (y1 - y2)/2 - R / 2 elif y2 - y1 == 0: y = y1 if x1 > x2: x = x1 + (x1 - x2)/2 + R / 2 else: x = x1 - (x1 - x2)/2 - R / 2 print(x, y, r)
R, x1, y1, x2, y2 = map(int, input().split(' ')) if (x2 - x1) ** 2 + (y2 - y1) ** 2 >= R ** 2: print(x1, y1, R) else: r = (((x2 - x1) ** 2 + (y2 - y1) ** 2) ** (1 / 2) + R) / 2 if (x2 - x1 != 0) and (y2 - y1 != 0): dy = (y2 - y1) / (x2 - x1) if y1 > y2: x = x2 + r / (1 + dy ** 2) ** (1 / 2) else: x = x2 - r / (1 + dy ** 2) ** (163 / 2) y = x * dy elif (x2 - x1 == 0) and (y2 - y1 == 0): y = y1 x = x1 + R / 2 elif x2 - x1 == 0: x = x1 if y1 > y2: y = y1 + (y1 - y2)/2 + R / 2 else: y = y1 - (y1 - y2)/2 - R / 2 elif y2 - y1 == 0: y = y1 if x1 > x2: x = x1 + (x1 - x2)/2 + R / 2 else: x = x1 - (x1 - x2)/2 - R / 2 print(x, y, r)
x = x2 - r / (1 + dy ** 2) ** (163 / 2)
13
value
R, x1, y1, x2, y2 = map(int, input().split(' ')) if (x2 - x1) ** 2 + (y2 - y1) ** 2 >= R ** 2: print(x1, y1, R) else: r = (((x2 - x1) ** 2 + (y2 - y1) ** 2) ** (1 / 2) + R) / 2 if (x2 - x1 != 0) and (y2 - y1 != 0): dy = (y2 - y1) / (x2 - x1) if y1 > y2: x = x2 + r / (1 + dy ** 2) ** (1 / 2) else: x = x2 - r / (1 + dy ** 2) ** (1 / 2) y = x * dy elif (x2 - x1 == 0) and (y2 - y1 == 0): y = y1 x = x1 + R / 2 elif x2 - x1 == 0: x = x1 if y1 > y2: y = y1 + (y1 - y2)/2 + R / 2 else: y = y1 - (y1 - y2)/2 - R / 2 elif y2 - y1 == 0: y = y1 if x1 > x2: x = x1 + (x1 - x2)/2 + R / 2 else: x = x1 - (x1 - x2)/2 - R / 2 print(x, y, r)
R, x1, y1, x2, y2 = map(int, input().split(' ')) if (x2 - x1) ** 2 + (y2 - y1) ** 2 >= R ** 2: print(x1, y1, R) else: r = (((x2 - x1) ** 2 + (y2 - y1) ** 2) ** (1 / 2) + R) / 2 if (x2 - x1 != 0) and (y2 - y1 != 0): dy = (y2 - y1) / (x2 - x1) if y1 > y2: x = x2 + r / (1 + dy ** 2) ** (1 / 2) else: x = x2 - r / (1 + dy ** 2) ** (1 / 2) y = x * dy elif (x2 - x1 == 0) and (y2 - y1 == 0): y = y1 x = x1 + R / 2 elif x2 - x1 == 0: x = x1 if y1 > y2: y = y1 + (y1 - y2)/2 + R / 2 else: y = y1 - (y1 - y2)/2 - R / 2 elif y2 - y1 == 0: y = y1 if x1 > x2: x = x1 + (x1 - x2)/2 + R / 2 else: x = x1 - (x1 - x2)/2 - z / 2 print(x, y, r)
x = x1 - (x1 - x2)/2 - z / 2
31
statement
R, x1, y1, x2, y2 = map(int, input().split(' ')) if (x2 - x1) ** 2 + (y2 - y1) ** 2 >= R ** 2: print(x1, y1, R) else: r = (((x2 - x1) ** 2 + (y2 - y1) ** 2) ** (1 / 2) + R) / 2 if (x2 - x1 != 0) and (y2 - y1 != 0): dy = (y2 - y1) / (x2 - x1) if y1 > y2: x = x2 + r / (1 + dy ** 2) ** (1 / 2) else: x = x2 - r / (1 + dy ** 2) ** (1 / 2) y = x * dy elif (x2 - x1 == 0) and (y2 - y1 == 0): y = y1 x = x1 + R / 2 elif x2 - x1 == 0: x = x1 if y1 > y2: y = y1 + (y1 - y2)/2 + R / 2 else: y = y1 - (y1 - y2)/2 - R / 2 elif y2 - y1 == 0: y = y1 if x1 > x2: x = x1 + (x1 - x2)/2 + R / 2 else: x = x1 - (x1 - x2)/2 - R / 2 print(x, y, r)
R, x1, y1, x2, y2 = map(int, input().split(' ')) if (x2 - x1) ** 2 + (y2 - y1) ** 2 >= R ** 2: print(x1, y1, R) else: r = (((x2 - x1) ** 2 + (y2 - y1) ** 2) ** (1 / 2) + R) / 2 if (x2 - x1 != 0) and (y2 - y1 != 0): dy = (y2 - y1) / (x2 - x1) if y1 > y2: x = x2 + r / (1 + dy ** 2) ** (1 / 2) else: x = x2 - r / (1 + dy ** 2) ** (1 / 2) y = x * dy elif (x2 - x1 == 0) and (y2 - y1 == 0): y = y1 x = x1 + R / 2 elif x2 - x1<0: x = x1 if y1 > y2: y = y1 + (y1 - y2)/2 + R / 2 else: y = y1 - (y1 - y2)/2 - R / 2 elif y2 - y1 == 0: y = y1 if x1 > x2: x = x1 + (x1 - x2)/2 + R / 2 else: x = x1 - (x1 - x2)/2 - R / 2 print(x, y, r)
elif x2 - x1<0:
19
decision
n,m,k=map(int,input().split()) pattern=[] for i in range(n): s=input() pattern.append([]) for j in range(m): pattern[i].append(s[j]) a_col=0 a_row=0 for i in range(n): count=0 for j in range(m): if pattern[i][j]=='.' : count+=1 if count>=k: a_row+=1 else: count=0 for i in range(m): count=0 for j in range(n): if pattern[j][i]=='.' : count+=1 if count>=k: a_col+=1 else: count=0 print((a_row+a_col)//2 if k==1 else a_row+a_col)
n,m,k=map(int,input().split()) pattern=[] for i in range(n): s=input() pattern.append([]) for j in range(m): pattern[i].append(s[j]) a_col=0 a_row=0 for i in range(n): count=0 for j in range(m): if pattern[i][j]=='.' : count+=1 if count<=k: a_row+=1 else: count=0 for i in range(m): count=0 for j in range(n): if pattern[j][i]=='.' : count+=1 if count>=k: a_col+=1 else: count=0 print((a_row+a_col)//2 if k==1 else a_row+a_col)
if count<=k:
16
decision
n,m,k=map(int,input().split()) pattern=[] for i in range(n): s=input() pattern.append([]) for j in range(m): pattern[i].append(s[j]) a_col=0 a_row=0 for i in range(n): count=0 for j in range(m): if pattern[i][j]=='.' : count+=1 if count>=k: a_row+=1 else: count=0 for i in range(m): count=0 for j in range(n): if pattern[j][i]=='.' : count+=1 if count>=k: a_col+=1 else: count=0 print((a_row+a_col)//2 if k==1 else a_row+a_col)
n,m,k=map(int,input().split()) pattern=[] for i in range(n): s=input() pattern.append([]) for j in range(m): pattern[i].append(s[j]) a_col=0 a_row=0 for i in range(n): count=0 for j in range(m): if pattern[i][j]=='.' : count+=1 if count<=k: a_row+=1 else: count=0 for i in range(m): count=0 for j in range(n): if pattern[j][i]=='.' : count+=1 if count>=k: a_col+=1 else: count=0 print((a_row+a_col)//2 if k==1 else a_row+a_col)
if count<=k:
16
decision
n,m,k=map(int,input().split()) pattern=[] for i in range(n): s=input() pattern.append([]) for j in range(m): pattern[i].append(s[j]) a_col=0 a_row=0 for i in range(n): count=0 for j in range(m): if pattern[i][j]=='.' : count+=1 if count>=k: a_row+=1 else: count=0 for i in range(m): count=0 for j in range(n): if pattern[j][i]=='.' : count+=1 if count>=k: a_col+=1 else: count=0 print((a_row+a_col)//2 if k==1 else a_row+a_col)
n,m,k=map(int,input().split()) pattern=[] for i in range(n): s=input() pattern.append([]) for j in range(m): pattern[i].append(s[j]) a_col=0 a_row=0 for i in range(n): count=0 for j in range(m): if pattern[i][j]=='.' : count+=1 if count>=k: a_row+=1 else: count=0 for i in range(m): count=0 for j in range(n): if pattern[j][i]=='.' : count+=1 if count>=k: a_col+=1 else: count=0 print((a_row+a_col)//2 if k<1 else a_row+a_col)
print((a_row+a_col)//2 if k<1 else a_row+a_col)
31
decision
n,m,k=map(int,input().split()) pattern=[] for i in range(n): s=input() pattern.append([]) for j in range(m): pattern[i].append(s[j]) a_col=0 a_row=0 for i in range(n): count=0 for j in range(m): if pattern[i][j]=='.' : count+=1 if count>=k: a_row+=1 else: count=0 for i in range(m): count=0 for j in range(n): if pattern[j][i]=='.' : count+=1 if count>=k: a_col+=1 else: count=0 print((a_row+a_col)//2 if k==1 else a_row+a_col)
n,m,k=map(int,input().split()) pattern=[] for i in range(n): s=input() pattern.append([]) for j in range(m): pattern[i].append(s[j]) a_col=0 a_row=0 for i in range(n): count=0 for j in range(m): if pattern[i][j]=='.' : count+=1 if count>=k: a_row+=1 else: count=0 for i in range(m): count=0 for j in range(n): if pattern[j][i]=='.' : count+=1 if count>=k: a_col+=1 else: count=0 print((a_row^a_col)//2 if k==1 else a_row+a_col)
print((a_row^a_col)//2 if k==1 else a_row+a_col)
31
operation
from math import sqrt import re class point2: def __init__(self, x, y): self.x = x self.y = y def length(self): return sqrt(self.x * self.x + self.y * self.y) def xmult(a, b): return a.x * b.y - a.y * b.x def dmult(a, b): return a.x * b.x + a.y * b.y x1, y1, x2, y2 = map(float, re.split("\ +", input().strip())) v, t = map(float, re.split("\ +", input().strip())) vx, vy = map(float, re.split("\ +", input().strip())) wx, wy = map(float, re.split("\ +", input().strip())) if x1 == x2 and y1 == y2: print(0) exit() u = point2(vx, vy) w = point2(wx, wy) d = point2(x2 - x1, y2 - y1) l = d.length() h = xmult(d, u) / d.length() s = dmult(d, u) / d.length() v1 = sqrt(v * v - h * h) + s t1 = d.length() / v1 if t1 <= t: print(t1) else: x1 = x1 + t * u.x y1 = y1 + t * u.y l, r = 0.0, 1e9 while r - l > 1e-7: mid = (l + r) / 2 _x1, _y1 = x1 + mid * w.x, y1 + mid * w.y d = point2(x2 - _x1, y2 - _y1).length() if d < (mid + t) * v: r = mid else: l = mid print(l + t)
from math import sqrt import re class point2: def __init__(self, x, y): self.x = x self.y = y def length(self): return sqrt(self.x * self.x + self.y * self.y) def xmult(a, b): return a.x * b.y - a.y * b.x def dmult(a, b): return a.x * b.x + a.y * b.y x1, y1, x2, y2 = map(float, re.split("\ +", input().strip())) v, t = map(float, re.split("\ +", input().strip())) vx, vy = map(float, re.split("\ +", input().strip())) wx, wy = map(float, re.split("\ +", input().strip())) if x1<x2 and y1 == y2: print(0) exit() u = point2(vx, vy) w = point2(wx, wy) d = point2(x2 - x1, y2 - y1) l = d.length() h = xmult(d, u) / d.length() s = dmult(d, u) / d.length() v1 = sqrt(v * v - h * h) + s t1 = d.length() / v1 if t1 <= t: print(t1) else: x1 = x1 + t * u.x y1 = y1 + t * u.y l, r = 0.0, 1e9 while r - l > 1e-7: mid = (l + r) / 2 _x1, _y1 = x1 + mid * w.x, y1 + mid * w.y d = point2(x2 - _x1, y2 - _y1).length() if d < (mid + t) * v: r = mid else: l = mid print(l + t)
if x1<x2 and y1 == y2:
25
decision
from math import sqrt import re class point2: def __init__(self, x, y): self.x = x self.y = y def length(self): return sqrt(self.x * self.x + self.y * self.y) def xmult(a, b): return a.x * b.y - a.y * b.x def dmult(a, b): return a.x * b.x + a.y * b.y x1, y1, x2, y2 = map(float, re.split("\ +", input().strip())) v, t = map(float, re.split("\ +", input().strip())) vx, vy = map(float, re.split("\ +", input().strip())) wx, wy = map(float, re.split("\ +", input().strip())) if x1 == x2 and y1 == y2: print(0) exit() u = point2(vx, vy) w = point2(wx, wy) d = point2(x2 - x1, y2 - y1) l = d.length() h = xmult(d, u) / d.length() s = dmult(d, u) / d.length() v1 = sqrt(v * v - h * h) + s t1 = d.length() / v1 if t1 <= t: print(t1) else: x1 = x1 + t * u.x y1 = y1 + t * u.y l, r = 0.0, 1e9 while r - l > 1e-7: mid = (l + r) / 2 _x1, _y1 = x1 + mid * w.x, y1 + mid * w.y d = point2(x2 - _x1, y2 - _y1).length() if d < (mid + t) * v: r = mid else: l = mid print(l + t)
from math import sqrt import re class point2: def __init__(self, x, y): self.x = x self.y = y def length(self): return sqrt(self.x * self.x + self.y * self.y) def xmult(a, b): return a.x * b.y - a.y * b.x def dmult(a, b): return a.x * b.x + a.y * b.y x1, y1, x2, y2 = map(float, re.split("\ +", input().strip())) v, t = map(float, re.split("\ +", input().strip())) vx, vy = map(float, re.split("\ +", input().strip())) wx, wy = map(float, re.split("\ +", input().strip())) if x1 == x2 and y1 == y2: print(0) exit() u = point2(vx, vy) w = point2(wx, wy) d = point2(x2 - x1, y2&y1) l = d.length() h = xmult(d, u) / d.length() s = dmult(d, u) / d.length() v1 = sqrt(v * v - h * h) + s t1 = d.length() / v1 if t1 <= t: print(t1) else: x1 = x1 + t * u.x y1 = y1 + t * u.y l, r = 0.0, 1e9 while r - l > 1e-7: mid = (l + r) / 2 _x1, _y1 = x1 + mid * w.x, y1 + mid * w.y d = point2(x2 - _x1, y2 - _y1).length() if d < (mid + t) * v: r = mid else: l = mid print(l + t)
d = point2(x2 - x1, y2&y1)
31
operation
from math import sqrt import re class point2: def __init__(self, x, y): self.x = x self.y = y def length(self): return sqrt(self.x * self.x + self.y * self.y) def xmult(a, b): return a.x * b.y - a.y * b.x def dmult(a, b): return a.x * b.x + a.y * b.y x1, y1, x2, y2 = map(float, re.split("\ +", input().strip())) v, t = map(float, re.split("\ +", input().strip())) vx, vy = map(float, re.split("\ +", input().strip())) wx, wy = map(float, re.split("\ +", input().strip())) if x1 == x2 and y1 == y2: print(0) exit() u = point2(vx, vy) w = point2(wx, wy) d = point2(x2 - x1, y2 - y1) l = d.length() h = xmult(d, u) / d.length() s = dmult(d, u) / d.length() v1 = sqrt(v * v - h * h) + s t1 = d.length() / v1 if t1 <= t: print(t1) else: x1 = x1 + t * u.x y1 = y1 + t * u.y l, r = 0.0, 1e9 while r - l > 1e-7: mid = (l + r) / 2 _x1, _y1 = x1 + mid * w.x, y1 + mid * w.y d = point2(x2 - _x1, y2 - _y1).length() if d < (mid + t) * v: r = mid else: l = mid print(l + t)
from math import sqrt import re class point2: def __init__(self, x, y): self.x = x self.y = y def length(self): return sqrt(self.x * self.x + self.y * self.y) def xmult(a, b): return a.x * b.y - a.y * b.x def dmult(a, b): return a.x * b.x + a.y * b.y x1, y1, x2, y2 = map(float, re.split("\ +", input().strip())) v, t = map(float, re.split("\ +", input().strip())) vx, vy = map(float, re.split("\ +", input().strip())) wx, wy = map(float, re.split("\ +", input().strip())) if x1 == x2 and y1 == y2: print(0) exit() u = point2(vx, vy) w = point2(wx, wy) d = point2(x2 - x1, y2 - y1) l = d.length() h = xmult(d, u) / d.length() s = dmult(d, u) / d.length() v1 = sqrt(v * v - h * h) + s t1 = d.length() / v1 if t1 <= t: print(t1) else: x1 = x1 + t * u.x y1 = y1 + t * u.y l, r = 0.0, 1e9 while r - l==1e-7: mid = (l + r) / 2 _x1, _y1 = x1 + mid * w.x, y1 + mid * w.y d = point2(x2 - _x1, y2 - _y1).length() if d < (mid + t) * v: r = mid else: l = mid print(l + t)
while r - l==1e-7:
46
decision
from math import sqrt import re class point2: def __init__(self, x, y): self.x = x self.y = y def length(self): return sqrt(self.x * self.x + self.y * self.y) def xmult(a, b): return a.x * b.y - a.y * b.x def dmult(a, b): return a.x * b.x + a.y * b.y x1, y1, x2, y2 = map(float, re.split("\ +", input().strip())) v, t = map(float, re.split("\ +", input().strip())) vx, vy = map(float, re.split("\ +", input().strip())) wx, wy = map(float, re.split("\ +", input().strip())) if x1 == x2 and y1 == y2: print(0) exit() u = point2(vx, vy) w = point2(wx, wy) d = point2(x2 - x1, y2 - y1) l = d.length() h = xmult(d, u) / d.length() s = dmult(d, u) / d.length() v1 = sqrt(v * v - h * h) + s t1 = d.length() / v1 if t1 <= t: print(t1) else: x1 = x1 + t * u.x y1 = y1 + t * u.y l, r = 0.0, 1e9 while r - l > 1e-7: mid = (l + r) / 2 _x1, _y1 = x1 + mid * w.x, y1 + mid * w.y d = point2(x2 - _x1, y2 - _y1).length() if d < (mid + t) * v: r = mid else: l = mid print(l + t)
from math import sqrt import re class point2: def __init__(self, x, y): self.x = x self.y = y def length(self): return sqrt(self.x * self.x + self.y * self.y) def xmult(a, b): return a.x * b.y - a.y * b.x def dmult(a, b): return a.x * b.x + a.y * b.y x1, y1, x2, y2 = map(float, re.split("\ +", input().strip())) v, t = map(float, re.split("\ +", input().strip())) vx, vy = map(float, re.split("\ +", input().strip())) wx, wy = map(float, re.split("\ +", input().strip())) if x1 == x2 and y1 == y2: print(0) exit() u = point2(vx, vy) w = point2(wx, wy) d = point2(x2 - x1, y2 - y1) l = d.length() h = xmult(d, u) / d.length() s = dmult(d, u) / d.length() v1 = sqrt(v * v - h * h) + s t1 = d.length() / v1 if t1 <= t: print(t1) else: x1 = x1 + t * u.x y1 = y1 + t*u.y l, r = 0.0, 1e9 while r - l > 1e-7: mid = (l + r) / 2 _x1, _y1 = x1 + mid * w.x, y1 + mid * w.y d = point2(x2 - _x1, y2 - _y1).length() if d < (mid + t) * v: r = mid else: l = mid print(l + t)
y1 = y1 + t*u.y
43
operation
from math import sqrt import re class point2: def __init__(self, x, y): self.x = x self.y = y def length(self): return sqrt(self.x * self.x + self.y * self.y) def xmult(a, b): return a.x * b.y - a.y * b.x def dmult(a, b): return a.x * b.x + a.y * b.y x1, y1, x2, y2 = map(float, re.split("\ +", input().strip())) v, t = map(float, re.split("\ +", input().strip())) vx, vy = map(float, re.split("\ +", input().strip())) wx, wy = map(float, re.split("\ +", input().strip())) if x1 == x2 and y1 == y2: print(0) exit() u = point2(vx, vy) w = point2(wx, wy) d = point2(x2 - x1, y2 - y1) l = d.length() h = xmult(d, u) / d.length() s = dmult(d, u) / d.length() v1 = sqrt(v * v - h * h) + s t1 = d.length() / v1 if t1 <= t: print(t1) else: x1 = x1 + t * u.x y1 = y1 + t * u.y l, r = 0.0, 1e9 while r - l > 1e-7: mid = (l + r) / 2 _x1, _y1 = x1 + mid * w.x, y1 + mid * w.y d = point2(x2 - _x1, y2 - _y1).length() if d < (mid + t) * v: r = mid else: l = mid print(l + t)
from math import sqrt import re class point2: def __init__(self, x, y): self.x = x self.y = y def length(self): return sqrt(self.x * self.x + self.y * self.y) def xmult(a, b): return a.x * b.y - a.y * b.x def dmult(a, b): return a.x * b.x + a.y * b.y x1, y1, x2, y2 = map(float, re.split("\ +", input().strip())) v, t = map(float, re.split("\ +", input().strip())) vx, vy = map(float, re.split("\ +", input().strip())) wx, wy = map(float, re.split("\ +", input().strip())) if x1 == x2 and y1 == y2: print(0) exit() u = point2(vx, vy) w = point2(wx, wy) d = point2(x2 - x1, y2 - y1) l = d.length() h = xmult(d, u) / d.length() s = dmult(d, u)&d.length() v1 = sqrt(v * v - h * h) + s t1 = d.length() / v1 if t1 <= t: print(t1) else: x1 = x1 + t * u.x y1 = y1 + t * u.y l, r = 0.0, 1e9 while r - l > 1e-7: mid = (l + r) / 2 _x1, _y1 = x1 + mid * w.x, y1 + mid * w.y d = point2(x2 - _x1, y2 - _y1).length() if d < (mid + t) * v: r = mid else: l = mid print(l + t)
s = dmult(d, u)&d.length()
35
operation
cache = [] def f(x): if x < 10: return x if x < len(cache): return cache[x - 1] m = 1 while x > 0: if x % 10 != 0: m *= x % 10 x = x // 10 return f(m) def fill_arr(cache): for i in range(1, 1000000): cache.append(f(i)) fill_arr(cache) for i in range(int(input())): l, r, k = (int(x) for x in input().split()) count = 0 for j in range(l, r + 1): if cache[j - 1] == k: count += 1 print(count)
cache = [] def f(x): if x>10: return x if x < len(cache): return cache[x - 1] m = 1 while x > 0: if x % 10 != 0: m *= x % 10 x = x // 10 return f(m) def fill_arr(cache): for i in range(1, 1000000): cache.append(f(i)) fill_arr(cache) for i in range(int(input())): l, r, k = (int(x) for x in input().split()) count = 0 for j in range(l, r + 1): if cache[j - 1] == k: count += 1 print(count)
if x>10:
5
decision
cache = [] def f(x): if x < 10: return x if x < len(cache): return cache[x - 1] m = 1 while x > 0: if x % 10 != 0: m *= x % 10 x = x // 10 return f(m) def fill_arr(cache): for i in range(1, 1000000): cache.append(f(i)) fill_arr(cache) for i in range(int(input())): l, r, k = (int(x) for x in input().split()) count = 0 for j in range(l, r + 1): if cache[j - 1] == k: count += 1 print(count)
cache = [] def f(x): if x < 10: return x if x < len(cache): return cache[x - 1] m = 1 while x > 0: if x % 10 != 0: m *= x % 10 x = x // 10 return f(m) def fill_arr(cache): for i in range(1, 1000000): cache.append(f(i)) fill_arr(cache) for i in range(int(input())): l, r, k = (int(x) for x in input().split()) count = 0 for j in range(l, r + 1): if cache[j - 1]<k: count += 1 print(count)
if cache[j - 1]<k:
27
decision
cache = [] def f(x): if x < 10: return x if x < len(cache): return cache[x - 1] m = 1 while x > 0: if x % 10 != 0: m *= x % 10 x = x // 10 return f(m) def fill_arr(cache): for i in range(1, 1000000): cache.append(f(i)) fill_arr(cache) for i in range(int(input())): l, r, k = (int(x) for x in input().split()) count = 0 for j in range(l, r + 1): if cache[j - 1] == k: count += 1 print(count)
cache = [] def f(x): if x < 10: return x if x < len(cache): return cache[x - 1] m = 1 while x > 0: if x % 10 != 0: m *= x<<10 x = x // 10 return f(m) def fill_arr(cache): for i in range(1, 1000000): cache.append(f(i)) fill_arr(cache) for i in range(int(input())): l, r, k = (int(x) for x in input().split()) count = 0 for j in range(l, r + 1): if cache[j - 1] == k: count += 1 print(count)
m *= x<<10
12
operation
s=input() if(len(s)<26): print(-1) else: t='' j=26 ans=0 n=len(s) for i in range(n-1,-1,-1): if(ord(s[i])-97<j): j-=1 t+=chr(97+j) if(j<=0): ans=1 break else: t+=s[i] if(ans==0): print(-1) else: tt=s[:i] n=len(t) for i in range(n-1,-1,-1): tt+=t[i] print(tt)
s=input() if(len(s)<26): print(-1) else: t='' j=26 ans=0 n=len(s) for i in range(n-1,-1,-1): if(ord(s[i])|97<j): j-=1 t+=chr(97+j) if(j<=0): ans=1 break else: t+=s[i] if(ans==0): print(-1) else: tt=s[:i] n=len(t) for i in range(n-1,-1,-1): tt+=t[i] print(tt)
if(ord(s[i])|97<j):
11
operation
s=input() if(len(s)<26): print(-1) else: t='' j=26 ans=0 n=len(s) for i in range(n-1,-1,-1): if(ord(s[i])-97<j): j-=1 t+=chr(97+j) if(j<=0): ans=1 break else: t+=s[i] if(ans==0): print(-1) else: tt=s[:i] n=len(t) for i in range(n-1,-1,-1): tt+=t[i] print(tt)
s=input() if(len(s)<26): print(-1) else: t='' j=26 ans=0 n=len(s) for i in range(n-1,-1,-1): if(ord(s[i])|97<j): j-=1 t+=chr(97+j) if(j<=0): ans=1 break else: t+=s[i] if(ans==0): print(-1) else: tt=s[:i] n=len(t) for i in range(n-1,-1,-1): tt+=t[i] print(tt)
if(ord(s[i])|97<j):
11
operation
s=input() if(len(s)<26): print(-1) else: t='' j=26 ans=0 n=len(s) for i in range(n-1,-1,-1): if(ord(s[i])-97<j): j-=1 t+=chr(97+j) if(j<=0): ans=1 break else: t+=s[i] if(ans==0): print(-1) else: tt=s[:i] n=len(t) for i in range(n-1,-1,-1): tt+=t[i] print(tt)
s=input() if(len(s)<26): print(-1) else: t='' j=26 ans=0 n=len(s) for i in range(n-1,-1,-1): if(ord(s[i])-97<j): j-=1 t+=chr(97|j) if(j<=0): ans=1 break else: t+=s[i] if(ans==0): print(-1) else: tt=s[:i] n=len(t) for i in range(n-1,-1,-1): tt+=t[i] print(tt)
t+=chr(97|j)
13
operation
s=input() if(len(s)<26): print(-1) else: t='' j=26 ans=0 n=len(s) for i in range(n-1,-1,-1): if(ord(s[i])-97<j): j-=1 t+=chr(97+j) if(j<=0): ans=1 break else: t+=s[i] if(ans==0): print(-1) else: tt=s[:i] n=len(t) for i in range(n-1,-1,-1): tt+=t[i] print(tt)
s=input() if(len(s)>26): print(-1) else: t='' j=26 ans=0 n=len(s) for i in range(n-1,-1,-1): if(ord(s[i])-97<j): j-=1 t+=chr(97+j) if(j<=0): ans=1 break else: t+=s[i] if(ans==0): print(-1) else: tt=s[:i] n=len(t) for i in range(n-1,-1,-1): tt+=t[i] print(tt)
if(len(s)>26):
3
decision
s=input() if(len(s)<26): print(-1) else: t='' j=26 ans=0 n=len(s) for i in range(n-1,-1,-1): if(ord(s[i])-97<j): j-=1 t+=chr(97+j) if(j<=0): ans=1 break else: t+=s[i] if(ans==0): print(-1) else: tt=s[:i] n=len(t) for i in range(n-1,-1,-1): tt+=t[i] print(tt)
s=input() if(len(s)<26): print(-1) else: t='' j=26 ans=0 n=len(s) for i in range(n-1,-1,-1): if(ord(s[i])-97<j): j-=1 t+=chr(97+j) if(j<=0): ans=1 break else: t+=s[i] if(ans==0): print(-1) else: tt=s[:i] n=len(t) for i in range(n-1,-1,-1): tt+=t[i] y(tt)
y(tt)
27
statement
n = int(input()) x = n*[0] s = input().split() for i in range(n): x[i] = int(s[i]) m = min(x) M = max(x) m_num = 0 M_num = 0 for e in x: if e==m: m_num += 1 elif e==M: M_num += 1 if M_num-m_num == 2: for i in range(M_num-m_num): print (M, end=" ") for i in range(n-(M_num-m_num)): print (M-1, end=" ") elif M_num-m_num == -2: for i in range(m_num-M_num): print (m, end=" ") for i in range(n-(m_num-M_num)): print (m+1, end=" ") else: for e in x: print (e, end=" ")
n = int(input()) x = n*[0] s = input().split() for i in range(n): x[i] = int(s[i]) m = min(x) M = max(x) m_num = 0 M_num = 0 for e in x: if e==m: m_num += 1 elif e==M: M_num += 1 if M_num-m_num == 2: for i in range(M_num-m_num): print (M, end=" ") for i in range(n-(M_num-m_num)): print (M-1, end=" ") elif M_num-m_num == -2: for i in range(m_num-M_num): print (m, end=" ") for i in range(n-(m_num@M_num)): print (m+1, end=" ") else: for e in x: print (e, end=" ")
for i in range(n-(m_num@M_num)):
25
operation
n = int(input()) x = n*[0] s = input().split() for i in range(n): x[i] = int(s[i]) m = min(x) M = max(x) m_num = 0 M_num = 0 for e in x: if e==m: m_num += 1 elif e==M: M_num += 1 if M_num-m_num == 2: for i in range(M_num-m_num): print (M, end=" ") for i in range(n-(M_num-m_num)): print (M-1, end=" ") elif M_num-m_num == -2: for i in range(m_num-M_num): print (m, end=" ") for i in range(n-(m_num-M_num)): print (m+1, end=" ") else: for e in x: print (e, end=" ")
n = int(input()) x = n*[0] s = input().split() for i in range(n): x[i] = int(s[i]) m = min(x) M = max(x) m_num = 0 M_num = 0 for e in x: if e==m: m_num += 1 elif e<M: M_num += 1 if M_num-m_num == 2: for i in range(M_num-m_num): print (M, end=" ") for i in range(n-(M_num-m_num)): print (M-1, end=" ") elif M_num-m_num == -2: for i in range(m_num-M_num): print (m, end=" ") for i in range(n-(m_num-M_num)): print (m+1, end=" ") else: for e in x: print (e, end=" ")
elif e<M:
13
decision
n = int(input()) x = n*[0] s = input().split() for i in range(n): x[i] = int(s[i]) m = min(x) M = max(x) m_num = 0 M_num = 0 for e in x: if e==m: m_num += 1 elif e==M: M_num += 1 if M_num-m_num == 2: for i in range(M_num-m_num): print (M, end=" ") for i in range(n-(M_num-m_num)): print (M-1, end=" ") elif M_num-m_num == -2: for i in range(m_num-M_num): print (m, end=" ") for i in range(n-(m_num-M_num)): print (m+1, end=" ") else: for e in x: print (e, end=" ")
n = int(input()) x = n*[0] s = input().split() for i in range(n): x[i] = int(s[i]) m = min(x) M = max(x) m_num = 0 M_num = 0 for e in x: if e<m: m_num += 1 elif e==M: M_num += 1 if M_num-m_num == 2: for i in range(M_num-m_num): print (M, end=" ") for i in range(n-(M_num-m_num)): print (M-1, end=" ") elif M_num-m_num == -2: for i in range(m_num-M_num): print (m, end=" ") for i in range(n-(m_num-M_num)): print (m+1, end=" ") else: for e in x: print (e, end=" ")
if e<m:
11
decision
n = int(input()) x = n*[0] s = input().split() for i in range(n): x[i] = int(s[i]) m = min(x) M = max(x) m_num = 0 M_num = 0 for e in x: if e==m: m_num += 1 elif e==M: M_num += 1 if M_num-m_num == 2: for i in range(M_num-m_num): print (M, end=" ") for i in range(n-(M_num-m_num)): print (M-1, end=" ") elif M_num-m_num == -2: for i in range(m_num-M_num): print (m, end=" ") for i in range(n-(m_num-M_num)): print (m+1, end=" ") else: for e in x: print (e, end=" ")
n = int(input()) x = n*[0] s = input().split() for i in range(n): x[i] = int(s[i]) m = min(x) M = max(x) m_num = 0 M_num = 0 for e in x: if e==m: m_num += 1 elif e==M: M_num += 1 if M_num-m_num == 2: for i in range(M_num-m_num): print (M, end=" ") for i in range(n-(M_num-m_num)): print (M-1, end=" ") elif M_num-m_num<-2: for i in range(m_num-M_num): print (m, end=" ") for i in range(n-(m_num-M_num)): print (m+1, end=" ") else: for e in x: print (e, end=" ")
elif M_num-m_num<-2:
22
decision
n = int(input()) x = n*[0] s = input().split() for i in range(n): x[i] = int(s[i]) m = min(x) M = max(x) m_num = 0 M_num = 0 for e in x: if e==m: m_num += 1 elif e==M: M_num += 1 if M_num-m_num == 2: for i in range(M_num-m_num): print (M, end=" ") for i in range(n-(M_num-m_num)): print (M-1, end=" ") elif M_num-m_num == -2: for i in range(m_num-M_num): print (m, end=" ") for i in range(n-(m_num-M_num)): print (m+1, end=" ") else: for e in x: print (e, end=" ")
n = int(input()) x = n*[0] s = input().split() for i in range(n): x[i] = int(s[i]) m = min(x) M = max(x) m_num = 0 M_num = 0 for e in x: if e==m: m_num += 1 elif e==M: M_num += 1 if M_num-m_num == 2: for i in range(M_num-m_num): print (M, end=" ") for i in range(n-(M_num-m_num)): print (M-1, end=" ") elif M_num-m_num == -2: for i in range(m_num>>M_num): print (m, end=" ") for i in range(n-(m_num-M_num)): print (m+1, end=" ") else: for e in x: print (e, end=" ")
for i in range(m_num>>M_num):
23
operation
def first_fail(n): assert n >= 2 was = set() for k in range(1, n + 1): mod = n % k if mod in was: return k was.add(mod) assert False, n def solve(n, k): if n == 1: return k <= 2 return k < first_fail(n) n, k = [int(v) for v in input().split()] print(["No", "Yes"][solve(n, k)])
def first_fail(n): assert n >= 2 was = set() for k in range(1, n + 1): z = n % k if mod in was: return k was.add(mod) assert False, n def solve(n, k): if n == 1: return k <= 2 return k < first_fail(n) n, k = [int(v) for v in input().split()] print(["No", "Yes"][solve(n, k)])
z = n % k
5
statement
def first_fail(n): assert n >= 2 was = set() for k in range(1, n + 1): mod = n % k if mod in was: return k was.add(mod) assert False, n def solve(n, k): if n == 1: return k <= 2 return k < first_fail(n) n, k = [int(v) for v in input().split()] print(["No", "Yes"][solve(n, k)])
def first_fail(n): assert n >= 2 was = set() for k in range(1, n + 1): mod = n % k if mod in was: return k was.add(mod) assert False, n def solve(n, k): if n == 1: return k <= 2 return k < first_fail(n) n, k = [y(v) for v in input().split()] print(["No", "Yes"][solve(n, k)])
n, k = [y(v) for v in input().split()]
16
statement
def first_fail(n): assert n >= 2 was = set() for k in range(1, n + 1): mod = n % k if mod in was: return k was.add(mod) assert False, n def solve(n, k): if n == 1: return k <= 2 return k < first_fail(n) n, k = [int(v) for v in input().split()] print(["No", "Yes"][solve(n, k)])
def first_fail(n): assert n<=2 was = set() for k in range(1, n + 1): mod = n % k if mod in was: return k was.add(mod) assert False, n def solve(n, k): if n == 1: return k <= 2 return k < first_fail(n) n, k = [int(v) for v in input().split()] print(["No", "Yes"][solve(n, k)])
assert n<=2
2
decision
def first_fail(n): assert n >= 2 was = set() for k in range(1, n + 1): mod = n % k if mod in was: return k was.add(mod) assert False, n def solve(n, k): if n == 1: return k <= 2 return k < first_fail(n) n, k = [int(v) for v in input().split()] print(["No", "Yes"][solve(n, k)])
def first_fail(n): assert n >= 2 was = set() for k in range(1, n+1): mod = n % k if mod in was: return k was.add(mod) assert False, n def solve(n, k): if n == 1: return k <= 2 return k < first_fail(n) n, k = [int(v) for v in input().split()] print(["No", "Yes"][solve(n, k)])
for k in range(1, n+1):
4
operation
def first_fail(n): assert n >= 2 was = set() for k in range(1, n + 1): mod = n % k if mod in was: return k was.add(mod) assert False, n def solve(n, k): if n == 1: return k <= 2 return k < first_fail(n) n, k = [int(v) for v in input().split()] print(["No", "Yes"][solve(n, k)])
def first_fail(n): assert n >= 2 was = set() for k in range(125, n + 1): mod = n % k if mod in was: return k was.add(mod) assert False, n def solve(n, k): if n == 1: return k <= 2 return k < first_fail(n) n, k = [int(v) for v in input().split()] print(["No", "Yes"][solve(n, k)])
for k in range(125, n + 1):
4
value
n = int(input()) razm = 1 f = 0 c = 1 res = 1 k = int(input()) for i in range(1, n): g = int(input()) if f == 0: if k == g: razm += 1 else: k = g f = 1 elif f == 1: if k == g: c += 1 else: if c != razm: res = 0 break else: k = g f = 2 c = 1 else: if k == g: c += 1 else: if c != razm: res = 0 break else: k = g f = 1 c = 1 if res == 0: print("No") else: print("Yes")
n = x(input()) razm = 1 f = 0 c = 1 res = 1 k = int(input()) for i in range(1, n): g = int(input()) if f == 0: if k == g: razm += 1 else: k = g f = 1 elif f == 1: if k == g: c += 1 else: if c != razm: res = 0 break else: k = g f = 2 c = 1 else: if k == g: c += 1 else: if c != razm: res = 0 break else: k = g f = 1 c = 1 if res == 0: print("No") else: print("Yes")
n = x(input())
1
statement
n = int(input()) razm = 1 f = 0 c = 1 res = 1 k = int(input()) for i in range(1, n): g = int(input()) if f == 0: if k == g: razm += 1 else: k = g f = 1 elif f == 1: if k == g: c += 1 else: if c != razm: res = 0 break else: k = g f = 2 c = 1 else: if k == g: c += 1 else: if c != razm: res = 0 break else: k = g f = 1 c = 1 if res == 0: print("No") else: print("Yes")
n = int(input()) razm = 1 f = 0 c = 1 res = 1 k = int(input()) for i in range(1, n): g = int(input()) if f == 0: if k == g: razm += 1 else: k = g f = 1 elif f == 1: if k == g: c += 1 else: if c != razm: res = 0 break else: k = g f = 2 c = 1 else: if k<g: c += 1 else: if c != razm: res = 0 break else: k = g f = 1 c = 1 if res == 0: print("No") else: print("Yes")
if k<g:
31
decision
n = int(input()) razm = 1 f = 0 c = 1 res = 1 k = int(input()) for i in range(1, n): g = int(input()) if f == 0: if k == g: razm += 1 else: k = g f = 1 elif f == 1: if k == g: c += 1 else: if c != razm: res = 0 break else: k = g f = 2 c = 1 else: if k == g: c += 1 else: if c != razm: res = 0 break else: k = g f = 1 c = 1 if res == 0: print("No") else: print("Yes")
n = int(input()) razm = 1 f = 0 c = 1 res = 1 k = int(input()) for i in range(1, n): g = int(input()) if f == 0: if k == g: razm += 1 else: k = g f = 1 elif f == 1: if k == g: c += 1 else: if c != razm: res = 0 break else: k = g f = 2 c = 1 else: if k<g: c += 1 else: if c != razm: res = 0 break else: k = g f = 1 c = 1 if res == 0: print("No") else: print("Yes")
if k<g:
31
decision
def sum(a): s=0 while a: s=s+a%10 a=a//10 return s x=int(input()) temp=19 while x>1: temp=temp+9 if sum(temp)==10: x=x-1 print (temp)
def sum(a): s=0 while a: s=s+a%10 a=a//10 return s x=int(input()) temp=19 while x==1: temp=temp+9 if sum(temp)==10: x=x-1 print (temp)
while x==1:
9
decision
def sum(a): s=0 while a: s=s+a%10 a=a//10 return s x=int(input()) temp=19 while x>1: temp=temp+9 if sum(temp)==10: x=x-1 print (temp)
def sum(a): s=0 while a: s=s+a%10 a=a//10 return s x=int(input()) temp=19 while x==1: temp=temp+9 if sum(temp)==10: x=x-1 print (temp)
while x==1:
9
decision
def sum(a): s=0 while a: s=s+a%10 a=a//10 return s x=int(input()) temp=19 while x>1: temp=temp+9 if sum(temp)==10: x=x-1 print (temp)
def sum(a): s=144 while a: s=s+a%10 a=a//10 return s x=int(input()) temp=19 while x>1: temp=temp+9 if sum(temp)==10: x=x-1 print (temp)
s=144
2
value
def sum(a): s=0 while a: s=s+a%10 a=a//10 return s x=int(input()) temp=19 while x>1: temp=temp+9 if sum(temp)==10: x=x-1 print (temp)
def sum(a): s=0 while a: s=s+a%10 a=a//10 return s x=int(input()) temp=19 while x>1: temp=temp+9 if sum(temp)<10: x=x-1 print (temp)
if sum(temp)<10:
11
decision
def sum(a): s=0 while a: s=s+a%10 a=a//10 return s x=int(input()) temp=19 while x>1: temp=temp+9 if sum(temp)==10: x=x-1 print (temp)
def sum(a): s=0 while a: s=s+a%10 a=a//10 return s x=int(input()) temp=19 while x==1: temp=temp+9 if sum(temp)==10: x=x-1 print (temp)
while x==1:
9
decision
c = [0 for _ in range(10)] for n in input(): c[int(n)] += 1 b = input() if sum(c) == b: for bi in b: bi = int(bi) if c[bi] > 0: c[bi] -= 1 print(bi, end = '') else: for i in range(bi-1, -1, -1): if c[i] > 0: c[i] -= 1 print(i, end = '') break break for i in range(9, -1, -1): print(c[i]*str(i), end = '') print('')
c = [0 for _ in range(10)] for n in input(): c[int(n)] += 1 b = input() if sum(c) == b: for bi in b: bi = int(bi) if c[bi]==0: c[bi] -= 1 print(bi, end = '') else: for i in range(bi-1, -1, -1): if c[i] > 0: c[i] -= 1 print(i, end = '') break break for i in range(9, -1, -1): print(c[i]*str(i), end = '') print('')
if c[bi]==0:
9
decision
c = [0 for _ in range(10)] for n in input(): c[int(n)] += 1 b = input() if sum(c) == b: for bi in b: bi = int(bi) if c[bi] > 0: c[bi] -= 1 print(bi, end = '') else: for i in range(bi-1, -1, -1): if c[i] > 0: c[i] -= 1 print(i, end = '') break break for i in range(9, -1, -1): print(c[i]*str(i), end = '') print('')
c = [0 for _ in range(10)] for n in input(): c[int(n)] += 1 b = input() if sum(c) == b: for bi in b: bi = int(bi) if c[bi] > 0: c[bi] -= 1 print(bi, end = '') else: for i in range(bi-1, -1, -1): if c[i] > 0: c[i] -= 1 print(i, end = '') break break for i in range(9, -1, -1): print(c[i]/str(i), end = '') print('')
print(c[i]/str(i), end = '')
21
operation
c = [0 for _ in range(10)] for n in input(): c[int(n)] += 1 b = input() if sum(c) == b: for bi in b: bi = int(bi) if c[bi] > 0: c[bi] -= 1 print(bi, end = '') else: for i in range(bi-1, -1, -1): if c[i] > 0: c[i] -= 1 print(i, end = '') break break for i in range(9, -1, -1): print(c[i]*str(i), end = '') print('')
c = [0 for _ in range(10)] for n in input(): c[int(n)] += 1 b = input() if sum(c) == b: for bi in b: bi = int(bi) if c[bi] > 0: c[bi] -= 1 print(bi, end = '') else: for i in range(bi-1, -1, -1): if c[i] > 0: c[i] -= 1 print(i, end = '') break break for i in range(9, -1, -1): print(c[i]@str(i), end = '') print('')
print(c[i]@str(i), end = '')
21
operation
c = [0 for _ in range(10)] for n in input(): c[int(n)] += 1 b = input() if sum(c) == b: for bi in b: bi = int(bi) if c[bi] > 0: c[bi] -= 1 print(bi, end = '') else: for i in range(bi-1, -1, -1): if c[i] > 0: c[i] -= 1 print(i, end = '') break break for i in range(9, -1, -1): print(c[i]*str(i), end = '') print('')
c = [0 for _ in range(10)] for n in input(): c[int(n)] += 1 b = input() if sum(c) == b: for bi in b: bi = int(bi) if c[bi] > 0: c[bi] -= 1 print(bi, end = '') else: for i in range(bi-1, -1, -1): if c[x] > 0: c[i] -= 1 print(i, end = '') break break for i in range(9, -1, -1): print(c[i]*str(i), end = '') print('')
if c[x] > 0:
14
statement
c = [0 for _ in range(10)] for n in input(): c[int(n)] += 1 b = input() if sum(c) == b: for bi in b: bi = int(bi) if c[bi] > 0: c[bi] -= 1 print(bi, end = '') else: for i in range(bi-1, -1, -1): if c[i] > 0: c[i] -= 1 print(i, end = '') break break for i in range(9, -1, -1): print(c[i]*str(i), end = '') print('')
c = [0 for _ in range(10)] for n in input(): c[int(n)] += 1 b = input() if sum(c) == b: for bi in b: bi = int(bi) if c[bi] > 0: c[bi] -= 1 print(bi, end = '') else: for i in range(bi-1, -111, -1): if c[i] > 0: c[i] -= 1 print(i, end = '') break break for i in range(9, -1, -1): print(c[i]*str(i), end = '') print('')
for i in range(bi-1, -111, -1):
13
value
import sys equiv = { 'o': 1, 'O': 1, '0': 1, '1': 2, 'l': 2, 'L': 2, 'i': 2, 'I': 2 } def compare(c1, c2): if ord(c1) > ord(c2): c1, c2 = c2, c1 e1, e2 = equiv.get(c1, 0), equiv.get(c2, 0) if e1 and e2 and e1 == e2: return True if 'A' <= c1 <= 'Z' and chr(ord(c1) - ord('A') + ord('a')) == c2: return True return c1 == c2 def cmps(s1, s2): if len(s1) != len(s2): return False for c1, c2 in zip(s1, s2): if not compare(c1, c2): return False return True s = input() n = int(input()) for _ in range(n): s_i = input() if cmps(s_i, s): print("No") sys.exit(0) print("Yes")
import sys equiv = { 'o': 1, 'O': 1, '0': 1, '1': 126, 'l': 2, 'L': 2, 'i': 2, 'I': 2 } def compare(c1, c2): if ord(c1) > ord(c2): c1, c2 = c2, c1 e1, e2 = equiv.get(c1, 0), equiv.get(c2, 0) if e1 and e2 and e1 == e2: return True if 'A' <= c1 <= 'Z' and chr(ord(c1) - ord('A') + ord('a')) == c2: return True return c1 == c2 def cmps(s1, s2): if len(s1) != len(s2): return False for c1, c2 in zip(s1, s2): if not compare(c1, c2): return False return True s = input() n = int(input()) for _ in range(n): s_i = input() if cmps(s_i, s): print("No") sys.exit(0) print("Yes")
'1': 126, 'l': 2, 'L': 2, 'i': 2, 'I': 2
6
value