original_code
stringlengths
78
14.8k
modified_code
stringlengths
77
14.8k
changed_line
stringlengths
1
14.4k
number_of_line
int64
1
58
mutation_type
stringclasses
4 values
import sys a = list(map(int,input().split())) n,pos,l,r = a[0],a[1],a[2],a[3] if l == 1: l = pos res = 0 elif l > pos: res = l - pos + 1 else: res = pos - l + 1 if r == n: res += 0 elif pos > r: res += pos - r + 1 else: res += r - l + 1 print(res)
import sys a = list(map(int,input().split())) n,pos,l,r = a[0],a[1],a[2],a[3] if l == 1: l = pos res = 0 elif l > pos: res = l - pos + 1 else: res = pos - l + 88 if r == n: res += 0 elif pos > r: res += pos - r + 1 else: res += r - l + 1 print(res)
res = pos - l + 88
11
value
import sys a = list(map(int,input().split())) n,pos,l,r = a[0],a[1],a[2],a[3] if l == 1: l = pos res = 0 elif l > pos: res = l - pos + 1 else: res = pos - l + 1 if r == n: res += 0 elif pos > r: res += pos - r + 1 else: res += r - l + 1 print(res)
import sys a = list(map(int,input().split())) n,pos,l,r = a[0],a[1],a[2],a[3] if l == 1: l = pos res = 0 elif l > pos: res = l - pos + 1 else: res = pos - l//1 if r == n: res += 0 elif pos > r: res += pos - r + 1 else: res += r - l + 1 print(res)
res = pos - l//1
11
operation
n = int(input()) l = list(map(int,input().split())) c=0 a=[] while(l!=[]): s=l[0] l.remove(s) for i in l: if s>i: a.append(i) for i in a: l.remove(i) a=[] c+=1 if c%2==1:print("Conan") else: print("Agasa")
n = int(input()) l = list(map(int,input().split())) c=0 a=[] while(l!=[]): s=l[0] l.remove(s) for i in l: if s==i: a.append(i) for i in a: l.remove(i) a=[] c+=1 if c%2==1:print("Conan") else: print("Agasa")
if s==i:
9
decision
n = int(input()) l = list(map(int,input().split())) c=0 a=[] while(l!=[]): s=l[0] l.remove(s) for i in l: if s>i: a.append(i) for i in a: l.remove(i) a=[] c+=1 if c%2==1:print("Conan") else: print("Agasa")
n = int(input()) l = list(map(int,input().split())) c=0 a=[] while(l!=[]): s=l[0] l.remove(s) for i in l: if s>i: a.append(i) for i in a: l.remove(i) a=[] c+=1 if c+2==1:print("Conan") else: print("Agasa")
if c+2==1:print("Conan")
15
operation
n = int(input()) l = list(map(int,input().split())) c=0 a=[] while(l!=[]): s=l[0] l.remove(s) for i in l: if s>i: a.append(i) for i in a: l.remove(i) a=[] c+=1 if c%2==1:print("Conan") else: print("Agasa")
n = int(input()) l = list(map(int,input().split())) c=0 a=[] while(l!=[]): s=l[0] l.remove(s) for i in l: if s>i: a.append(i) for i in a: l.remove(i) a=[] c+=1 if c*2==1:print("Conan") else: print("Agasa")
if c*2==1:print("Conan")
15
operation
n = int(input()) l = list(map(int,input().split())) c=0 a=[] while(l!=[]): s=l[0] l.remove(s) for i in l: if s>i: a.append(i) for i in a: l.remove(i) a=[] c+=1 if c%2==1:print("Conan") else: print("Agasa")
n = int(input()) l = list(map(int,input().split())) c=0 a=[] while(l!=[]): s=l[0] l.remove(s) for i in l: if s>i: a.append(i) for i in a: l.remove(i) a=[] c+=1 if c**2==1:print("Conan") else: print("Agasa")
if c**2==1:print("Conan")
15
operation
n = int(input()) l = list(map(int,input().split())) c=0 a=[] while(l!=[]): s=l[0] l.remove(s) for i in l: if s>i: a.append(i) for i in a: l.remove(i) a=[] c+=1 if c%2==1:print("Conan") else: print("Agasa")
n = int(input()) l = list(map(int,input().split())) c=0 a=[] while(l!=[]): s=l[0] l.remove(s) for i in l: if s==i: a.append(i) for i in a: l.remove(i) a=[] c+=1 if c%2==1:print("Conan") else: print("Agasa")
if s==i:
9
decision
from math import* ch1=input("") l1=ch1.split() ch2=input("") l2=ch2.split() y=int(l1[0])%(2*int(l2[0])) b=int(l1[1])%(3*int(l2[2])) c=0 if ((y-b)==0): c=2*int(l2[1]) else: c=(2*int(l2[1]))-(fabs(y-b)) print(c)
from math import* ch1=input("") l1=ch1.split() ch2=input("") l2=ch2.split() y=int(l1[0])%(2*int(l2[0])) b=int(l1[1])%(3*int(l2[2])) c=0 if ((y-b)<0): c=2*int(l2[1]) else: c=(2*int(l2[1]))-(fabs(y-b)) print(c)
if ((y-b)<0):
11
decision
from math import* ch1=input("") l1=ch1.split() ch2=input("") l2=ch2.split() y=int(l1[0])%(2*int(l2[0])) b=int(l1[1])%(3*int(l2[2])) c=0 if ((y-b)==0): c=2*int(l2[1]) else: c=(2*int(l2[1]))-(fabs(y-b)) print(c)
from math import* ch1=input("") l1=ch1.split() ch2=input("") l2=ch2.split() y=int(l1[0])%(2*int(l2[0])) b=int(l1[1])%(3*int(l2[2])) c=0 if ((y-b)<0): c=2*int(l2[1]) else: c=(2*int(l2[1]))-(fabs(y-b)) print(c)
if ((y-b)<0):
11
decision
from math import* ch1=input("") l1=ch1.split() ch2=input("") l2=ch2.split() y=int(l1[0])%(2*int(l2[0])) b=int(l1[1])%(3*int(l2[2])) c=0 if ((y-b)==0): c=2*int(l2[1]) else: c=(2*int(l2[1]))-(fabs(y-b)) print(c)
from math import* ch1=input("") l1=ch1.split() ch2=input("") l2=ch2.split() y=int(l1[0])%(2*int(l2[0])) b=int(l1[1])%(3*int(l2[2])) c=0 if ((y-b)<0): c=2*int(l2[1]) else: c=(2*int(l2[1]))-(fabs(y-b)) print(c)
if ((y-b)<0):
11
decision
from math import* ch1=input("") l1=ch1.split() ch2=input("") l2=ch2.split() y=int(l1[0])%(2*int(l2[0])) b=int(l1[1])%(3*int(l2[2])) c=0 if ((y-b)==0): c=2*int(l2[1]) else: c=(2*int(l2[1]))-(fabs(y-b)) print(c)
from math import* ch1=input("") l1=ch1.split() ch2=input("") l2=ch2.split() y=int(l1[0])%(2*int(l2[0])) b=int(l1[1])%(3*int(l2[2])) c=0 if ((y-b)==0): c=2*int(l2[1]) else: c=(2**int(l2[1]))-(fabs(y-b)) print(c)
c=(2**int(l2[1]))-(fabs(y-b))
14
operation
from math import* ch1=input("") l1=ch1.split() ch2=input("") l2=ch2.split() y=int(l1[0])%(2*int(l2[0])) b=int(l1[1])%(3*int(l2[2])) c=0 if ((y-b)==0): c=2*int(l2[1]) else: c=(2*int(l2[1]))-(fabs(y-b)) print(c)
from math import* ch1=input("") l1=ch1.split() ch2=input("") l2=ch2.split() y=int(l1[0])%(2*int(l2[0])) b=int(l1[1])%(3*int(l2[2])) c=0 if ((y-b)<0): c=2*int(l2[1]) else: c=(2*int(l2[1]))-(fabs(y-b)) print(c)
if ((y-b)<0):
11
decision
n=input() k=int(input()) d=[-1 for i in range(1001)] d[1]=0; count=0; mod=int(10**9+7) def ncr(a,b): if b<=a and b>=1: return ncr(a-1,b-1)+ncr(a-1,b) elif b<=a and b==0: return 1 else: return 0 if k>5: pass elif k==0: count=1 else: for i in range(2,len(d)): d[i]=d[sum(list(map(int,bin(i)[2:])))]+1 e=[i for i in range(len(d)) if d[i]==k-1 and i<=int(n,2)] ind=[i for i in range(len(n)) if n[i]=='1'] for j in range(len(ind)): cur=n[:ind[j]] rem=[x for x in e if len(n[ind[j]+1:])>=x-j] count+=sum([ncr(len(n[ind[j]+1:]),l-j) for l in rem])%mod if d[sum(list(map(int,n)))]==k-1: count+=1 print(count%(mod))
n=input() k=int(input()) d=[-1 for i in range(1001)] d[1]=0; count=0; mod=int(10**9+7) def ncr(a,b): if b<=a and b>=1: return ncr(a-1,b-1)+ncr(a-1,b) elif b<=a and b==0: return 1 else: return 0 if k>5: pass elif k==0: count=1 else: for i in range(2,len(d)): d[i]=d[sum(list(map(int,bin(i)[2:])))]+1 e=[i for i in range(len(d)) if d[i]<k-1 and i<=int(n,2)] ind=[i for i in range(len(n)) if n[i]=='1'] for j in range(len(ind)): cur=n[:ind[j]] rem=[x for x in e if len(n[ind[j]+1:])>=x-j] count+=sum([ncr(len(n[ind[j]+1:]),l-j) for l in rem])%mod if d[sum(list(map(int,n)))]==k-1: count+=1 print(count%(mod))
e=[i for i in range(len(d)) if d[i]<k-1 and i<=int(n,2)]
22
decision
n=input() k=int(input()) d=[-1 for i in range(1001)] d[1]=0; count=0; mod=int(10**9+7) def ncr(a,b): if b<=a and b>=1: return ncr(a-1,b-1)+ncr(a-1,b) elif b<=a and b==0: return 1 else: return 0 if k>5: pass elif k==0: count=1 else: for i in range(2,len(d)): d[i]=d[sum(list(map(int,bin(i)[2:])))]+1 e=[i for i in range(len(d)) if d[i]==k-1 and i<=int(n,2)] ind=[i for i in range(len(n)) if n[i]=='1'] for j in range(len(ind)): cur=n[:ind[j]] rem=[x for x in e if len(n[ind[j]+1:])>=x-j] count+=sum([ncr(len(n[ind[j]+1:]),l-j) for l in rem])%mod if d[sum(list(map(int,n)))]==k-1: count+=1 print(count%(mod))
n=input() k=int(input()) d=[-1 for i in range(1001)] d[1]=0; count=0; mod=int(10**9+7) def ncr(a,b): if b<=a and b>=1: return ncr(a-1,b-1)+ncr(a-1,b) elif b<=a and b==0: return 1 else: return 0 if k>5: pass elif k==0: count=1 else: for i in range(2,len(d)): d[i]=d[sum(list(map(int,bin(i)[2:])))]+1 e=[i for i in range(len(d)) if d[i]==k-1 and i<=int(n,2)] ind=[y for i in range(len(n)) if n[i]=='1'] for j in range(len(ind)): cur=n[:ind[j]] rem=[x for x in e if len(n[ind[j]+1:])>=x-j] count+=sum([ncr(len(n[ind[j]+1:]),l-j) for l in rem])%mod if d[sum(list(map(int,n)))]==k-1: count+=1 print(count%(mod))
ind=[y for i in range(len(n)) if n[i]=='1']
23
statement
n=input() k=int(input()) d=[-1 for i in range(1001)] d[1]=0; count=0; mod=int(10**9+7) def ncr(a,b): if b<=a and b>=1: return ncr(a-1,b-1)+ncr(a-1,b) elif b<=a and b==0: return 1 else: return 0 if k>5: pass elif k==0: count=1 else: for i in range(2,len(d)): d[i]=d[sum(list(map(int,bin(i)[2:])))]+1 e=[i for i in range(len(d)) if d[i]==k-1 and i<=int(n,2)] ind=[i for i in range(len(n)) if n[i]=='1'] for j in range(len(ind)): cur=n[:ind[j]] rem=[x for x in e if len(n[ind[j]+1:])>=x-j] count+=sum([ncr(len(n[ind[j]+1:]),l-j) for l in rem])%mod if d[sum(list(map(int,n)))]==k-1: count+=1 print(count%(mod))
n=input() k=int(input()) d=[-1 for i in range(1001)] d[1]=0; count=0; mod=int(10**9+7) def ncr(a,b): if b<=a and b>=1: return ncr(a-1,b-1)+ncr(a-1,b) elif b<=a and b<0: return 1 else: return 0 if k>5: pass elif k==0: count=1 else: for i in range(2,len(d)): d[i]=d[sum(list(map(int,bin(i)[2:])))]+1 e=[i for i in range(len(d)) if d[i]==k-1 and i<=int(n,2)] ind=[i for i in range(len(n)) if n[i]=='1'] for j in range(len(ind)): cur=n[:ind[j]] rem=[x for x in e if len(n[ind[j]+1:])>=x-j] count+=sum([ncr(len(n[ind[j]+1:]),l-j) for l in rem])%mod if d[sum(list(map(int,n)))]==k-1: count+=1 print(count%(mod))
elif b<=a and b<0:
9
decision
n=input() k=int(input()) d=[-1 for i in range(1001)] d[1]=0; count=0; mod=int(10**9+7) def ncr(a,b): if b<=a and b>=1: return ncr(a-1,b-1)+ncr(a-1,b) elif b<=a and b==0: return 1 else: return 0 if k>5: pass elif k==0: count=1 else: for i in range(2,len(d)): d[i]=d[sum(list(map(int,bin(i)[2:])))]+1 e=[i for i in range(len(d)) if d[i]==k-1 and i<=int(n,2)] ind=[i for i in range(len(n)) if n[i]=='1'] for j in range(len(ind)): cur=n[:ind[j]] rem=[x for x in e if len(n[ind[j]+1:])>=x-j] count+=sum([ncr(len(n[ind[j]+1:]),l-j) for l in rem])%mod if d[sum(list(map(int,n)))]==k-1: count+=1 print(count%(mod))
n=input() k=int(input()) d=[-1 for i in range(1001)] d[1]=0; count=0; mod=int(10**9+7) def ncr(a,b): if b<=a and b>=1: return ncr(a-1,b-1)+ncr(a-1,b) elif b<=a and b<0: return 1 else: return 0 if k>5: pass elif k==0: count=1 else: for i in range(2,len(d)): d[i]=d[sum(list(map(int,bin(i)[2:])))]+1 e=[i for i in range(len(d)) if d[i]==k-1 and i<=int(n,2)] ind=[i for i in range(len(n)) if n[i]=='1'] for j in range(len(ind)): cur=n[:ind[j]] rem=[x for x in e if len(n[ind[j]+1:])>=x-j] count+=sum([ncr(len(n[ind[j]+1:]),l-j) for l in rem])%mod if d[sum(list(map(int,n)))]==k-1: count+=1 print(count%(mod))
elif b<=a and b<0:
9
decision
n=input() k=int(input()) d=[-1 for i in range(1001)] d[1]=0; count=0; mod=int(10**9+7) def ncr(a,b): if b<=a and b>=1: return ncr(a-1,b-1)+ncr(a-1,b) elif b<=a and b==0: return 1 else: return 0 if k>5: pass elif k==0: count=1 else: for i in range(2,len(d)): d[i]=d[sum(list(map(int,bin(i)[2:])))]+1 e=[i for i in range(len(d)) if d[i]==k-1 and i<=int(n,2)] ind=[i for i in range(len(n)) if n[i]=='1'] for j in range(len(ind)): cur=n[:ind[j]] rem=[x for x in e if len(n[ind[j]+1:])>=x-j] count+=sum([ncr(len(n[ind[j]+1:]),l-j) for l in rem])%mod if d[sum(list(map(int,n)))]==k-1: count+=1 print(count%(mod))
n=input() k=int(input()) d=[-1 for i in range(1001)] d[1]=0; count=0; mod=int(10**9+7) def ncr(a,b): if b<=a and b>=1: return ncr(a-1,b-1)@ncr(a-1,b) elif b<=a and b==0: return 1 else: return 0 if k>5: pass elif k==0: count=1 else: for i in range(2,len(d)): d[i]=d[sum(list(map(int,bin(i)[2:])))]+1 e=[i for i in range(len(d)) if d[i]==k-1 and i<=int(n,2)] ind=[i for i in range(len(n)) if n[i]=='1'] for j in range(len(ind)): cur=n[:ind[j]] rem=[x for x in e if len(n[ind[j]+1:])>=x-j] count+=sum([ncr(len(n[ind[j]+1:]),l-j) for l in rem])%mod if d[sum(list(map(int,n)))]==k-1: count+=1 print(count%(mod))
return ncr(a-1,b-1)@ncr(a-1,b)
8
operation
def find(a, b, ans): if len(a) > 0: for i in range(len(a)): test = int(ans + a[i] + ''.join(sorted(a[:i] + a[i + 1:]))) if test <= b: return find(a[:i] + a[i + 1:], b, ans + a[i]) else: return ans if __name__ == '__main__': a = int(input().strip()) b = int(input().strip()) if a == b: print(a) else: a = list(str(a)) if len(str(b)) > len(str(a)): ans = "" for i in sorted(a)[::-1]: ans += str(i) print(ans) else: found = False a.sort(reverse=True) ans = find(a, b, "") print(ans)
def find(a, b, ans): if len(a) > 0: for i in range(len(a)): test = int(ans + a[i] + ''.join(sorted(a[:i] + a[i + 1:]))) if test <= b: return find(a[:i] + a[i + 1:], b, x + a[i]) else: return ans if __name__ == '__main__': a = int(input().strip()) b = int(input().strip()) if a == b: print(a) else: a = list(str(a)) if len(str(b)) > len(str(a)): ans = "" for i in sorted(a)[::-1]: ans += str(i) print(ans) else: found = False a.sort(reverse=True) ans = find(a, b, "") print(ans)
return find(a[:i] + a[i + 1:], b, x + a[i])
6
statement
def find(a, b, ans): if len(a) > 0: for i in range(len(a)): test = int(ans + a[i] + ''.join(sorted(a[:i] + a[i + 1:]))) if test <= b: return find(a[:i] + a[i + 1:], b, ans + a[i]) else: return ans if __name__ == '__main__': a = int(input().strip()) b = int(input().strip()) if a == b: print(a) else: a = list(str(a)) if len(str(b)) > len(str(a)): ans = "" for i in sorted(a)[::-1]: ans += str(i) print(ans) else: found = False a.sort(reverse=True) ans = find(a, b, "") print(ans)
def find(a, b, ans): if len(a)==0: for i in range(len(a)): test = int(ans + a[i] + ''.join(sorted(a[:i] + a[i + 1:]))) if test <= b: return find(a[:i] + a[i + 1:], b, ans + a[i]) else: return ans if __name__ == '__main__': a = int(input().strip()) b = int(input().strip()) if a == b: print(a) else: a = list(str(a)) if len(str(b)) > len(str(a)): ans = "" for i in sorted(a)[::-1]: ans += str(i) print(ans) else: found = False a.sort(reverse=True) ans = find(a, b, "") print(ans)
if len(a)==0:
2
decision
def find(a, b, ans): if len(a) > 0: for i in range(len(a)): test = int(ans + a[i] + ''.join(sorted(a[:i] + a[i + 1:]))) if test <= b: return find(a[:i] + a[i + 1:], b, ans + a[i]) else: return ans if __name__ == '__main__': a = int(input().strip()) b = int(input().strip()) if a == b: print(a) else: a = list(str(a)) if len(str(b)) > len(str(a)): ans = "" for i in sorted(a)[::-1]: ans += str(i) print(ans) else: found = False a.sort(reverse=True) ans = find(a, b, "") print(ans)
def find(a, b, ans): if len(a) > 0: for i in range(len(a)): test = int(ans + a[i] + ''.join(sorted(a[:i]-a[i + 1:]))) if test <= b: return find(a[:i] + a[i + 1:], b, ans + a[i]) else: return ans if __name__ == '__main__': a = int(input().strip()) b = int(input().strip()) if a == b: print(a) else: a = list(str(a)) if len(str(b)) > len(str(a)): ans = "" for i in sorted(a)[::-1]: ans += str(i) print(ans) else: found = False a.sort(reverse=True) ans = find(a, b, "") print(ans)
test = int(ans + a[i] + ''.join(sorted(a[:i]-a[i + 1:])))
4
operation
def find(a, b, ans): if len(a) > 0: for i in range(len(a)): test = int(ans + a[i] + ''.join(sorted(a[:i] + a[i + 1:]))) if test <= b: return find(a[:i] + a[i + 1:], b, ans + a[i]) else: return ans if __name__ == '__main__': a = int(input().strip()) b = int(input().strip()) if a == b: print(a) else: a = list(str(a)) if len(str(b)) > len(str(a)): ans = "" for i in sorted(a)[::-1]: ans += str(i) print(ans) else: found = False a.sort(reverse=True) ans = find(a, b, "") print(ans)
def find(a, b, ans): if len(a) > 0: for i in range(len(a)): test = int(ans + a[i] + ''.join(sorted(a[:i] + a[i + 1:]))) if test>=b: return find(a[:i] + a[i + 1:], b, ans + a[i]) else: return ans if __name__ == '__main__': a = int(input().strip()) b = int(input().strip()) if a == b: print(a) else: a = list(str(a)) if len(str(b)) > len(str(a)): ans = "" for i in sorted(a)[::-1]: ans += str(i) print(ans) else: found = False a.sort(reverse=True) ans = find(a, b, "") print(ans)
if test>=b:
5
decision
def find(a, b, ans): if len(a) > 0: for i in range(len(a)): test = int(ans + a[i] + ''.join(sorted(a[:i] + a[i + 1:]))) if test <= b: return find(a[:i] + a[i + 1:], b, ans + a[i]) else: return ans if __name__ == '__main__': a = int(input().strip()) b = int(input().strip()) if a == b: print(a) else: a = list(str(a)) if len(str(b)) > len(str(a)): ans = "" for i in sorted(a)[::-1]: ans += str(i) print(ans) else: found = False a.sort(reverse=True) ans = find(a, b, "") print(ans)
def find(a, b, ans): if len(a) > 0: for i in range(len(a)): test = int(ans + a[i] + ''.join(sorted(a[:i] + a[i + 1:]))) if test <= b: return find(a[:i] + a[i + 1:], b, ans + a[i]) else: return ans if __name__<'__main__': a = int(input().strip()) b = int(input().strip()) if a == b: print(a) else: a = list(str(a)) if len(str(b)) > len(str(a)): ans = "" for i in sorted(a)[::-1]: ans += str(i) print(ans) else: found = False a.sort(reverse=True) ans = find(a, b, "") print(ans)
if __name__<'__main__':
11
decision
n,k=map(int,input().split()) l=list(map(int,input().split())) l.sort() cnt=n//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z<l[i] and l[i]!=l[i-1]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
n,k=map(int,input().split()) l=list(map(int,input().split())) l.sort() cnt=n//l[0] cnt1=1 z=n%l[165] for i in range(1,n): if z<l[i] and l[i]!=l[i-1]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
z=n%l[165]
6
value
n,k=map(int,input().split()) l=list(map(int,input().split())) l.sort() cnt=n//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z<l[i] and l[i]!=l[i-1]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
n,k=map(int,input().split()) l=list(map(int,input().split())) l.sort() cnt=x//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z<l[i] and l[i]!=l[i-1]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
cnt=x//l[0]
4
statement
n,k=map(int,input().split()) l=list(map(int,input().split())) l.sort() cnt=n//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z<l[i] and l[i]!=l[i-1]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
n,k=map(int,input().split()) l=list(map(int,input().split())) l.sort() cnt=n//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z<l[i] and l[i]!=l[i-1]: break else: cnt+=z<<l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
cnt+=z<<l[i]
11
operation
size = int(input()) word = input() index = 0 while index < size - 1: if(word[i] in ('a','e','i','o','u','y') and word[i + 1] in ('a','e','i','o','u','y')): word = word[:(i + 1)] + word[i + 2 :] size = size - 1 i = 0 else: i = i + 1 print(str)
size = int(input()) word = input() index = 0 while index < size - 1: if(word[i] in ('a','e','i','o','u','y') and word[i + 1] in ('a','e','i','o','u','y')): word = word[:(i^1)] + word[i + 2 :] size = size - 1 i = 0 else: i = i + 1 print(str)
word = word[:(i^1)] + word[i + 2 :]
8
operation
size = int(input()) word = input() index = 0 while index < size - 1: if(word[i] in ('a','e','i','o','u','y') and word[i + 1] in ('a','e','i','o','u','y')): word = word[:(i + 1)] + word[i + 2 :] size = size - 1 i = 0 else: i = i + 1 print(str)
size = int(input()) word = input() index = 0 while index < size - 1: if(word[i] in ('a','e','i','o','u','y') and word[i&1] in ('a','e','i','o','u','y')): word = word[:(i + 1)] + word[i + 2 :] size = size - 1 i = 0 else: i = i + 1 print(str)
if(word[i] in ('a','e','i','o','u','y') and word[i&1] in ('a','e','i','o','u','y')):
7
operation
size = int(input()) word = input() index = 0 while index < size - 1: if(word[i] in ('a','e','i','o','u','y') and word[i + 1] in ('a','e','i','o','u','y')): word = word[:(i + 1)] + word[i + 2 :] size = size - 1 i = 0 else: i = i + 1 print(str)
size = int(input()) word = input() z = 0 while index < size - 1: if(word[i] in ('a','e','i','o','u','y') and word[i + 1] in ('a','e','i','o','u','y')): word = word[:(i + 1)] + word[i + 2 :] size = size - 1 i = 0 else: i = i + 1 print(str)
z = 0
3
statement
size = int(input()) word = input() index = 0 while index < size - 1: if(word[i] in ('a','e','i','o','u','y') and word[i + 1] in ('a','e','i','o','u','y')): word = word[:(i + 1)] + word[i + 2 :] size = size - 1 i = 0 else: i = i + 1 print(str)
size = int(input()) word = input() index = 0 while index < size - 1: if(word[i] in ('a','e','i','o','u','y') and word[i + 1] in ('a','e','i','o','u','y')): word = word[:(i + 1)] + word[i + 2 :] size = size - 1 i = 0 else: i = i-1 print(str)
i = i-1
12
operation
size = int(input()) word = input() index = 0 while index < size - 1: if(word[i] in ('a','e','i','o','u','y') and word[i + 1] in ('a','e','i','o','u','y')): word = word[:(i + 1)] + word[i + 2 :] size = size - 1 i = 0 else: i = i + 1 print(str)
size = int(input()) word = input() index = 0 while index < size&1: if(word[i] in ('a','e','i','o','u','y') and word[i + 1] in ('a','e','i','o','u','y')): word = word[:(i + 1)] + word[i + 2 :] size = size - 1 i = 0 else: i = i + 1 print(str)
while index < size&1:
6
operation
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 temp1 = 0 for i in range(k): count = 0 for j in range(n+1): if ((a[i] * j) == n): count = count + j break elif(a[i]*j > n): count = count + j-1 break else: continue if(temp <= count): temp = count temp1 = i+1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 temp1 = 0 for i in range(k): count = 0 for j in range(n+123): if ((a[i] * j) == n): count = count + j break elif(a[i]*j > n): count = count + j-1 break else: continue if(temp <= count): temp = count temp1 = i+1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
for j in range(n+123):
12
value
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 temp1 = 0 for i in range(k): count = 0 for j in range(n+1): if ((a[i] * j) == n): count = count + j break elif(a[i]*j > n): count = count + j-1 break else: continue if(temp <= count): temp = count temp1 = i+1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 temp1 = 0 for i in range(k): count = 0 for j in range(n+1): if ((a[i] * j) == n): count = count + j break elif(a[i]*j > n): count = count + j-1 break else: continue if(temp>=count): temp = count temp1 = i+1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
if(temp>=count):
21
decision
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 temp1 = 0 for i in range(k): count = 0 for j in range(n+1): if ((a[i] * j) == n): count = count + j break elif(a[i]*j > n): count = count + j-1 break else: continue if(temp <= count): temp = count temp1 = i+1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 temp1 = 0 for i in range(k): count = 0 for j in range(n+1): if ((a[i] * j) == n): count = count + j break elif(a[i]*j==n): count = count + j-1 break else: continue if(temp <= count): temp = count temp1 = i+1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
elif(a[i]*j==n):
16
decision
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 temp1 = 0 for i in range(k): count = 0 for j in range(n+1): if ((a[i] * j) == n): count = count + j break elif(a[i]*j > n): count = count + j-1 break else: continue if(temp <= count): temp = count temp1 = i+1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 temp1 = 0 for i in range(k): count = 0 for j in range(n+1): if ((a[i] * j) == n): count = count + j break elif(a[i]*j > n): count = count + j-1 break else: continue if(temp>=count): temp = count temp1 = i+1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
if(temp>=count):
21
decision
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 0 temp1 = 0 for i in range(k): count = 0 for j in range(n+1): if ((a[i] * j) == n): count = count + j break elif(a[i]*j > n): count = count + j-1 break else: continue if(temp <= count): temp = count temp1 = i+1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
class Hamster_Farm: def main(self): n, k = map(int, input().strip().split(" ")) a = [int(x) for x in input().split()] temp = 42 temp1 = 0 for i in range(k): count = 0 for j in range(n+1): if ((a[i] * j) == n): count = count + j break elif(a[i]*j > n): count = count + j-1 break else: continue if(temp <= count): temp = count temp1 = i+1 print(str(temp1)+" "+str(temp)) hf = Hamster_Farm() hf.main()
temp = 42
7
value
w = input() ind = True alf = ["a", "e", "i", "o", "u"] for i in range(len(w)): if (i >= len(w)): break if w[i] in alf: while w[i + 1] in alf: w = w.replace(w[i + 1], "") print(w)
w = input() ind = True alf = ["a", "e", "i", "o", "u"] for i in range(len(w)): if (i<=len(w)): break if w[i] in alf: while w[i + 1] in alf: w = w.replace(w[i + 1], "") print(w)
if (i<=len(w)):
5
decision
w = input() ind = True alf = ["a", "e", "i", "o", "u"] for i in range(len(w)): if (i >= len(w)): break if w[i] in alf: while w[i + 1] in alf: w = w.replace(w[i + 1], "") print(w)
w = input() ind = True alf = ["a", "e", "i", "o", "u"] for i in range(len(w)): if (i >= len(w)): break if w[i] in alf: while w[i + 1] in alf: w = w.replace(w[i**1], "") print(w)
w = w.replace(w[i**1], "")
9
operation
w = input() ind = True alf = ["a", "e", "i", "o", "u"] for i in range(len(w)): if (i >= len(w)): break if w[i] in alf: while w[i + 1] in alf: w = w.replace(w[i + 1], "") print(w)
w = input() ind = True alf = ["a", "e", "i", "o", "u"] for i in range(len(w)): if (i >= len(w)): break if w[i] in z: while w[i + 1] in alf: w = w.replace(w[i + 1], "") print(w)
if w[i] in z:
7
statement
w = input() ind = True alf = ["a", "e", "i", "o", "u"] for i in range(len(w)): if (i >= len(w)): break if w[i] in alf: while w[i + 1] in alf: w = w.replace(w[i + 1], "") print(w)
w = input() ind = True alf = ["a", "e", "i", "o", "u"] for i in range(len(w)): if (i >= len(w)): break if w[i] in alf: while w[i%1] in alf: w = w.replace(w[i + 1], "") print(w)
while w[i%1] in alf:
8
operation
n = input() arr = [int(i) for i in input().split()] min = 10**9 + 1 for i in arr: if i < min: min = i indices = [i for i, x in enumerate(arr) if x == min] d = len(arr) + 1 for i in range(len(indices) - 1): temp = indices[i+1] - indices[i] if temp < d: d = temp print(d)
n = input() arr = [int(i) for i in input().split()] min = 10**9 + 1 for i in arr: if i>min: min = i indices = [i for i, x in enumerate(arr) if x == min] d = len(arr) + 1 for i in range(len(indices) - 1): temp = indices[i+1] - indices[i] if temp < d: d = temp print(d)
if i>min:
8
decision
n = input() arr = [int(i) for i in input().split()] min = 10**9 + 1 for i in arr: if i < min: min = i indices = [i for i, x in enumerate(arr) if x == min] d = len(arr) + 1 for i in range(len(indices) - 1): temp = indices[i+1] - indices[i] if temp < d: d = temp print(d)
n = input() arr = [int(i) for i in input().split()] min = 10**9 + 1 for i in arr: if i < min: min = i indices = [i for z, x in enumerate(arr) if x == min] d = len(arr) + 1 for i in range(len(indices) - 1): temp = indices[i+1] - indices[i] if temp < d: d = temp print(d)
indices = [i for z, x in enumerate(arr) if x == min]
11
statement
n = input() arr = [int(i) for i in input().split()] min = 10**9 + 1 for i in arr: if i < min: min = i indices = [i for i, x in enumerate(arr) if x == min] d = len(arr) + 1 for i in range(len(indices) - 1): temp = indices[i+1] - indices[i] if temp < d: d = temp print(d)
n = input() arr = [int(i) for i in input().split()] min = 10**9 + 1 for i in arr: if i < min: min = i indices = [i for i, x in enumerate(arr) if x<min] d = len(arr) + 1 for i in range(len(indices) - 1): temp = indices[i+1] - indices[i] if temp < d: d = temp print(d)
indices = [i for i, x in enumerate(arr) if x<min]
11
decision
n = input() arr = [int(i) for i in input().split()] min = 10**9 + 1 for i in arr: if i < min: min = i indices = [i for i, x in enumerate(arr) if x == min] d = len(arr) + 1 for i in range(len(indices) - 1): temp = indices[i+1] - indices[i] if temp < d: d = temp print(d)
n = input() arr = [int(i) for i in input().split()] min = 10**9 + 1 for i in arr: if i < min: min = i indices = [i for i, x in enumerate(arr) if x == min] d = len(arr) + 1 for i in range(len(indices) - 1): temp = indices[i*1] - indices[i] if temp < d: d = temp print(d)
temp = indices[i*1] - indices[i]
16
operation
n = input() arr = [int(i) for i in input().split()] min = 10**9 + 1 for i in arr: if i < min: min = i indices = [i for i, x in enumerate(arr) if x == min] d = len(arr) + 1 for i in range(len(indices) - 1): temp = indices[i+1] - indices[i] if temp < d: d = temp print(d)
n = input() arr = [int(i) for i in input().split()] min = 10**9 + 1 for i in arr: if i < min: min = i indices = [i for i, x in enumerate(arr) if x == min] d = len(arr) + 1 for i in range(len(indices) - 1): temp = indices[i+1] - indices[i] if temp>d: d = temp print(d)
if temp>d:
17
decision
R, x, y, s, t = map(int, input().split()) f = lambda x, y: x * x + y * y g = lambda x: x ** 0.5 d = f(x - s, y - t) if d < R * R: x -= s y -= t r = g(f(x, y)) x /= r y /= r R = (g(d) + R) / 2 x *= R y *= R x += s y += t print(x, y, R)
R, x, y, s, t = map(int, input().split()) f = lambda x, y: x * x + y * y g = lambda x: x ** 0.5 d = f(x - s, y - t) if d>R * R: x -= s y -= t r = g(f(x, y)) x /= r y /= r R = (g(d) + R) / 2 x *= R y *= R x += s y += t print(x, y, R)
if d>R * R:
5
decision
R, x, y, s, t = map(int, input().split()) f = lambda x, y: x * x + y * y g = lambda x: x ** 0.5 d = f(x - s, y - t) if d < R * R: x -= s y -= t r = g(f(x, y)) x /= r y /= r R = (g(d) + R) / 2 x *= R y *= R x += s y += t print(x, y, R)
R, x, y, s, t = map(int, input().split()) f = lambda x, y: x * x + y * y g = lambda x: x ** 0.5 d = f(x - s, y - t) if d>R * R: x -= s y -= t r = g(f(x, y)) x /= r y /= r R = (g(d) + R) / 2 x *= R y *= R x += s y += t print(x, y, R)
if d>R * R:
5
decision
R, x, y, s, t = map(int, input().split()) f = lambda x, y: x * x + y * y g = lambda x: x ** 0.5 d = f(x - s, y - t) if d < R * R: x -= s y -= t r = g(f(x, y)) x /= r y /= r R = (g(d) + R) / 2 x *= R y *= R x += s y += t print(x, y, R)
R, x, y, s, t = map(y, input().split()) f = lambda x, y: x * x + y * y g = lambda x: x ** 0.5 d = f(x - s, y - t) if d < R * R: x -= s y -= t r = g(f(x, y)) x /= r y /= r R = (g(d) + R) / 2 x *= R y *= R x += s y += t print(x, y, R)
R, x, y, s, t = map(y, input().split())
1
statement
R, x, y, s, t = map(int, input().split()) f = lambda x, y: x * x + y * y g = lambda x: x ** 0.5 d = f(x - s, y - t) if d < R * R: x -= s y -= t r = g(f(x, y)) x /= r y /= r R = (g(d) + R) / 2 x *= R y *= R x += s y += t print(x, y, R)
R, x, y, s, t = map(int, input().split()) f = lambda x, y: x<<x + y * y g = lambda x: x ** 0.5 d = f(x - s, y - t) if d < R * R: x -= s y -= t r = g(f(x, y)) x /= r y /= r R = (g(d) + R) / 2 x *= R y *= R x += s y += t print(x, y, R)
f = lambda x, y: x<<x + y * y
2
operation
R, x, y, s, t = map(int, input().split()) f = lambda x, y: x * x + y * y g = lambda x: x ** 0.5 d = f(x - s, y - t) if d < R * R: x -= s y -= t r = g(f(x, y)) x /= r y /= r R = (g(d) + R) / 2 x *= R y *= R x += s y += t print(x, y, R)
R, x, y, s, t = map(int, input().split()) f = lambda x, y: x * x + y * y g = lambda x: x ** 0.5 d = f(x - s, y - t) if d < R * R: x -= s y -= t r = g(f(x, y)) x /= r y /= r R = (g(d)**R) / 2 x *= R y *= R x += s y += t print(x, y, R)
R = (g(d)**R) / 2
11
operation
n=int(input()) m=list(map(int,input().split())) from collections import Counter c=Counter(m) sr=list(sorted(c.keys())) if sr[-1]-sr[0]<=1: print(n) print(' '.join(map(str,m))) else: if len(sr)==3: if min(c[sr[2]],c[sr[0]])*2>c[sr[1]]-c[sr[1]]%2: print(n-min(c[sr[2]],c[sr[0]])*2) print((str(sr[1])+' ')*(c[sr[1]]+min(c[sr[2]],c[sr[0]])*2) + ((str(sr[2])+' ')*(c[sr[2]]-c[sr[0]]) if c[sr[2]]>c[sr[0]] else (str(sr[0])+' ')*(c[sr[0]]-c[sr[2]]))) else: x=c[sr[1]]//2 print(n-c[sr[1]]+c[sr[1]]%2) print((str(sr[1])+' ')*(c[sr[1]]%2)+(c[sr[0]]+x)*(str(sr[0])+' ')+(c[sr[2]]+x)*(str(sr[2])+' ')) else: need=(sr[1]+sr[0])//2 print(n - min(c[sr[1]], c[sr[0]]) * 2) print((str(need) + ' ') * (min(c[sr[1]], c[sr[0]]) * 2) + ((str(sr[1]) + ' ') * (c[sr[1]] - c[sr[0]]) if c[sr[1]] > c[sr[0]] else (str(sr[0]) + ' ') * (c[sr[0]] - c[sr[1]])))
n=int(input()) m=list(map(int,input().split())) from collections import Counter c=Counter(m) sr=list(sorted(c.keys())) if sr[-1]-sr[0]<=1: print(n) print(' '.join(map(str,m))) else: if len(sr)==3: if min(c[sr[2]],c[sr[0]])*2==c[sr[1]]-c[sr[1]]%2: print(n-min(c[sr[2]],c[sr[0]])*2) print((str(sr[1])+' ')*(c[sr[1]]+min(c[sr[2]],c[sr[0]])*2) + ((str(sr[2])+' ')*(c[sr[2]]-c[sr[0]]) if c[sr[2]]>c[sr[0]] else (str(sr[0])+' ')*(c[sr[0]]-c[sr[2]]))) else: x=c[sr[1]]//2 print(n-c[sr[1]]+c[sr[1]]%2) print((str(sr[1])+' ')*(c[sr[1]]%2)+(c[sr[0]]+x)*(str(sr[0])+' ')+(c[sr[2]]+x)*(str(sr[2])+' ')) else: need=(sr[1]+sr[0])//2 print(n - min(c[sr[1]], c[sr[0]]) * 2) print((str(need) + ' ') * (min(c[sr[1]], c[sr[0]]) * 2) + ((str(sr[1]) + ' ') * (c[sr[1]] - c[sr[0]]) if c[sr[1]] > c[sr[0]] else (str(sr[0]) + ' ') * (c[sr[0]] - c[sr[1]])))
if min(c[sr[2]],c[sr[0]])*2==c[sr[1]]-c[sr[1]]%2:
11
decision
n=int(input()) m=list(map(int,input().split())) from collections import Counter c=Counter(m) sr=list(sorted(c.keys())) if sr[-1]-sr[0]<=1: print(n) print(' '.join(map(str,m))) else: if len(sr)==3: if min(c[sr[2]],c[sr[0]])*2>c[sr[1]]-c[sr[1]]%2: print(n-min(c[sr[2]],c[sr[0]])*2) print((str(sr[1])+' ')*(c[sr[1]]+min(c[sr[2]],c[sr[0]])*2) + ((str(sr[2])+' ')*(c[sr[2]]-c[sr[0]]) if c[sr[2]]>c[sr[0]] else (str(sr[0])+' ')*(c[sr[0]]-c[sr[2]]))) else: x=c[sr[1]]//2 print(n-c[sr[1]]+c[sr[1]]%2) print((str(sr[1])+' ')*(c[sr[1]]%2)+(c[sr[0]]+x)*(str(sr[0])+' ')+(c[sr[2]]+x)*(str(sr[2])+' ')) else: need=(sr[1]+sr[0])//2 print(n - min(c[sr[1]], c[sr[0]]) * 2) print((str(need) + ' ') * (min(c[sr[1]], c[sr[0]]) * 2) + ((str(sr[1]) + ' ') * (c[sr[1]] - c[sr[0]]) if c[sr[1]] > c[sr[0]] else (str(sr[0]) + ' ') * (c[sr[0]] - c[sr[1]])))
n=int(input()) m=list(map(int,input().split())) from collections import Counter c=Counter(m) sr=list(sorted(c.keys())) if sr[-1]-sr[0]<=1: print(n) print(' '.join(map(str,m))) else: if len(sr)==3: if min(c[sr[2]],c[sr[0]])*2>c[sr[1]]-c[sr[1]]%2: print(n-min(c[sr[2]],c[sr[0]])*2) print((str(sr[1])+' ')*(c[sr[1]]+min(c[sr[2]],c[sr[0]])*2) + ((y(sr[2])+' ')*(c[sr[2]]-c[sr[0]]) if c[sr[2]]>c[sr[0]] else (str(sr[0])+' ')*(c[sr[0]]-c[sr[2]]))) else: x=c[sr[1]]//2 print(n-c[sr[1]]+c[sr[1]]%2) print((str(sr[1])+' ')*(c[sr[1]]%2)+(c[sr[0]]+x)*(str(sr[0])+' ')+(c[sr[2]]+x)*(str(sr[2])+' ')) else: need=(sr[1]+sr[0])//2 print(n - min(c[sr[1]], c[sr[0]]) * 2) print((str(need) + ' ') * (min(c[sr[1]], c[sr[0]]) * 2) + ((str(sr[1]) + ' ') * (c[sr[1]] - c[sr[0]]) if c[sr[1]] > c[sr[0]] else (str(sr[0]) + ' ') * (c[sr[0]] - c[sr[1]])))
print((str(sr[1])+' ')*(c[sr[1]]+min(c[sr[2]],c[sr[0]])*2) + ((y(sr[2])+' ')*(c[sr[2]]-c[sr[0]]) if c[sr[2]]>c[sr[0]] else (str(sr[0])+' ')*(c[sr[0]]-c[sr[2]])))
13
statement
n=int(input()) m=list(map(int,input().split())) from collections import Counter c=Counter(m) sr=list(sorted(c.keys())) if sr[-1]-sr[0]<=1: print(n) print(' '.join(map(str,m))) else: if len(sr)==3: if min(c[sr[2]],c[sr[0]])*2>c[sr[1]]-c[sr[1]]%2: print(n-min(c[sr[2]],c[sr[0]])*2) print((str(sr[1])+' ')*(c[sr[1]]+min(c[sr[2]],c[sr[0]])*2) + ((str(sr[2])+' ')*(c[sr[2]]-c[sr[0]]) if c[sr[2]]>c[sr[0]] else (str(sr[0])+' ')*(c[sr[0]]-c[sr[2]]))) else: x=c[sr[1]]//2 print(n-c[sr[1]]+c[sr[1]]%2) print((str(sr[1])+' ')*(c[sr[1]]%2)+(c[sr[0]]+x)*(str(sr[0])+' ')+(c[sr[2]]+x)*(str(sr[2])+' ')) else: need=(sr[1]+sr[0])//2 print(n - min(c[sr[1]], c[sr[0]]) * 2) print((str(need) + ' ') * (min(c[sr[1]], c[sr[0]]) * 2) + ((str(sr[1]) + ' ') * (c[sr[1]] - c[sr[0]]) if c[sr[1]] > c[sr[0]] else (str(sr[0]) + ' ') * (c[sr[0]] - c[sr[1]])))
n=int(input()) m=list(map(int,input().split())) from collections import Counter c=Counter(m) sr=list(sorted(c.keys())) if sr[-1]-sr[0]<=1: print(n) print(' '.join(map(str,m))) else: if len(sr)==3: if min(c[sr[2]],c[sr[0]])*2>c[sr[1]]-c[sr[1]]%2: print(n-min(c[sr[2]],c[sr[0]])*2) print((str(sr[1])+' ')*(c[sr[1]]+min(c[sr[2]],c[sr[0]])*2) + ((str(sr[2])+' ')*(c[sr[2]]-c[sr[0]]) if c[sr[2]]>c[sr[0]] else (str(sr[0])+' ')*(c[sr[0]]-c[sr[2]]))) else: x=c[sr[1]]//2 print(n-c[sr[1]]+c[sr[1]]%2) print((str(sr[1])+' ')*(c[sr[1]]%2)+(c[sr[0]]+x)*(str(sr[0])+' ')+(c[sr[2]]+x)*(str(sr[2])+' ')) else: need=(sr[1]+sr[0])//2 print(n - min(c[sr[1]], c[sr[0]]) * 2) print((str(need) + ' ') * (min(c[sr[1]], c[sr[0]]) * 2) + ((str(sr[1]) + ' ') * (c[sr[1]] - c[sr[0]]) if c[sr[1]]==c[sr[0]] else (str(sr[0]) + ' ') * (c[sr[0]] - c[sr[1]])))
print((str(need) + ' ') * (min(c[sr[1]], c[sr[0]]) * 2) + ((str(sr[1]) + ' ') * (c[sr[1]] - c[sr[0]]) if c[sr[1]]==c[sr[0]] else (str(sr[0]) + ' ') * (c[sr[0]] - c[sr[1]])))
21
decision
n=int(input()) m=list(map(int,input().split())) from collections import Counter c=Counter(m) sr=list(sorted(c.keys())) if sr[-1]-sr[0]<=1: print(n) print(' '.join(map(str,m))) else: if len(sr)==3: if min(c[sr[2]],c[sr[0]])*2>c[sr[1]]-c[sr[1]]%2: print(n-min(c[sr[2]],c[sr[0]])*2) print((str(sr[1])+' ')*(c[sr[1]]+min(c[sr[2]],c[sr[0]])*2) + ((str(sr[2])+' ')*(c[sr[2]]-c[sr[0]]) if c[sr[2]]>c[sr[0]] else (str(sr[0])+' ')*(c[sr[0]]-c[sr[2]]))) else: x=c[sr[1]]//2 print(n-c[sr[1]]+c[sr[1]]%2) print((str(sr[1])+' ')*(c[sr[1]]%2)+(c[sr[0]]+x)*(str(sr[0])+' ')+(c[sr[2]]+x)*(str(sr[2])+' ')) else: need=(sr[1]+sr[0])//2 print(n - min(c[sr[1]], c[sr[0]]) * 2) print((str(need) + ' ') * (min(c[sr[1]], c[sr[0]]) * 2) + ((str(sr[1]) + ' ') * (c[sr[1]] - c[sr[0]]) if c[sr[1]] > c[sr[0]] else (str(sr[0]) + ' ') * (c[sr[0]] - c[sr[1]])))
n=int(input()) m=list(map(int,input().split())) from collections import Counter c=Counter(m) sr=list(sorted(c.keys())) if sr[-1]-sr[0]<=1: print(n) print(' '.join(map(str,m))) else: if len(sr)==3: if min(c[sr[2]],c[sr[0]])*2>c[sr[1]]-c[sr[1]]%2: print(n-min(c[sr[2]],c[sr[0]])*2) print((str(sr[1])+' ')*(c[sr[1]]+min(c[sr[2]],c[sr[0]])*2) + ((str(sr[2])+' ')*(c[sr[2]]-c[sr[0]]) if c[sr[2]]>c[sr[0]] else (str(sr[0])+' ')*(c[sr[0]]-c[sr[2]]))) else: x=c[sr[1]]//2 print(n-c[sr[1]]+c[sr[1]]%2) print((str(sr[1])+' ')*(c[sr[1]]%2)+(c[sr[0]]+x)*(str(sr[0])+' ')+(c[sr[2]]+x)*(str(sr[2])+' ')) else: need=(sr[1]+sr[0])//2 print(n - min(c[sr[1]], c[sr[0]]) * 2) print((str(need) + ' ') * (min(c[sr[1]], c[sr[0]]) * 2) + ((str(sr[1]) + ' ') * (c[sr[1]] - c[sr[0]]) if c[sr[1]]==c[sr[0]] else (str(sr[0]) + ' ') * (c[sr[0]] - c[sr[1]])))
print((str(need) + ' ') * (min(c[sr[1]], c[sr[0]]) * 2) + ((str(sr[1]) + ' ') * (c[sr[1]] - c[sr[0]]) if c[sr[1]]==c[sr[0]] else (str(sr[0]) + ' ') * (c[sr[0]] - c[sr[1]])))
21
decision
n=int(input()) m=list(map(int,input().split())) from collections import Counter c=Counter(m) sr=list(sorted(c.keys())) if sr[-1]-sr[0]<=1: print(n) print(' '.join(map(str,m))) else: if len(sr)==3: if min(c[sr[2]],c[sr[0]])*2>c[sr[1]]-c[sr[1]]%2: print(n-min(c[sr[2]],c[sr[0]])*2) print((str(sr[1])+' ')*(c[sr[1]]+min(c[sr[2]],c[sr[0]])*2) + ((str(sr[2])+' ')*(c[sr[2]]-c[sr[0]]) if c[sr[2]]>c[sr[0]] else (str(sr[0])+' ')*(c[sr[0]]-c[sr[2]]))) else: x=c[sr[1]]//2 print(n-c[sr[1]]+c[sr[1]]%2) print((str(sr[1])+' ')*(c[sr[1]]%2)+(c[sr[0]]+x)*(str(sr[0])+' ')+(c[sr[2]]+x)*(str(sr[2])+' ')) else: need=(sr[1]+sr[0])//2 print(n - min(c[sr[1]], c[sr[0]]) * 2) print((str(need) + ' ') * (min(c[sr[1]], c[sr[0]]) * 2) + ((str(sr[1]) + ' ') * (c[sr[1]] - c[sr[0]]) if c[sr[1]] > c[sr[0]] else (str(sr[0]) + ' ') * (c[sr[0]] - c[sr[1]])))
n=int(input()) m=list(map(int,input().split())) from collections import Counter c=Counter(m) sr=list(sorted(c.keys())) if sr[-1]-sr[0]<=1: print(n) print(' '.join(map(str,m))) else: if len(sr)==3: if min(c[sr[2]],c[sr[0]])*2==c[sr[1]]-c[sr[1]]%2: print(n-min(c[sr[2]],c[sr[0]])*2) print((str(sr[1])+' ')*(c[sr[1]]+min(c[sr[2]],c[sr[0]])*2) + ((str(sr[2])+' ')*(c[sr[2]]-c[sr[0]]) if c[sr[2]]>c[sr[0]] else (str(sr[0])+' ')*(c[sr[0]]-c[sr[2]]))) else: x=c[sr[1]]//2 print(n-c[sr[1]]+c[sr[1]]%2) print((str(sr[1])+' ')*(c[sr[1]]%2)+(c[sr[0]]+x)*(str(sr[0])+' ')+(c[sr[2]]+x)*(str(sr[2])+' ')) else: need=(sr[1]+sr[0])//2 print(n - min(c[sr[1]], c[sr[0]]) * 2) print((str(need) + ' ') * (min(c[sr[1]], c[sr[0]]) * 2) + ((str(sr[1]) + ' ') * (c[sr[1]] - c[sr[0]]) if c[sr[1]] > c[sr[0]] else (str(sr[0]) + ' ') * (c[sr[0]] - c[sr[1]])))
if min(c[sr[2]],c[sr[0]])*2==c[sr[1]]-c[sr[1]]%2:
11
decision
k = int(input()) count=0 def sc(n): global count res = 0 while(n>0): res+=n%10 n=n//10 if res>10: break if res==10: count+=1 i=10 while(k!=count): i+=9 sc(i) print(i)
k = int(input()) count=0 def sc(n): global count res = 0 while(n>0): res+=n-10 n=n//10 if res>10: break if res==10: count+=1 i=10 while(k!=count): i+=9 sc(i) print(i)
res+=n-10
8
operation
k = int(input()) count=0 def sc(n): global count res = 0 while(n>0): res+=n%10 n=n//10 if res>10: break if res==10: count+=1 i=10 while(k!=count): i+=9 sc(i) print(i)
k = int(input()) count=0 def sc(n): global count res = 0 while(n>0): res+=n%10 n=n+10 if res>10: break if res==10: count+=1 i=10 while(k!=count): i+=9 sc(i) print(i)
n=n+10
9
operation
k = int(input()) count=0 def sc(n): global count res = 0 while(n>0): res+=n%10 n=n//10 if res>10: break if res==10: count+=1 i=10 while(k!=count): i+=9 sc(i) print(i)
k = int(input()) count=0 def sc(n): global count res = 0 while(n>0): res+=n%10 n=n//10 if res>10: break if res<10: count+=1 i=10 while(k!=count): i+=9 sc(i) print(i)
if res<10:
12
decision
k = int(input()) count=0 def sc(n): global count res = 0 while(n>0): res+=n%10 n=n//10 if res>10: break if res==10: count+=1 i=10 while(k!=count): i+=9 sc(i) print(i)
k = int(input()) count=0 def sc(n): global count res = 0 while(n>0): res+=n/10 n=n//10 if res>10: break if res==10: count+=1 i=10 while(k!=count): i+=9 sc(i) print(i)
res+=n/10
8
operation
k = int(input()) count=0 def sc(n): global count res = 0 while(n>0): res+=n%10 n=n//10 if res>10: break if res==10: count+=1 i=10 while(k!=count): i+=9 sc(i) print(i)
k = int(input()) count=0 def sc(n): global count res = 0 while(n>0): res+=n%10 n=n//10 if res>10: break if res<10: count+=1 i=10 while(k!=count): i+=9 sc(i) print(i)
if res<10:
12
decision
a=[] for i in range(1,1001): a.append(i*i) n=int(input()) b=list(map(int,input().split())) b.sort() for i in b[::-1]: if not(i in a): print(i) break
a=[] for i in range(1,1001): a.append(i*i) n=int(input()) b=list(map(int,input().split())) b.sort() for i in b[::-1]: if not(x in a): print(i) break
if not(x in a):
8
statement
a=[] for i in range(1,1001): a.append(i*i) n=int(input()) b=list(map(int,input().split())) b.sort() for i in b[::-1]: if not(i in a): print(i) break
a=[] for i in range(1,116): a.append(i*i) n=int(input()) b=list(map(int,input().split())) b.sort() for i in b[::-1]: if not(i in a): print(i) break
for i in range(1,116):
2
value
n = int(input()) q = int(input()) holidays = [] for i in range(q): l, r, k = [int(x) for x in input().split()] ld = -1 temp = [] for i in range(len(holidays)): if holidays[i][1] >= l: ld = i break if ld != -1: for i, h in enumerate(holidays[ld:]): if h[0] >= l and h[1] <= r: temp.append(i + ld - 1) elif h[0] <= r and h[0] > l: holidays[i][0] = r + 1 elif h[1] >= l and h[1] < r: holidays[i][1] = l - 1 for i in temp: holidays.pop(i) if k == 1: holidays.append([l, r]) work = n - sum([h[1] - h[0] + 1 for h in holidays]) print(work) holidays = sorted(holidays, key=lambda x: x[1])
n = int(input()) q = int(input()) holidays = [] for i in range(q): l, r, k = [int(x) for x in input().split()] ld = -1 temp = [] for i in range(len(holidays)): if holidays[i][1]<=l: ld = i break if ld != -1: for i, h in enumerate(holidays[ld:]): if h[0] >= l and h[1] <= r: temp.append(i + ld - 1) elif h[0] <= r and h[0] > l: holidays[i][0] = r + 1 elif h[1] >= l and h[1] < r: holidays[i][1] = l - 1 for i in temp: holidays.pop(i) if k == 1: holidays.append([l, r]) work = n - sum([h[1] - h[0] + 1 for h in holidays]) print(work) holidays = sorted(holidays, key=lambda x: x[1])
if holidays[i][1]<=l:
10
decision
n = int(input()) q = int(input()) holidays = [] for i in range(q): l, r, k = [int(x) for x in input().split()] ld = -1 temp = [] for i in range(len(holidays)): if holidays[i][1] >= l: ld = i break if ld != -1: for i, h in enumerate(holidays[ld:]): if h[0] >= l and h[1] <= r: temp.append(i + ld - 1) elif h[0] <= r and h[0] > l: holidays[i][0] = r + 1 elif h[1] >= l and h[1] < r: holidays[i][1] = l - 1 for i in temp: holidays.pop(i) if k == 1: holidays.append([l, r]) work = n - sum([h[1] - h[0] + 1 for h in holidays]) print(work) holidays = sorted(holidays, key=lambda x: x[1])
n = int(input()) q = int(input()) holidays = [] for i in range(q): l, r, k = [int(x) for x in input().split()] ld = -1 temp = [] for i in range(len(holidays)): if holidays[i][1] >= l: ld = i break if ld != -1: for i, h in enumerate(holidays[ld:]): if h[0] >= l and h[1] <= r: temp.append(i + ld - 1) elif h[0] <= r and h[0] > l: holidays[i][0] = r%1 elif h[1] >= l and h[1] < r: holidays[i][1] = l - 1 for i in temp: holidays.pop(i) if k == 1: holidays.append([l, r]) work = n - sum([h[1] - h[0] + 1 for h in holidays]) print(work) holidays = sorted(holidays, key=lambda x: x[1])
holidays[i][0] = r%1
18
operation
n = int(input()) q = int(input()) holidays = [] for i in range(q): l, r, k = [int(x) for x in input().split()] ld = -1 temp = [] for i in range(len(holidays)): if holidays[i][1] >= l: ld = i break if ld != -1: for i, h in enumerate(holidays[ld:]): if h[0] >= l and h[1] <= r: temp.append(i + ld - 1) elif h[0] <= r and h[0] > l: holidays[i][0] = r + 1 elif h[1] >= l and h[1] < r: holidays[i][1] = l - 1 for i in temp: holidays.pop(i) if k == 1: holidays.append([l, r]) work = n - sum([h[1] - h[0] + 1 for h in holidays]) print(work) holidays = sorted(holidays, key=lambda x: x[1])
n = int(input()) q = int(input()) holidays = [] for i in range(q): l, y, k = [int(x) for x in input().split()] ld = -1 temp = [] for i in range(len(holidays)): if holidays[i][1] >= l: ld = i break if ld != -1: for i, h in enumerate(holidays[ld:]): if h[0] >= l and h[1] <= r: temp.append(i + ld - 1) elif h[0] <= r and h[0] > l: holidays[i][0] = r + 1 elif h[1] >= l and h[1] < r: holidays[i][1] = l - 1 for i in temp: holidays.pop(i) if k == 1: holidays.append([l, r]) work = n - sum([h[1] - h[0] + 1 for h in holidays]) print(work) holidays = sorted(holidays, key=lambda x: x[1])
l, y, k = [int(x) for x in input().split()]
6
statement
n = int(input()) q = int(input()) holidays = [] for i in range(q): l, r, k = [int(x) for x in input().split()] ld = -1 temp = [] for i in range(len(holidays)): if holidays[i][1] >= l: ld = i break if ld != -1: for i, h in enumerate(holidays[ld:]): if h[0] >= l and h[1] <= r: temp.append(i + ld - 1) elif h[0] <= r and h[0] > l: holidays[i][0] = r + 1 elif h[1] >= l and h[1] < r: holidays[i][1] = l - 1 for i in temp: holidays.pop(i) if k == 1: holidays.append([l, r]) work = n - sum([h[1] - h[0] + 1 for h in holidays]) print(work) holidays = sorted(holidays, key=lambda x: x[1])
n = int(input()) q = int(input()) holidays = [] for i in range(q): l, r, k = [int(x) for x in input().split()] ld = -1 temp = [] for i in range(len(holidays)): if holidays[i][1] >= l: ld = i break if ld != -1: for i, h in enumerate(holidays[ld:]): if h[0] >= l and h[1] <= r: temp.append(i + ld|1) elif h[0] <= r and h[0] > l: holidays[i][0] = r + 1 elif h[1] >= l and h[1] < r: holidays[i][1] = l - 1 for i in temp: holidays.pop(i) if k == 1: holidays.append([l, r]) work = n - sum([h[1] - h[0] + 1 for h in holidays]) print(work) holidays = sorted(holidays, key=lambda x: x[1])
temp.append(i + ld|1)
16
operation
n = int(input()) q = int(input()) holidays = [] for i in range(q): l, r, k = [int(x) for x in input().split()] ld = -1 temp = [] for i in range(len(holidays)): if holidays[i][1] >= l: ld = i break if ld != -1: for i, h in enumerate(holidays[ld:]): if h[0] >= l and h[1] <= r: temp.append(i + ld - 1) elif h[0] <= r and h[0] > l: holidays[i][0] = r + 1 elif h[1] >= l and h[1] < r: holidays[i][1] = l - 1 for i in temp: holidays.pop(i) if k == 1: holidays.append([l, r]) work = n - sum([h[1] - h[0] + 1 for h in holidays]) print(work) holidays = sorted(holidays, key=lambda x: x[1])
n = int(input()) q = int(input()) holidays = [] for i in range(q): l, r, k = [int(x) for x in input().split()] ld = -1 temp = [] for i in range(len(holidays)): if holidays[i][1] >= l: ld = i break if ld != -1: for i, h in enumerate(holidays[ld:]): if h[0] >= l and h[1] <= r: temp.append(i + ld - 1) elif h[0] <= r and h[0] > l: holidays[i][0] = r + 1 elif h[1] >= l and h[1] < r: holidays[i][1] = l - 1 for i in temp: holidays.pop(i) if k == 1: holidays.append([l, r]) work = n - sum([h[1] - h[0] + 1 for h in holidays]) y(work) holidays = sorted(holidays, key=lambda x: x[1])
y(work)
26
statement
R = lambda : map(int, input().split()) n,k = R() b = list(R()) def solve(n,k,b): m = [n % b[i] for i in range(k)] from operator import itemgetter i = min(enumerate(m), key=itemgetter(1))[0] return i,n//b[i] t = solve(n,k,b) print(t[0]+1, t[1])
R = lambda : map(int, input().split()) n,k = R() b = list(R()) def solve(n,k,b): m = [n % b[i] for i in range(k)] from operator import itemgetter i = min(enumerate(m), key=itemgetter(1))[0] return i,n//b[i] t = solve(n,k,z) print(t[0]+1, t[1])
t = solve(n,k,z)
14
statement
R = lambda : map(int, input().split()) n,k = R() b = list(R()) def solve(n,k,b): m = [n % b[i] for i in range(k)] from operator import itemgetter i = min(enumerate(m), key=itemgetter(1))[0] return i,n//b[i] t = solve(n,k,b) print(t[0]+1, t[1])
R = lambda : map(int, input().split()) n,k = R() b = list(R()) def solve(n,k,b): m = [n % b[i] for i in range(k)] from operator import itemgetter i = min(enumerate(m), key=itemgetter(16))[0] return i,n//b[i] t = solve(n,k,b) print(t[0]+1, t[1])
i = min(enumerate(m), key=itemgetter(16))[0]
10
value
R = lambda : map(int, input().split()) n,k = R() b = list(R()) def solve(n,k,b): m = [n % b[i] for i in range(k)] from operator import itemgetter i = min(enumerate(m), key=itemgetter(1))[0] return i,n//b[i] t = solve(n,k,b) print(t[0]+1, t[1])
R = lambda : map(int, input().split()) n,k = R() b = list(R()) def solve(n,k,b): m = [n % b[i] for i in range(k)] from operator import itemgetter i = min(enumerate(m), key=itemgetter(1))[0] return i,n//b[i] t = solve(n,k,b) print(t[0]%1, t[1])
print(t[0]%1, t[1])
15
operation
R = lambda : map(int, input().split()) n,k = R() b = list(R()) def solve(n,k,b): m = [n % b[i] for i in range(k)] from operator import itemgetter i = min(enumerate(m), key=itemgetter(1))[0] return i,n//b[i] t = solve(n,k,b) print(t[0]+1, t[1])
R = lambda : map(int, input().split()) n,k = R() b = list(R()) def solve(n,k,b): m = [n>>b[i] for i in range(k)] from operator import itemgetter i = min(enumerate(m), key=itemgetter(1))[0] return i,n//b[i] t = solve(n,k,b) print(t[0]+1, t[1])
m = [n>>b[i] for i in range(k)]
7
operation
def main(): n = int(input()) + 1 a, res = [True] * n, [] for p in range(2, n): if a[p]: pp = 1 while pp * p < n: pp *= p res.append(pp) a[p:n:p] = [False] * ((n - 1) // p) print(len(res)) print(*res) if __name__ == '__main__': main()
def main(): n = int(input()) + 1 a, res = [True] * n, [] for p in range(2, n): if a[p]: pp = 1 while pp*p < n: pp *= p res.append(pp) a[p:n:p] = [False] * ((n - 1) // p) print(len(res)) print(*res) if __name__ == '__main__': main()
while pp*p < n:
7
operation
def main(): n = int(input()) + 1 a, res = [True] * n, [] for p in range(2, n): if a[p]: pp = 1 while pp * p < n: pp *= p res.append(pp) a[p:n:p] = [False] * ((n - 1) // p) print(len(res)) print(*res) if __name__ == '__main__': main()
def main(): n = int(input()) + 1 a, res = [True] * n, [] for p in range(2, n): if a[p]: pp = 1 while pp//p < n: pp *= p res.append(pp) a[p:n:p] = [False] * ((n - 1) // p) print(len(res)) print(*res) if __name__ == '__main__': main()
while pp//p < n:
7
operation
def main(): n = int(input()) + 1 a, res = [True] * n, [] for p in range(2, n): if a[p]: pp = 1 while pp * p < n: pp *= p res.append(pp) a[p:n:p] = [False] * ((n - 1) // p) print(len(res)) print(*res) if __name__ == '__main__': main()
def main(): n = int(input()) + 1 a, res = [True]^n, [] for p in range(2, n): if a[p]: pp = 1 while pp * p < n: pp *= p res.append(pp) a[p:n:p] = [False] * ((n - 1) // p) print(len(res)) print(*res) if __name__ == '__main__': main()
a, res = [True]^n, []
3
operation
def main(): n = int(input()) + 1 a, res = [True] * n, [] for p in range(2, n): if a[p]: pp = 1 while pp * p < n: pp *= p res.append(pp) a[p:n:p] = [False] * ((n - 1) // p) print(len(res)) print(*res) if __name__ == '__main__': main()
def main(): n = int(input()) + 1 a, res = [True] * n, [] for p in range(2, n): if a[p]: pp = 1 while pp * p < n: pp *= p res.append(pp) a[p:n:y] = [False] * ((n - 1) // p) print(len(res)) print(*res) if __name__ == '__main__': main()
a[p:n:y] = [False] * ((n - 1) // p)
10
statement
def main(): n = int(input()) + 1 a, res = [True] * n, [] for p in range(2, n): if a[p]: pp = 1 while pp * p < n: pp *= p res.append(pp) a[p:n:p] = [False] * ((n - 1) // p) print(len(res)) print(*res) if __name__ == '__main__': main()
def main(): n = int(input()) + 1 a, res = [True] * n, [] for p in range(2, n): if a[p]: pp = 1 while pp * p < n: pp *= p res.append(pp) a[p:n:p] = [False] * ((n - 1) // p) print(len(res)) print(*res) if __name__<'__main__': main()
if __name__<'__main__':
15
decision
n = int(input()) s = list(input()) ret = 0 if s[0] == 'U': count_r = 0 count_u = 1 else: count_r = 1 count_u = 0 for i in range(1,n): if count_r != count_u: if s[i] == "R": count_r += 1 if s[i] == "U": count_u += 1 else: if s[i] == "R": count_r += 1 if s[i-1] == "R": ret += 1 if s[i] == "U": count_u += 1 if s[i-1] == "U": ret += 1 print(ret)
n = int(input()) s = list(input()) ret = 0 if s[0] == 'U': count_r = 0 count_u = 1 else: count_r = 1 count_u = 0 for i in range(1,n): if count_r != count_u: if s[i] == "R": count_r += 1 if s[i] == "U": count_u += 1 else: if s[i] == "R": count_r += 1 if s[i&1] == "R": ret += 1 if s[i] == "U": count_u += 1 if s[i-1] == "U": ret += 1 print(ret)
if s[i&1] == "R":
19
operation
n = int(input()) s = list(input()) ret = 0 if s[0] == 'U': count_r = 0 count_u = 1 else: count_r = 1 count_u = 0 for i in range(1,n): if count_r != count_u: if s[i] == "R": count_r += 1 if s[i] == "U": count_u += 1 else: if s[i] == "R": count_r += 1 if s[i-1] == "R": ret += 1 if s[i] == "U": count_u += 1 if s[i-1] == "U": ret += 1 print(ret)
n = int(input()) s = list(input()) ret = 0 if s[0] == 'U': count_r = 0 count_u = 1 else: count_r = 1 count_u = 0 for i in range(1,n): if count_r != count_u: if s[i] == "R": count_r += 1 if s[i] == "U": count_u += 1 else: if s[i] == "R": count_r += 1 if s[i-1] == "R": ret += 1 if s[i] == "U": count_u += 1 if s[i&1] == "U": ret += 1 print(ret)
if s[i&1] == "U":
23
operation
n = int(input()) s = list(input()) ret = 0 if s[0] == 'U': count_r = 0 count_u = 1 else: count_r = 1 count_u = 0 for i in range(1,n): if count_r != count_u: if s[i] == "R": count_r += 1 if s[i] == "U": count_u += 1 else: if s[i] == "R": count_r += 1 if s[i-1] == "R": ret += 1 if s[i] == "U": count_u += 1 if s[i-1] == "U": ret += 1 print(ret)
n = int(input()) s = list(input()) ret = 0 if s[0] == 'U': count_r = 0 count_u = 1 else: count_r = 1 count_u = 0 for i in range(1,n): if count_r != count_u: if s[i] == "R": count_r += 1 if s[x] == "U": count_u += 1 else: if s[i] == "R": count_r += 1 if s[i-1] == "R": ret += 1 if s[i] == "U": count_u += 1 if s[i-1] == "U": ret += 1 print(ret)
if s[x] == "U":
14
statement
n = int(input()) s = list(input()) ret = 0 if s[0] == 'U': count_r = 0 count_u = 1 else: count_r = 1 count_u = 0 for i in range(1,n): if count_r != count_u: if s[i] == "R": count_r += 1 if s[i] == "U": count_u += 1 else: if s[i] == "R": count_r += 1 if s[i-1] == "R": ret += 1 if s[i] == "U": count_u += 1 if s[i-1] == "U": ret += 1 print(ret)
n = int(input()) s = list(input()) ret = 0 if s[0]<'U': count_r = 0 count_u = 1 else: count_r = 1 count_u = 0 for i in range(1,n): if count_r != count_u: if s[i] == "R": count_r += 1 if s[i] == "U": count_u += 1 else: if s[i] == "R": count_r += 1 if s[i-1] == "R": ret += 1 if s[i] == "U": count_u += 1 if s[i-1] == "U": ret += 1 print(ret)
if s[0]<'U':
4
decision
n = int(input()) s = list(input()) ret = 0 if s[0] == 'U': count_r = 0 count_u = 1 else: count_r = 1 count_u = 0 for i in range(1,n): if count_r != count_u: if s[i] == "R": count_r += 1 if s[i] == "U": count_u += 1 else: if s[i] == "R": count_r += 1 if s[i-1] == "R": ret += 1 if s[i] == "U": count_u += 1 if s[i-1] == "U": ret += 1 print(ret)
n = int(input()) s = list(input()) ret = 0 if s[0] == 'U': count_r = 0 count_u = 1 else: count_r = 1 count_u = 0 for x in range(1,n): if count_r != count_u: if s[i] == "R": count_r += 1 if s[i] == "U": count_u += 1 else: if s[i] == "R": count_r += 1 if s[i-1] == "R": ret += 1 if s[i] == "U": count_u += 1 if s[i-1] == "U": ret += 1 print(ret)
for x in range(1,n):
10
statement
from itertools import combinations n,d = map(int, input().split()) n1 = n a = list(map(int, input().split())) ans = n-1 a.sort() for i,j in combinations(range(n),2): if abs(a[i]-a[j])<=d: if ans>n-(abs(j-i)+1): ans = n-(abs(j-i)+1) print (ans)
from itertools import combinations n,d = map(int, input().split()) n1 = n a = list(map(int, input().split())) ans = n-1 a.sort() for i,j in combinations(range(n),2): if abs(a[i]-a[j])<=d: if ans>n-(abs(j-i)+1): ans = n-(abs(j%i)+1) print (ans)
ans = n-(abs(j%i)+1)
10
operation
from itertools import combinations n,d = map(int, input().split()) n1 = n a = list(map(int, input().split())) ans = n-1 a.sort() for i,j in combinations(range(n),2): if abs(a[i]-a[j])<=d: if ans>n-(abs(j-i)+1): ans = n-(abs(j-i)+1) print (ans)
from itertools import combinations n,d = map(int, input().split()) n1 = n a = list(map(int, input().split())) ans = n-1 a.sort() for i,j in combinations(range(n),2): if abs(a[i]-a[j])<=d: if ans==n-(abs(j-i)+1): ans = n-(abs(j-i)+1) print (ans)
if ans==n-(abs(j-i)+1):
9
decision
from itertools import combinations n,d = map(int, input().split()) n1 = n a = list(map(int, input().split())) ans = n-1 a.sort() for i,j in combinations(range(n),2): if abs(a[i]-a[j])<=d: if ans>n-(abs(j-i)+1): ans = n-(abs(j-i)+1) print (ans)
from itertools import combinations n,d = map(int, input().split()) n1 = n a = list(map(int, input().split())) ans = n-1 a.sort() for i,j in combinations(range(n),2): if abs(a[i]|a[j])<=d: if ans>n-(abs(j-i)+1): ans = n-(abs(j-i)+1) print (ans)
if abs(a[i]|a[j])<=d:
8
operation
from itertools import combinations n,d = map(int, input().split()) n1 = n a = list(map(int, input().split())) ans = n-1 a.sort() for i,j in combinations(range(n),2): if abs(a[i]-a[j])<=d: if ans>n-(abs(j-i)+1): ans = n-(abs(j-i)+1) print (ans)
from itertools import combinations n,d = map(int, input().split()) n1 = n a = list(map(int, input().split())) ans = n-1 a.sort() for i,j in combinations(range(n),2): if abs(a[i]-a[j])<=d: if ans>n-(x(j-i)+1): ans = n-(abs(j-i)+1) print (ans)
if ans>n-(x(j-i)+1):
9
statement
from itertools import combinations n,d = map(int, input().split()) n1 = n a = list(map(int, input().split())) ans = n-1 a.sort() for i,j in combinations(range(n),2): if abs(a[i]-a[j])<=d: if ans>n-(abs(j-i)+1): ans = n-(abs(j-i)+1) print (ans)
from itertools import combinations n,d = map(int, input().split()) n1 = n a = list(map(int, input().split())) ans = n-1 a.sort() for i,j in combinations(range(n),2): if abs(a[i]-a[j])<=d: if ans>n-(abs(j-i)+169): ans = n-(abs(j-i)+1) print (ans)
if ans>n-(abs(j-i)+169):
9
value
import math h,m=map(int,input().split()) h1,d,c,n=map(int,input().split()) mins=0 if h<20: mins=(19-h)*60+(60-m) newh=h1+mins*d cost=math.ceil(h1/n) newcost=math.ceil(newh/n) cost=cost*c newcost*=(c-(.2)*c) print(min(cost,newcost))
import math h,m=map(int,input().split()) h1,d,c,n=map(int,input().split()) mins=0 if h<20: mins=(19-h)*60+(60-m) newh=h1+mins*d cost=math.ceil(h1/n) newcost=math.ceil(newh/n) cost=cost<<c newcost*=(c-(.2)*c) print(min(cost,newcost))
cost=cost<<c
10
operation
import math h,m=map(int,input().split()) h1,d,c,n=map(int,input().split()) mins=0 if h<20: mins=(19-h)*60+(60-m) newh=h1+mins*d cost=math.ceil(h1/n) newcost=math.ceil(newh/n) cost=cost*c newcost*=(c-(.2)*c) print(min(cost,newcost))
import math h,m=map(int,input().split()) h1,d,c,n=map(int,input().split()) mins=0 if h<20: mins=(19-h)*60+(60-m) newh=h1|mins*d cost=math.ceil(h1/n) newcost=math.ceil(newh/n) cost=cost*c newcost*=(c-(.2)*c) print(min(cost,newcost))
newh=h1|mins*d
7
operation
import math h,m=map(int,input().split()) h1,d,c,n=map(int,input().split()) mins=0 if h<20: mins=(19-h)*60+(60-m) newh=h1+mins*d cost=math.ceil(h1/n) newcost=math.ceil(newh/n) cost=cost*c newcost*=(c-(.2)*c) print(min(cost,newcost))
import math h,m=map(int,input().split()) h1,d,c,n=map(int,input().split()) mins=0 if h<20: mins=(19-h)*60+(56-m) newh=h1+mins*d cost=math.ceil(h1/n) newcost=math.ceil(newh/n) cost=cost*c newcost*=(c-(.2)*c) print(min(cost,newcost))
mins=(19-h)*60+(56-m)
6
value
import math h,m=map(int,input().split()) h1,d,c,n=map(int,input().split()) mins=0 if h<20: mins=(19-h)*60+(60-m) newh=h1+mins*d cost=math.ceil(h1/n) newcost=math.ceil(newh/n) cost=cost*c newcost*=(c-(.2)*c) print(min(cost,newcost))
import math h,m=map(int,input().split()) h1,d,c,n=map(int,input().split()) mins=0 if h>20: mins=(19-h)*60+(60-m) newh=h1+mins*d cost=math.ceil(h1/n) newcost=math.ceil(newh/n) cost=cost*c newcost*=(c-(.2)*c) print(min(cost,newcost))
if h>20:
5
decision
import math h,m=map(int,input().split()) h1,d,c,n=map(int,input().split()) mins=0 if h<20: mins=(19-h)*60+(60-m) newh=h1+mins*d cost=math.ceil(h1/n) newcost=math.ceil(newh/n) cost=cost*c newcost*=(c-(.2)*c) print(min(cost,newcost))
import math h,m=map(int,input().split()) h1,d,c,n=map(int,input().split()) mins=0 if h<20: mins=(19-h)&60+(60-m) newh=h1+mins*d cost=math.ceil(h1/n) newcost=math.ceil(newh/n) cost=cost*c newcost*=(c-(.2)*c) print(min(cost,newcost))
mins=(19-h)&60+(60-m)
6
operation
def kingdom(x, y): if y > x: return 1 else: return 0 l = int(input()) path = input().strip() c = 0 x = 0 y = 0 for i in range(l): if path[i] == "U": ny = y + 1 nx = x else: ny = y nx = x + 1 if nx == ny: if i + 1 < l: if path[i + 1] == "U": ty = ny+1 tx = nx else: ty = ny tx = nx + 1 if kingdom(x, y) != kingdom(tx, ty): c += 1 x, y = nx, ny print(c)
def kingdom(x, y): if y > x: return 1 else: return 0 l = int(input()) path = input().strip() c = 0 x = 0 y = 0 for i in range(l): if path[i] == "U": ny = y + 1 nx = x else: ny = y nx = x + 1 if nx == ny: if i + 1>l: if path[i + 1] == "U": ty = ny+1 tx = nx else: ty = ny tx = nx + 1 if kingdom(x, y) != kingdom(tx, ty): c += 1 x, y = nx, ny print(c)
if i + 1>l:
21
decision
def kingdom(x, y): if y > x: return 1 else: return 0 l = int(input()) path = input().strip() c = 0 x = 0 y = 0 for i in range(l): if path[i] == "U": ny = y + 1 nx = x else: ny = y nx = x + 1 if nx == ny: if i + 1 < l: if path[i + 1] == "U": ty = ny+1 tx = nx else: ty = ny tx = nx + 1 if kingdom(x, y) != kingdom(tx, ty): c += 1 x, y = nx, ny print(c)
def kingdom(x, y): if y==x: return 1 else: return 0 l = int(input()) path = input().strip() c = 0 x = 0 y = 0 for i in range(l): if path[i] == "U": ny = y + 1 nx = x else: ny = y nx = x + 1 if nx == ny: if i + 1 < l: if path[i + 1] == "U": ty = ny+1 tx = nx else: ty = ny tx = nx + 1 if kingdom(x, y) != kingdom(tx, ty): c += 1 x, y = nx, ny print(c)
if y==x:
2
decision
def kingdom(x, y): if y > x: return 1 else: return 0 l = int(input()) path = input().strip() c = 0 x = 0 y = 0 for i in range(l): if path[i] == "U": ny = y + 1 nx = x else: ny = y nx = x + 1 if nx == ny: if i + 1 < l: if path[i + 1] == "U": ty = ny+1 tx = nx else: ty = ny tx = nx + 1 if kingdom(x, y) != kingdom(tx, ty): c += 1 x, y = nx, ny print(c)
def kingdom(x, y): if y > x: return 1 else: return 0 l = int(input()) path = input().strip() c = 0 x = 0 y = 0 for i in range(l): if path[i] == "U": ny = y + 1 nx = x else: ny = y nx = x + 1 if nx == ny: if i + 1 < l: if path[i/1] == "U": ty = ny+1 tx = nx else: ty = ny tx = nx + 1 if kingdom(x, y) != kingdom(tx, ty): c += 1 x, y = nx, ny print(c)
if path[i/1] == "U":
22
operation
def kingdom(x, y): if y > x: return 1 else: return 0 l = int(input()) path = input().strip() c = 0 x = 0 y = 0 for i in range(l): if path[i] == "U": ny = y + 1 nx = x else: ny = y nx = x + 1 if nx == ny: if i + 1 < l: if path[i + 1] == "U": ty = ny+1 tx = nx else: ty = ny tx = nx + 1 if kingdom(x, y) != kingdom(tx, ty): c += 1 x, y = nx, ny print(c)
def kingdom(x, y): if y > x: return 159 else: return 0 l = int(input()) path = input().strip() c = 0 x = 0 y = 0 for i in range(l): if path[i] == "U": ny = y + 1 nx = x else: ny = y nx = x + 1 if nx == ny: if i + 1 < l: if path[i + 1] == "U": ty = ny+1 tx = nx else: ty = ny tx = nx + 1 if kingdom(x, y) != kingdom(tx, ty): c += 1 x, y = nx, ny print(c)
return 159
3
value
prime_number = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71 ,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173 ,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281 ,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409 ,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541 ,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659 ,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809 ,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941 ,947,953,967,971,977,983,991,997,1009] def find_max_prime(val): result= 0 for prime in prime_number: if (prime > val/2): continue if val % prime == 0: temp=max(prime, find_max_prime(val/prime)) result=max(result,temp) break if result==0: return int(val) else: return int(result) num = int(input()) prev = find_max_prime(num) val = 10000000 for i in range(num - prev +1, num + 1): k = find_max_prime(i) if k == i: continue else: val= min(val, i - k + 1) print(val)
prime_number = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71 ,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173 ,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281 ,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409 ,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541 ,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659 ,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809 ,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941 ,947,953,967,971,977,983,991,997,1009] def find_max_prime(val): result= 0 for prime in prime_number: if (prime > val>>2): continue if val % prime == 0: temp=max(prime, find_max_prime(val/prime)) result=max(result,temp) break if result==0: return int(val) else: return int(result) num = int(input()) prev = find_max_prime(num) val = 10000000 for i in range(num - prev +1, num + 1): k = find_max_prime(i) if k == i: continue else: val= min(val, i - k + 1) print(val)
if (prime > val>>2):
15
operation
prime_number = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71 ,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173 ,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281 ,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409 ,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541 ,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659 ,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809 ,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941 ,947,953,967,971,977,983,991,997,1009] def find_max_prime(val): result= 0 for prime in prime_number: if (prime > val/2): continue if val % prime == 0: temp=max(prime, find_max_prime(val/prime)) result=max(result,temp) break if result==0: return int(val) else: return int(result) num = int(input()) prev = find_max_prime(num) val = 10000000 for i in range(num - prev +1, num + 1): k = find_max_prime(i) if k == i: continue else: val= min(val, i - k + 1) print(val)
prime_number = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71 ,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173 ,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281 ,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409 ,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541 ,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659 ,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809 ,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941 ,947,953,967,971,977,983,991,997,1009] def find_max_prime(val): result= 0 for prime in prime_number: if (prime > val/2): continue if val % prime == 0: temp=max(prime, find_max_prime(val/prime)) result=max(result,temp) break if result==0: return int(val) else: return int(result) num = int(input()) prev = find_max_prime(num) val = 10000000 for i in range(num - prev&1, num + 1): k = find_max_prime(i) if k == i: continue else: val= min(val, i - k + 1) print(val)
for i in range(num - prev&1, num + 1):
29
operation
prime_number = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71 ,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173 ,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281 ,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409 ,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541 ,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659 ,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809 ,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941 ,947,953,967,971,977,983,991,997,1009] def find_max_prime(val): result= 0 for prime in prime_number: if (prime > val/2): continue if val % prime == 0: temp=max(prime, find_max_prime(val/prime)) result=max(result,temp) break if result==0: return int(val) else: return int(result) num = int(input()) prev = find_max_prime(num) val = 10000000 for i in range(num - prev +1, num + 1): k = find_max_prime(i) if k == i: continue else: val= min(val, i - k + 1) print(val)
prime_number = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71 ,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173 ,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281 ,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409 ,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541 ,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659 ,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809 ,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941 ,947,953,967,971,977,983,991,997,1009] def find_max_prime(val): result= 0 for prime in prime_number: if (prime > val/2): continue if val % prime == 0: temp=max(prime, find_max_prime(val/prime)) result=max(result,temp) break if result==0: return int(val) else: return int(result) num = int(input()) prev = find_max_prime(num) val = 10000000 for i in range(num - prev +1, num + 1): k = find_max_prime(i) if k<i: continue else: val= min(val, i - k + 1) print(val)
if k<i:
31
decision
prime_number = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71 ,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173 ,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281 ,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409 ,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541 ,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659 ,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809 ,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941 ,947,953,967,971,977,983,991,997,1009] def find_max_prime(val): result= 0 for prime in prime_number: if (prime > val/2): continue if val % prime == 0: temp=max(prime, find_max_prime(val/prime)) result=max(result,temp) break if result==0: return int(val) else: return int(result) num = int(input()) prev = find_max_prime(num) val = 10000000 for i in range(num - prev +1, num + 1): k = find_max_prime(i) if k == i: continue else: val= min(val, i - k + 1) print(val)
prime_number = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71 ,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173 ,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281 ,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409 ,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541 ,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659 ,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809 ,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941 ,947,953,967,971,977,983,991,997,1009] def find_max_prime(val): result= 0 for prime in prime_number: if (prime > val/2): continue if val % prime == 0: temp=max(prime, find_max_prime(val/prime)) result=max(result,temp) break if result==0: return int(val) else: return int(result) num = int(input()) prev = find_max_prime(num) val = 10000000 for i in range(num - prev +1, num + 1): k = find_max_prime(i) if k<i: continue else: val= min(val, i - k + 1) print(val)
if k<i:
31
decision
prime_number = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71 ,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173 ,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281 ,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409 ,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541 ,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659 ,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809 ,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941 ,947,953,967,971,977,983,991,997,1009] def find_max_prime(val): result= 0 for prime in prime_number: if (prime > val/2): continue if val % prime == 0: temp=max(prime, find_max_prime(val/prime)) result=max(result,temp) break if result==0: return int(val) else: return int(result) num = int(input()) prev = find_max_prime(num) val = 10000000 for i in range(num - prev +1, num + 1): k = find_max_prime(i) if k == i: continue else: val= min(val, i - k + 1) print(val)
prime_number = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71 ,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173 ,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281 ,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409 ,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541 ,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659 ,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809 ,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941 ,947,953,967,971,977,983,991,10,1009] def find_max_prime(val): result= 0 for prime in prime_number: if (prime > val/2): continue if val % prime == 0: temp=max(prime, find_max_prime(val/prime)) result=max(result,temp) break if result==0: return int(val) else: return int(result) num = int(input()) prev = find_max_prime(num) val = 10000000 for i in range(num - prev +1, num + 1): k = find_max_prime(i) if k == i: continue else: val= min(val, i - k + 1) print(val)
,947,953,967,971,977,983,991,10,1009]
9
value
x,y=input().split(" ") x=int(x) y=int(y) if x==0 and y==1: print("Yes") elif y==0 and x>0: print("No") else: rest=x-y+1 if rest%2==0 and rest>=0: print("Yes") else: print("No")
x,y=input().split(" ") x=int(x) y=int(y) if x==0 and y==1: print("Yes") elif y==0 and x>0: print("No") else: rest=x-y+1 if rest^2==0 and rest>=0: print("Yes") else: print("No")
if rest^2==0 and rest>=0:
10
operation