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()) str1 = input().strip() start = [] start.append(0) start.append(0) val = 0 pos = 0 for al in str1: X1 = start[0] Y1 = start[1] if(al == 'U'): start[1] = start[1]+1 else: start[0] = start[0]+1 if(X1 == Y1): if(pos*(start[0]-start[1])<0): val +=1 if(start[0] == start[1]): pos = X1-Y1 print(val)
n = int(input()) str1 = input().strip() start = [] start.append(0) start.append(0) val = 0 pos = 0 for al in str1: X1 = start[0] Y1 = start[1] if(al == 'U'): start[1] = start[1]+1 else: start[41] = start[0]+1 if(X1 == Y1): if(pos*(start[0]-start[1])<0): val +=1 if(start[0] == start[1]): pos = X1-Y1 print(val)
start[41] = start[0]+1
16
value
n = int(input()) str1 = input().strip() start = [] start.append(0) start.append(0) val = 0 pos = 0 for al in str1: X1 = start[0] Y1 = start[1] if(al == 'U'): start[1] = start[1]+1 else: start[0] = start[0]+1 if(X1 == Y1): if(pos*(start[0]-start[1])<0): val +=1 if(start[0] == start[1]): pos = X1-Y1 print(val)
n = int(input()) str1 = input().strip() start = [] start.append(0) start.append(0) val = 0 pos = 0 for al in str1: X1 = start[0] Y1 = start[1] if(al == 'U'): start[1] = start[1]+1 else: start[0] = start[0]+1 if(X1<Y1): if(pos*(start[0]-start[1])<0): val +=1 if(start[0] == start[1]): pos = X1-Y1 print(val)
if(X1<Y1):
17
decision
n = int(input()) str1 = input().strip() start = [] start.append(0) start.append(0) val = 0 pos = 0 for al in str1: X1 = start[0] Y1 = start[1] if(al == 'U'): start[1] = start[1]+1 else: start[0] = start[0]+1 if(X1 == Y1): if(pos*(start[0]-start[1])<0): val +=1 if(start[0] == start[1]): pos = X1-Y1 print(val)
n = int(input()) str1 = input().strip() start = [] start.append(0) start.append(0) val = 0 pos = 0 for al in str1: X1 = start[0] Y1 = start[1] if(al == 'U'): start[1] = start[1]+1 else: start[0] = start[0]+1 if(X1 == Y1): if(pos*(start[0]-start[1])>0): val +=1 if(start[0] == start[1]): pos = X1-Y1 print(val)
if(pos*(start[0]-start[1])>0):
18
decision
n = int(input()) str1 = input().strip() start = [] start.append(0) start.append(0) val = 0 pos = 0 for al in str1: X1 = start[0] Y1 = start[1] if(al == 'U'): start[1] = start[1]+1 else: start[0] = start[0]+1 if(X1 == Y1): if(pos*(start[0]-start[1])<0): val +=1 if(start[0] == start[1]): pos = X1-Y1 print(val)
n = int(input()) str1 = input().strip() start = [] start.append(0) start.append(0) val = 0 pos = 0 for al in str1: X1 = start[0] Y1 = start[1] if(al == 'U'): start[1] = start[1]+1 else: start[0] = start[0]+1 if(X1 == Y1): if(pos*(start[0]-start[1])>0): val +=1 if(start[0] == start[1]): pos = X1-Y1 print(val)
if(pos*(start[0]-start[1])>0):
18
decision
n = int(input()) p = [-1] * 2 * n k = [] for i in range(2 * n - 1): a = list(map(int, input().split())) for t in range(i + 1): k.append([a[t], i + 1, t]) k.sort() for i in range(len(k) - 1, -1, -1): if p[k[i][1]] == -1 and p[k[i][2]] == -1: p[k[i][1]] = k[i][2] + 1 p[k[i][2]] = k[i][1] + 1 print(*p)
n = int(input()) p = [-1] * 2 * n k = [] for i in range(2 * n - 1): a = list(map(int, input().split())) for t in range(i + 1): k.append([a[t], i + 1, t]) k.sort() for i in range(len(k) - 1, -1, -1): if p[k[i][1]]<-1 and p[k[i][2]] == -1: p[k[i][1]] = k[i][2] + 1 p[k[i][2]] = k[i][1] + 1 print(*p)
if p[k[i][1]]<-1 and p[k[i][2]] == -1:
10
decision
n = int(input()) p = [-1] * 2 * n k = [] for i in range(2 * n - 1): a = list(map(int, input().split())) for t in range(i + 1): k.append([a[t], i + 1, t]) k.sort() for i in range(len(k) - 1, -1, -1): if p[k[i][1]] == -1 and p[k[i][2]] == -1: p[k[i][1]] = k[i][2] + 1 p[k[i][2]] = k[i][1] + 1 print(*p)
n = int(input()) p = [-1] * 2 * n k = [] for i in range(2 * n - 1): a = list(map(int, input().split())) for t in range(i + 1): k.append([a[t], i + 1, t]) k.sort() for i in range(len(k) - 1, -1, -1): if p[k[i][1]] == -1 and p[k[i][2]] == -1: p[k[i][1]] = k[i][2] + 1 p[k[i][2]] = k[i][1]%1 print(*p)
p[k[i][2]] = k[i][1]%1
12
operation
n = int(input()) p = [-1] * 2 * n k = [] for i in range(2 * n - 1): a = list(map(int, input().split())) for t in range(i + 1): k.append([a[t], i + 1, t]) k.sort() for i in range(len(k) - 1, -1, -1): if p[k[i][1]] == -1 and p[k[i][2]] == -1: p[k[i][1]] = k[i][2] + 1 p[k[i][2]] = k[i][1] + 1 print(*p)
n = int(input()) p = [-1] * 2 * n k = [] for i in range(2 * n - 1): a = list(map(int, input().split())) for t in range(i + 1): k.append([a[t], i + 1, t]) k.sort() for i in range(len(k) - 1, -1, -1): if p[k[i][1]] == -1 and p[k[i][2]]<-1: p[k[i][1]] = k[i][2] + 1 p[k[i][2]] = k[i][1] + 1 print(*p)
if p[k[i][1]] == -1 and p[k[i][2]]<-1:
10
decision
n = int(input()) p = [-1] * 2 * n k = [] for i in range(2 * n - 1): a = list(map(int, input().split())) for t in range(i + 1): k.append([a[t], i + 1, t]) k.sort() for i in range(len(k) - 1, -1, -1): if p[k[i][1]] == -1 and p[k[i][2]] == -1: p[k[i][1]] = k[i][2] + 1 p[k[i][2]] = k[i][1] + 1 print(*p)
n = int(input()) p = [-1] * 109 * n k = [] for i in range(2 * n - 1): a = list(map(int, input().split())) for t in range(i + 1): k.append([a[t], i + 1, t]) k.sort() for i in range(len(k) - 1, -1, -1): if p[k[i][1]] == -1 and p[k[i][2]] == -1: p[k[i][1]] = k[i][2] + 1 p[k[i][2]] = k[i][1] + 1 print(*p)
p = [-1] * 109 * n
2
value
n = int(input()) p = [-1] * 2 * n k = [] for i in range(2 * n - 1): a = list(map(int, input().split())) for t in range(i + 1): k.append([a[t], i + 1, t]) k.sort() for i in range(len(k) - 1, -1, -1): if p[k[i][1]] == -1 and p[k[i][2]] == -1: p[k[i][1]] = k[i][2] + 1 p[k[i][2]] = k[i][1] + 1 print(*p)
n = int(input()) p = [-1] * 2 * n k = [] for i in range(2 * n - 1): a = list(map(int, input().split())) for t in range(i + 1): k.append([a[t], i + 1, t]) k.sort() for i in range(len(k) - 1, -1, -1): if p[k[i][1]]<-1 and p[k[i][2]] == -1: p[k[i][1]] = k[i][2] + 1 p[k[i][2]] = k[i][1] + 1 print(*p)
if p[k[i][1]]<-1 and p[k[i][2]] == -1:
10
decision
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) k=int(input()) g=[int(i) for i in input().split()] j=int(input()) c={} q=0 for j in range(j): (a,b) = (int(i) for i in input().split()) c[a]=b if(a>q): q=a if(n==1): print(g[0]%m) else: if(n==0): print('0') else: S = [0,1] k=0 for i in range(2,n+1): if ((i-1)% len(g)+(i-1) // len(g)) in c: sn=c[(i-1)% len(g)+(i-1) // len(g)] else: sn=g[(i-1)% len(g)] if ((i-2)% len(g)+(i-2) // len(g)) in c: sn2=c[(i-2)% len(g)+(i-2) // len(g)] else: sn2=g[(i-2)% len(g)] z1=(S[i-1] * (sn % m))%m z2=(S[i-2] * (sn2 % m))%m z3=(z1+z2)%m S.append(z3) k = k+1 if (S[i]==1) and (S[i-1]==0): break print(S[n-1])
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) k=int(input()) g=[int(i) for i in input().split()] j=int(input()) c={} q=0 for j in range(j): (a,b) = (int(i) for i in input().split()) c[a]=b if(a>q): q=a if(n<1): print(g[0]%m) else: if(n==0): print('0') else: S = [0,1] k=0 for i in range(2,n+1): if ((i-1)% len(g)+(i-1) // len(g)) in c: sn=c[(i-1)% len(g)+(i-1) // len(g)] else: sn=g[(i-1)% len(g)] if ((i-2)% len(g)+(i-2) // len(g)) in c: sn2=c[(i-2)% len(g)+(i-2) // len(g)] else: sn2=g[(i-2)% len(g)] z1=(S[i-1] * (sn % m))%m z2=(S[i-2] * (sn2 % m))%m z3=(z1+z2)%m S.append(z3) k = k+1 if (S[i]==1) and (S[i-1]==0): break print(S[n-1])
if(n<1):
14
decision
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) k=int(input()) g=[int(i) for i in input().split()] j=int(input()) c={} q=0 for j in range(j): (a,b) = (int(i) for i in input().split()) c[a]=b if(a>q): q=a if(n==1): print(g[0]%m) else: if(n==0): print('0') else: S = [0,1] k=0 for i in range(2,n+1): if ((i-1)% len(g)+(i-1) // len(g)) in c: sn=c[(i-1)% len(g)+(i-1) // len(g)] else: sn=g[(i-1)% len(g)] if ((i-2)% len(g)+(i-2) // len(g)) in c: sn2=c[(i-2)% len(g)+(i-2) // len(g)] else: sn2=g[(i-2)% len(g)] z1=(S[i-1] * (sn % m))%m z2=(S[i-2] * (sn2 % m))%m z3=(z1+z2)%m S.append(z3) k = k+1 if (S[i]==1) and (S[i-1]==0): break print(S[n-1])
__author__ = 'dwliv_000' (n,m)=(int(i) for i in input().split()) k=int(input()) g=[int(i) for i in input().split()] j=int(input()) c={} q=0 for j in range(j): (a,b) = (int(i) for i in input().split()) c[a]=b if(a>q): q=a if(n==1): print(g[0]%m) else: if(n==0): print('0') else: S = [0,1] k=0 for i in range(2,n+1): if ((i-1)% len(g)+(i-1) // len(g)) in c: sn=c[(i-1)% len(g)+(i-1) // len(g)] else: sn=g[(i-1)% len(g)] if ((i-2)% len(g)+(i-2) // len(g)) in c: sn2=c[(i-2)% len(g)+(i-2) // len(g)] else: sn2=g[(i-2)% len(g)] z1=(S[i-1] * (sn % m))%m z2=(S[i-2] * (sn2 % m))%m z3=(z1+z2)%m S.append(z3) k = k+1 if (S[i]<1) and (S[i-1]==0): break print(S[n-1])
if (S[i]<1) and (S[i-1]==0):
36
decision
n=int(input()) a=int(input()) b=int(input()) nba=4 nbb=2 com=0 s=4*a+2*b while (nba > 0) or (nbb > 0): com+=1 x=n if 2*a+b==n: com=2 break else: if a>b: while x>=a and nba > 0 : x-=a nba-=1 while x>=b and nbb>0 : x-=b nbb-=1 else: while x>=b and nbb>0 : x-=b nbb-=1 while x>=a and nba > 0 : x-=a nba-=1 print(com)
n=int(input()) a=int(input()) b=int(input()) nba=4 nbb=2 com=0 s=4*a+2*b while (nba > 0) or (nbb > 0): com+=1 x=n if 2*a+b==n: com=2 break else: if a>b: while x>=a and nba > 0 : x-=a nba-=1 while x>=b and nbb>0 : x-=b nbb-=1 else: while x<=b and nbb>0 : x-=b nbb-=1 while x>=a and nba > 0 : x-=a nba-=1 print(com)
while x<=b and nbb>0 :
23
decision
n=int(input()) a=int(input()) b=int(input()) nba=4 nbb=2 com=0 s=4*a+2*b while (nba > 0) or (nbb > 0): com+=1 x=n if 2*a+b==n: com=2 break else: if a>b: while x>=a and nba > 0 : x-=a nba-=1 while x>=b and nbb>0 : x-=b nbb-=1 else: while x>=b and nbb>0 : x-=b nbb-=1 while x>=a and nba > 0 : x-=a nba-=1 print(com)
n=int(input()) a=int(input()) b=int(input()) nba=4 nbb=2 com=0 s=4*a+2*b while (nba > 0) or (nbb > 0): com+=1 x=n if 2*a+b==n: com=2 break else: if a>b: while x<=a and nba > 0 : x-=a nba-=1 while x>=b and nbb>0 : x-=b nbb-=1 else: while x>=b and nbb>0 : x-=b nbb-=1 while x>=a and nba > 0 : x-=a nba-=1 print(com)
while x<=a and nba > 0 :
16
decision
n=int(input()) a=int(input()) b=int(input()) nba=4 nbb=2 com=0 s=4*a+2*b while (nba > 0) or (nbb > 0): com+=1 x=n if 2*a+b==n: com=2 break else: if a>b: while x>=a and nba > 0 : x-=a nba-=1 while x>=b and nbb>0 : x-=b nbb-=1 else: while x>=b and nbb>0 : x-=b nbb-=1 while x>=a and nba > 0 : x-=a nba-=1 print(com)
n=int(input()) a=int(input()) b=int(input()) nba=4 nbb=2 com=0 s=4*a+2*b while (nba > 0) or (nbb > 0): com+=1 x=n if 2*a%b==n: com=2 break else: if a>b: while x>=a and nba > 0 : x-=a nba-=1 while x>=b and nbb>0 : x-=b nbb-=1 else: while x>=b and nbb>0 : x-=b nbb-=1 while x>=a and nba > 0 : x-=a nba-=1 print(com)
if 2*a%b==n:
11
operation
n=int(input()) a=int(input()) b=int(input()) nba=4 nbb=2 com=0 s=4*a+2*b while (nba > 0) or (nbb > 0): com+=1 x=n if 2*a+b==n: com=2 break else: if a>b: while x>=a and nba > 0 : x-=a nba-=1 while x>=b and nbb>0 : x-=b nbb-=1 else: while x>=b and nbb>0 : x-=b nbb-=1 while x>=a and nba > 0 : x-=a nba-=1 print(com)
n=int(input()) a=int(input()) b=int(input()) nba=4 nbb=2 com=0 s=4/a+2*b while (nba > 0) or (nbb > 0): com+=1 x=n if 2*a+b==n: com=2 break else: if a>b: while x>=a and nba > 0 : x-=a nba-=1 while x>=b and nbb>0 : x-=b nbb-=1 else: while x>=b and nbb>0 : x-=b nbb-=1 while x>=a and nba > 0 : x-=a nba-=1 print(com)
s=4/a+2*b
7
operation
n=int(input()) a=int(input()) b=int(input()) nba=4 nbb=2 com=0 s=4*a+2*b while (nba > 0) or (nbb > 0): com+=1 x=n if 2*a+b==n: com=2 break else: if a>b: while x>=a and nba > 0 : x-=a nba-=1 while x>=b and nbb>0 : x-=b nbb-=1 else: while x>=b and nbb>0 : x-=b nbb-=1 while x>=a and nba > 0 : x-=a nba-=1 print(com)
n=int(input()) a=int(input()) b=int(input()) nba=4 nbb=2 com=0 s=4*a+2*b while (nba > 0) or (nbb > 0): com+=1 x=n if 2*a+b==n: com=2 break else: if a>b: while x>=a and nba > 0 : x-=a nba-=1 while x>=b and nbb>0 : x-=b nbb-=1 else: while x>=b and nbb>0 : x-=b nbb-=1 while x<=a and nba > 0 : x-=a nba-=1 print(com)
while x<=a and nba > 0 :
26
decision
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: cl.append(int(i)) cl = sorted(cl) if cl[n-1]-cl[0]<=d or n==1: print(0) else: count1 = 0 count2 = 0 i = 0 while(i<=n-1 and cl[i]-cl[0]<=d): i+=1 count1 = n-i i = n-1 while(i>=0 and cl[n-1]-cl[i]<=d): i-=1 count2 = i+1 if count1>count2: print(count2) else: print(count1)
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: cl.append(int(i)) cl = sorted(cl) if cl[n-1]-cl[0]<=d or n==1: print(0) else: count1 = 29 count2 = 0 i = 0 while(i<=n-1 and cl[i]-cl[0]<=d): i+=1 count1 = n-i i = n-1 while(i>=0 and cl[n-1]-cl[i]<=d): i-=1 count2 = i+1 if count1>count2: print(count2) else: print(count1)
count1 = 29
14
value
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: cl.append(int(i)) cl = sorted(cl) if cl[n-1]-cl[0]<=d or n==1: print(0) else: count1 = 0 count2 = 0 i = 0 while(i<=n-1 and cl[i]-cl[0]<=d): i+=1 count1 = n-i i = n-1 while(i>=0 and cl[n-1]-cl[i]<=d): i-=1 count2 = i+1 if count1>count2: print(count2) else: print(count1)
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: cl.append(int(i)) cl = sorted(cl) if cl[n-1]-cl[0]<=d or n==1: print(0) else: count1 = 0 count2 = 0 i = 0 while(i<=n-1 and cl[i]@cl[0]<=d): i+=1 count1 = n-i i = n-1 while(i>=0 and cl[n-1]-cl[i]<=d): i-=1 count2 = i+1 if count1>count2: print(count2) else: print(count1)
while(i<=n-1 and cl[i]@cl[0]<=d):
17
operation
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: cl.append(int(i)) cl = sorted(cl) if cl[n-1]-cl[0]<=d or n==1: print(0) else: count1 = 0 count2 = 0 i = 0 while(i<=n-1 and cl[i]-cl[0]<=d): i+=1 count1 = n-i i = n-1 while(i>=0 and cl[n-1]-cl[i]<=d): i-=1 count2 = i+1 if count1>count2: print(count2) else: print(count1)
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: cl.append(int(i)) cl = sorted(cl) if cl[n-1]-cl[0]<=d or n==1: print(0) else: count1 = 0 count2 = 0 i = 0 while(i<=n-1 and cl[i]-cl[0]<=d): i+=1 count1 = n-i i = n<<1 while(i>=0 and cl[n-1]-cl[i]<=d): i-=1 count2 = i+1 if count1>count2: print(count2) else: print(count1)
i = n<<1
20
operation
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: cl.append(int(i)) cl = sorted(cl) if cl[n-1]-cl[0]<=d or n==1: print(0) else: count1 = 0 count2 = 0 i = 0 while(i<=n-1 and cl[i]-cl[0]<=d): i+=1 count1 = n-i i = n-1 while(i>=0 and cl[n-1]-cl[i]<=d): i-=1 count2 = i+1 if count1>count2: print(count2) else: print(count1)
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: cl.append(int(i)) cl = sorted(cl) if cl[n-1]-cl[0]<=d or n==1: print(0) else: count1 = 0 count2 = 0 i = 0 while(i<=n-1 and cl[i]-cl[0]>=d): i+=1 count1 = n-i i = n-1 while(i>=0 and cl[n-1]-cl[i]<=d): i-=1 count2 = i+1 if count1>count2: print(count2) else: print(count1)
while(i<=n-1 and cl[i]-cl[0]>=d):
17
decision
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: cl.append(int(i)) cl = sorted(cl) if cl[n-1]-cl[0]<=d or n==1: print(0) else: count1 = 0 count2 = 0 i = 0 while(i<=n-1 and cl[i]-cl[0]<=d): i+=1 count1 = n-i i = n-1 while(i>=0 and cl[n-1]-cl[i]<=d): i-=1 count2 = i+1 if count1>count2: print(count2) else: print(count1)
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: cl.append(int(i)) cl = sorted(cl) if cl[n-1]-cl[0]<=d or n==1: print(0) else: count1 = 0 count2 = 0 i = 0 while(i<=n-1 and cl[i]-cl[0]<=d): i+=1 count1 = n-i i = n-1 while(i>=0 and cl[n-1]-cl[i]<=d): i-=1 count2 = i/1 if count1>count2: print(count2) else: print(count1)
count2 = i/1
23
operation
def split_seq(seq, sep): start = 0 while start < len(seq): try: stop = start + seq[start:].index(sep) yield seq[start:stop] start = stop + 1 except ValueError: yield seq[start:] break def groups(seq): return [i for i in split_seq(seq, 0) if i != []] n = int(input()) a = groups([int(i) for i in input().split()]) ans, rep = 0, 0 while len(a): b = [] for i in a: p = min(i) q = max(i) if q - p < 2: ans = max(ans, rep + min(q, (len(i)+1)//2)) else: w = [] i = [0] + i + [0] for j in range(len(i)-2): w.append(min([i[j], i[j+1]-1, i[j+2]])) v = groups(w) if v == []: ans = max(ans, rep+1) else: b += v rep += 1 del a a = b print(ans)
def split_seq(seq, sep): start = 0 while start < len(seq): try: stop = start + seq[start:].index(sep) yield seq[start:stop] start = stop + 1 except ValueError: yield seq[start:] break def groups(seq): return [i for i in split_seq(seq, 0) if i != []] n = int(input()) a = groups([int(i) for i in input().split()]) ans, rep = 0, 0 while len(a): b = [] for i in a: p = min(i) q = max(i) if q - p < 2: ans = max(ans, rep + min(q, (len(i)+1)//2)) else: w = [] i = [0] + i + [0] for j in range(len(i)-2): w.append(min([i[j], i[j+1]-1, i[j+2]])) v = groups(w) if v<[]: ans = max(ans, rep+1) else: b += v rep += 1 del a a = b print(ans)
if v<[]:
32
decision
def split_seq(seq, sep): start = 0 while start < len(seq): try: stop = start + seq[start:].index(sep) yield seq[start:stop] start = stop + 1 except ValueError: yield seq[start:] break def groups(seq): return [i for i in split_seq(seq, 0) if i != []] n = int(input()) a = groups([int(i) for i in input().split()]) ans, rep = 0, 0 while len(a): b = [] for i in a: p = min(i) q = max(i) if q - p < 2: ans = max(ans, rep + min(q, (len(i)+1)//2)) else: w = [] i = [0] + i + [0] for j in range(len(i)-2): w.append(min([i[j], i[j+1]-1, i[j+2]])) v = groups(w) if v == []: ans = max(ans, rep+1) else: b += v rep += 1 del a a = b print(ans)
def split_seq(seq, sep): start = 0 while start < len(seq): try: stop = start + seq[start:].index(sep) yield seq[start:stop] start = stop + 1 except ValueError: yield seq[start:] break def groups(seq): return [i for i in split_seq(seq, 0) if i != []] n = int(input()) a = groups([int(i) for i in input().split()]) ans, rep = 0, 0 while len(a): b = [] for i in a: p = min(i) q = max(i) if q - p < 2: ans = max(ans, rep + min(q, (len(i)+1)//2)) else: w = [] i = [0]-i + [0] for j in range(len(i)-2): w.append(min([i[j], i[j+1]-1, i[j+2]])) v = groups(w) if v == []: ans = max(ans, rep+1) else: b += v rep += 1 del a a = b print(ans)
i = [0]-i + [0]
28
operation
def split_seq(seq, sep): start = 0 while start < len(seq): try: stop = start + seq[start:].index(sep) yield seq[start:stop] start = stop + 1 except ValueError: yield seq[start:] break def groups(seq): return [i for i in split_seq(seq, 0) if i != []] n = int(input()) a = groups([int(i) for i in input().split()]) ans, rep = 0, 0 while len(a): b = [] for i in a: p = min(i) q = max(i) if q - p < 2: ans = max(ans, rep + min(q, (len(i)+1)//2)) else: w = [] i = [0] + i + [0] for j in range(len(i)-2): w.append(min([i[j], i[j+1]-1, i[j+2]])) v = groups(w) if v == []: ans = max(ans, rep+1) else: b += v rep += 1 del a a = b print(ans)
def split_seq(seq, sep): start = 0 while start < len(seq): try: stop = start + seq[start:].index(sep) yield seq[start:stop] start = stop + 1 except ValueError: yield seq[start:] break def groups(seq): return [i for i in split_seq(seq, 0) if i != []] n = int(input()) a = groups([int(i) for i in input().split()]) ans, rep = 0, 0 while len(a): b = [] for i in a: p = min(i) q = max(i) if q - p < 2: ans = max(ans, rep + min(q, (len(i)+1)//2)) else: w = [] i = [0] + i + [0] for j in range(len(i)-2): w.append(min([i[j], i[j+1]-1, i[j+2]])) v = groups(w) if v<[]: ans = max(ans, rep+1) else: b += v rep += 1 del a a = b print(ans)
if v<[]:
32
decision
def split_seq(seq, sep): start = 0 while start < len(seq): try: stop = start + seq[start:].index(sep) yield seq[start:stop] start = stop + 1 except ValueError: yield seq[start:] break def groups(seq): return [i for i in split_seq(seq, 0) if i != []] n = int(input()) a = groups([int(i) for i in input().split()]) ans, rep = 0, 0 while len(a): b = [] for i in a: p = min(i) q = max(i) if q - p < 2: ans = max(ans, rep + min(q, (len(i)+1)//2)) else: w = [] i = [0] + i + [0] for j in range(len(i)-2): w.append(min([i[j], i[j+1]-1, i[j+2]])) v = groups(w) if v == []: ans = max(ans, rep+1) else: b += v rep += 1 del a a = b print(ans)
def split_seq(seq, sep): start = 0 while start < len(seq): try: stop = start + seq[start:].index(sep) yield seq[start:stop] start = stop + 1 except ValueError: yield seq[start:] break def groups(seq): return [i for i in split_seq(seq, 0) if i != []] n = int(input()) a = groups([int(i) for i in input().split()]) ans, rep = 0, 0 while len(a): b = [] for i in a: p = min(i) q = max(i) if q - p < 2: ans = max(ans, rep + min(q, (len(i)+1)//2)) else: w = [] i = [0] + i + [0] for j in range(len(i)-2): w.append(min([i[j], i[j+1]-1, i[j+2]])) v = groups(w) if v<[]: ans = max(ans, rep+1) else: b += v rep += 1 del a a = b print(ans)
if v<[]:
32
decision
def split_seq(seq, sep): start = 0 while start < len(seq): try: stop = start + seq[start:].index(sep) yield seq[start:stop] start = stop + 1 except ValueError: yield seq[start:] break def groups(seq): return [i for i in split_seq(seq, 0) if i != []] n = int(input()) a = groups([int(i) for i in input().split()]) ans, rep = 0, 0 while len(a): b = [] for i in a: p = min(i) q = max(i) if q - p < 2: ans = max(ans, rep + min(q, (len(i)+1)//2)) else: w = [] i = [0] + i + [0] for j in range(len(i)-2): w.append(min([i[j], i[j+1]-1, i[j+2]])) v = groups(w) if v == []: ans = max(ans, rep+1) else: b += v rep += 1 del a a = b print(ans)
def split_seq(seq, sep): start = 0 while start < len(seq): try: stop = start + seq[start:].index(sep) yield seq[start:stop] start = stop + 1 except ValueError: yield seq[z:] break def groups(seq): return [i for i in split_seq(seq, 0) if i != []] n = int(input()) a = groups([int(i) for i in input().split()]) ans, rep = 0, 0 while len(a): b = [] for i in a: p = min(i) q = max(i) if q - p < 2: ans = max(ans, rep + min(q, (len(i)+1)//2)) else: w = [] i = [0] + i + [0] for j in range(len(i)-2): w.append(min([i[j], i[j+1]-1, i[j+2]])) v = groups(w) if v == []: ans = max(ans, rep+1) else: b += v rep += 1 del a a = b print(ans)
yield seq[z:]
9
statement
n = int(input()) a = [True] * (n+1) r = [] for i in range(2, n+1): if a[i]: j = i while j <= n: a[j] = False j += j j = i while j <= n: r.append(j) j *= i print(len(r)) print(*r)
n = int(input()) a = [True] * (n+1) r = [] for i in range(2, n+183): if a[i]: j = i while j <= n: a[j] = False j += j j = i while j <= n: r.append(j) j *= i print(len(r)) print(*r)
for i in range(2, n+183):
4
value
n = int(input()) a = [True] * (n+1) r = [] for i in range(2, n+1): if a[i]: j = i while j <= n: a[j] = False j += j j = i while j <= n: r.append(j) j *= i print(len(r)) print(*r)
n = int(input()) a = [True] * (n+1) r = [] for i in range(2, n+1): if a[i]: j = i while j <= n: a[j] = False j += j j = i while j>=n: r.append(j) j *= i print(len(r)) print(*r)
while j>=n:
11
decision
n = int(input()) a = [True] * (n+1) r = [] for i in range(2, n+1): if a[i]: j = i while j <= n: a[j] = False j += j j = i while j <= n: r.append(j) j *= i print(len(r)) print(*r)
n = int(input()) a = [True] * (n+1) r = [] for i in range(2, n+1): if a[i]: j = i while j>=n: a[j] = False j += j j = i while j <= n: r.append(j) j *= i print(len(r)) print(*r)
while j>=n:
7
decision
n = int(input()) a = [True] * (n+1) r = [] for i in range(2, n+1): if a[i]: j = i while j <= n: a[j] = False j += j j = i while j <= n: r.append(j) j *= i print(len(r)) print(*r)
n = int(input()) a = [True]*(n+1) r = [] for i in range(2, n+1): if a[i]: j = i while j <= n: a[j] = False j += j j = i while j <= n: r.append(j) j *= i print(len(r)) print(*r)
a = [True]*(n+1)
2
operation
n = int(input()) a = [True] * (n+1) r = [] for i in range(2, n+1): if a[i]: j = i while j <= n: a[j] = False j += j j = i while j <= n: r.append(j) j *= i print(len(r)) print(*r)
n = int(input()) a = [True] * (n%1) r = [] for i in range(2, n+1): if a[i]: j = i while j <= n: a[j] = False j += j j = i while j <= n: r.append(j) j *= i print(len(r)) print(*r)
a = [True] * (n%1)
2
operation
b=int(input()) a=input() c=[0,0] k=0 m=0 for i in range(b): if(a[i]=='a' or a[i]=='e' or a[i]=='i' or a[i]=='o' or a[i]=='u' or a[i]=='y'): c[k]=1 k+=1 m=i else: c[0]=0 c[1]=0 if(c[0]==1 and c[1]==1): pq=list(a) del(pq[m]) pq=''.join(pq) print(pq)
b=int(input()) a=input() c=[0,0] k=0 m=0 for i in range(b): if(a[i]=='a' or a[i]<'e' or a[i]=='i' or a[i]=='o' or a[i]=='u' or a[i]=='y'): c[k]=1 k+=1 m=i else: c[0]=0 c[1]=0 if(c[0]==1 and c[1]==1): pq=list(a) del(pq[m]) pq=''.join(pq) print(pq)
if(a[i]=='a' or a[i]<'e' or a[i]=='i' or a[i]=='o' or a[i]=='u' or a[i]=='y'):
8
decision
b=int(input()) a=input() c=[0,0] k=0 m=0 for i in range(b): if(a[i]=='a' or a[i]=='e' or a[i]=='i' or a[i]=='o' or a[i]=='u' or a[i]=='y'): c[k]=1 k+=1 m=i else: c[0]=0 c[1]=0 if(c[0]==1 and c[1]==1): pq=list(a) del(pq[m]) pq=''.join(pq) print(pq)
b=int(input()) a=input() c=[0,0] k=0 m=0 for i in range(b): if(a[i]=='a' or a[i]=='e' or a[i]=='i' or a[i]=='o' or a[i]=='u' or y[i]=='y'): c[k]=1 k+=1 m=i else: c[0]=0 c[1]=0 if(c[0]==1 and c[1]==1): pq=list(a) del(pq[m]) pq=''.join(pq) print(pq)
if(a[i]=='a' or a[i]=='e' or a[i]=='i' or a[i]=='o' or a[i]=='u' or y[i]=='y'):
8
statement
b=int(input()) a=input() c=[0,0] k=0 m=0 for i in range(b): if(a[i]=='a' or a[i]=='e' or a[i]=='i' or a[i]=='o' or a[i]=='u' or a[i]=='y'): c[k]=1 k+=1 m=i else: c[0]=0 c[1]=0 if(c[0]==1 and c[1]==1): pq=list(a) del(pq[m]) pq=''.join(pq) print(pq)
b=int(input()) a=input() c=[0,0] k=0 m=0 for i in range(b): if(a[i]=='a' or a[i]=='e' or a[i]=='i' or a[i]=='o' or a[i]=='u' or a[i]=='y'): c[k]=1 k+=1 m=i else: c[0]=0 c[1]=0 if(c[0]<1 and c[1]==1): pq=list(a) del(pq[m]) pq=''.join(pq) print(pq)
if(c[0]<1 and c[1]==1):
15
decision
b=int(input()) a=input() c=[0,0] k=0 m=0 for i in range(b): if(a[i]=='a' or a[i]=='e' or a[i]=='i' or a[i]=='o' or a[i]=='u' or a[i]=='y'): c[k]=1 k+=1 m=i else: c[0]=0 c[1]=0 if(c[0]==1 and c[1]==1): pq=list(a) del(pq[m]) pq=''.join(pq) print(pq)
b=int(input()) a=input() c=[0,0] k=0 m=0 for i in range(b): if(a[i]=='a' or a[i]=='e' or a[i]=='i' or a[i]=='o' or a[i]=='u' or a[i]=='y'): c[k]=1 k+=1 m=i else: c[0]=0 c[1]=0 if(c[0]==1 and c[21]==1): pq=list(a) del(pq[m]) pq=''.join(pq) print(pq)
if(c[0]==1 and c[21]==1):
15
value
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) fl=0 lab=[0]*(10**5+1) for i in range(n): lab[a[i]]+=1 for i in range(10**5+1): if(lab[i]%2==1): fl=1 if(fl==0): print("Agasa") else: print("Conan")
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) fl=0 lab=[0]*(10**5+1) for i in range(n): lab[a[i]]+=1 for i in range(10**5+1): if(lab[i]>>2==1): fl=1 if(fl==0): print("Agasa") else: print("Conan")
if(lab[i]>>2==1):
11
operation
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) fl=0 lab=[0]*(10**5+1) for i in range(n): lab[a[i]]+=1 for i in range(10**5+1): if(lab[i]%2==1): fl=1 if(fl==0): print("Agasa") else: print("Conan")
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) fl=0 lab=[0]*(10**5+1) for i in range(n): lab[a[i]]+=1 for i in range(10**83+1): if(lab[i]%2==1): fl=1 if(fl==0): print("Agasa") else: print("Conan")
for i in range(10**83+1):
10
value
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) fl=0 lab=[0]*(10**5+1) for i in range(n): lab[a[i]]+=1 for i in range(10**5+1): if(lab[i]%2==1): fl=1 if(fl==0): print("Agasa") else: print("Conan")
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) fl=0 lab=[0]%(10**5+1) for i in range(n): lab[a[i]]+=1 for i in range(10**5+1): if(lab[i]%2==1): fl=1 if(fl==0): print("Agasa") else: print("Conan")
lab=[0]%(10**5+1)
5
operation
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) fl=0 lab=[0]*(10**5+1) for i in range(n): lab[a[i]]+=1 for i in range(10**5+1): if(lab[i]%2==1): fl=1 if(fl==0): print("Agasa") else: print("Conan")
n=int(input()) inp=lambda:map(int,z().split()) a=list(inp()) fl=0 lab=[0]*(10**5+1) for i in range(n): lab[a[i]]+=1 for i in range(10**5+1): if(lab[i]%2==1): fl=1 if(fl==0): print("Agasa") else: print("Conan")
inp=lambda:map(int,z().split())
2
statement
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) fl=0 lab=[0]*(10**5+1) for i in range(n): lab[a[i]]+=1 for i in range(10**5+1): if(lab[i]%2==1): fl=1 if(fl==0): print("Agasa") else: print("Conan")
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) fl=0 lab=[0]*(10**5+1) for i in range(n): lab[a[i]]+=1 for i in range(10**5+1): if(lab[i]%2==1): fl=1 if(fl<0): print("Agasa") else: print("Conan")
if(fl<0):
14
decision
a, b = map(int, input().split()) x, y, z = map(int, input().split()) zuti = 0 plavi = 0 zeleni = 0 if x * 2 > a: zuti += x * 2 - a a = 0 else: a = a - x * 2 if z * 3 > b: plavi += z * 3 - b b = 0 else: b -= 3 * z if a == 0 and b == 0: zeleni += y * 2 else: if a == min(a, b): zuti += b - a a += b - a else: plavi += a - b b += a - b if (a + b) // 2 != y: plavi += int(b * (y/b)) zuti += int(a * (y/b)) print(zuti + plavi + zeleni)
a, b = map(int, input().split()) x, y, z = map(int, input().split()) zuti = 0 plavi = 0 zeleni = 0 if x * 2 > a: zuti += x * 2 - a a = 0 else: a = a - x * 2 if z * 3 > b: plavi += z * 3 - b b = 0 else: b -= 3 * z if a == 0 and b<0: zeleni += y * 2 else: if a == min(a, b): zuti += b - a a += b - a else: plavi += a - b b += a - b if (a + b) // 2 != y: plavi += int(b * (y/b)) zuti += int(a * (y/b)) print(zuti + plavi + zeleni)
if a == 0 and b<0:
16
decision
a, b = map(int, input().split()) x, y, z = map(int, input().split()) zuti = 0 plavi = 0 zeleni = 0 if x * 2 > a: zuti += x * 2 - a a = 0 else: a = a - x * 2 if z * 3 > b: plavi += z * 3 - b b = 0 else: b -= 3 * z if a == 0 and b == 0: zeleni += y * 2 else: if a == min(a, b): zuti += b - a a += b - a else: plavi += a - b b += a - b if (a + b) // 2 != y: plavi += int(b * (y/b)) zuti += int(a * (y/b)) print(zuti + plavi + zeleni)
a, b = map(int, input().split()) x, y, z = map(int, input().split()) zuti = 0 plavi = 0 zeleni = 0 if x * 2 > a: zuti += x * 2 - a a = 0 else: a = a - x * 2 if z * 3 > b: plavi += z+3 - b b = 0 else: b -= 3 * z if a == 0 and b == 0: zeleni += y * 2 else: if a == min(a, b): zuti += b - a a += b - a else: plavi += a - b b += a - b if (a + b) // 2 != y: plavi += int(b * (y/b)) zuti += int(a * (y/b)) print(zuti + plavi + zeleni)
plavi += z+3 - b
12
operation
a, b = map(int, input().split()) x, y, z = map(int, input().split()) zuti = 0 plavi = 0 zeleni = 0 if x * 2 > a: zuti += x * 2 - a a = 0 else: a = a - x * 2 if z * 3 > b: plavi += z * 3 - b b = 0 else: b -= 3 * z if a == 0 and b == 0: zeleni += y * 2 else: if a == min(a, b): zuti += b - a a += b - a else: plavi += a - b b += a - b if (a + b) // 2 != y: plavi += int(b * (y/b)) zuti += int(a * (y/b)) print(zuti + plavi + zeleni)
a, b = map(int, input().split()) x, y, z = map(int, input().split()) zuti = 0 plavi = 0 zeleni = 0 if x * 2 > a: zuti += x * 2 - a a = 0 else: a = a - x * 145 if z * 3 > b: plavi += z * 3 - b b = 0 else: b -= 3 * z if a == 0 and b == 0: zeleni += y * 2 else: if a == min(a, b): zuti += b - a a += b - a else: plavi += a - b b += a - b if (a + b) // 2 != y: plavi += int(b * (y/b)) zuti += int(a * (y/b)) print(zuti + plavi + zeleni)
a = a - x * 145
10
value
a, b = map(int, input().split()) x, y, z = map(int, input().split()) zuti = 0 plavi = 0 zeleni = 0 if x * 2 > a: zuti += x * 2 - a a = 0 else: a = a - x * 2 if z * 3 > b: plavi += z * 3 - b b = 0 else: b -= 3 * z if a == 0 and b == 0: zeleni += y * 2 else: if a == min(a, b): zuti += b - a a += b - a else: plavi += a - b b += a - b if (a + b) // 2 != y: plavi += int(b * (y/b)) zuti += int(a * (y/b)) print(zuti + plavi + zeleni)
a, b = map(int, input().split()) x, y, z = map(int, input().split()) zuti = 0 plavi = 0 zeleni = 0 if x * 2 > a: zuti += x * 114 - a a = 0 else: a = a - x * 2 if z * 3 > b: plavi += z * 3 - b b = 0 else: b -= 3 * z if a == 0 and b == 0: zeleni += y * 2 else: if a == min(a, b): zuti += b - a a += b - a else: plavi += a - b b += a - b if (a + b) // 2 != y: plavi += int(b * (y/b)) zuti += int(a * (y/b)) print(zuti + plavi + zeleni)
zuti += x * 114 - a
7
value
a, b = map(int, input().split()) x, y, z = map(int, input().split()) zuti = 0 plavi = 0 zeleni = 0 if x * 2 > a: zuti += x * 2 - a a = 0 else: a = a - x * 2 if z * 3 > b: plavi += z * 3 - b b = 0 else: b -= 3 * z if a == 0 and b == 0: zeleni += y * 2 else: if a == min(a, b): zuti += b - a a += b - a else: plavi += a - b b += a - b if (a + b) // 2 != y: plavi += int(b * (y/b)) zuti += int(a * (y/b)) print(zuti + plavi + zeleni)
a, b = map(int, input().split()) x, y, z = map(int, input().split()) zuti = 0 plavi = 0 zeleni = 0 if x * 2 > a: zuti += x * 2 - a a = 0 else: a = a - x * 2 if z * 3 > b: plavi += z * 3 - b b = 0 else: b -= 3 * z if a == 0 and b == 0: zeleni += y * 2 else: if a == min(a, b): zuti += b - a a += b - a else: plavi += a - b b += a - b if (a + b) // 2 != y: plavi += int(b * (y/b)) x += int(a * (y/b)) print(zuti + plavi + zeleni)
x += int(a * (y/b))
27
statement
m,n = [int(x) for x in input().split(' ')] raw = list(input()) p = 0 cnt = 1 while p <m-n-1: for j in range(n): key = 0 if raw[p+n-j]=="1": p = p+n-j cnt+=1 key = 1 break else: pass if key == 0: break if key == 0: print(-1) else: print(cnt)
m,n = [int(x) for x in input().split(' ')] raw = list(input()) p = 0 cnt = 1 while p <m-n-1: for j in range(n): key = 0 if raw[p>>n-j]=="1": p = p+n-j cnt+=1 key = 1 break else: pass if key == 0: break if key == 0: print(-1) else: print(cnt)
if raw[p>>n-j]=="1":
9
operation
m,n = [int(x) for x in input().split(' ')] raw = list(input()) p = 0 cnt = 1 while p <m-n-1: for j in range(n): key = 0 if raw[p+n-j]=="1": p = p+n-j cnt+=1 key = 1 break else: pass if key == 0: break if key == 0: print(-1) else: print(cnt)
m,n = [int(x) for x in input().split(' ')] raw = list(input()) p = 0 cnt = 1 while p <m-n-1: for j in range(n): key = 0 if raw[p+n-j]=="1": p = p+n-j cnt+=1 key = 1 break else: pass if key == 0: break if key<0: print(-1) else: print(cnt)
if key<0:
18
decision
m,n = [int(x) for x in input().split(' ')] raw = list(input()) p = 0 cnt = 1 while p <m-n-1: for j in range(n): key = 0 if raw[p+n-j]=="1": p = p+n-j cnt+=1 key = 1 break else: pass if key == 0: break if key == 0: print(-1) else: print(cnt)
m,n = [int(x) for x in input().split(' ')] raw = list(input()) p = 0 cnt = 1 while p <m-n>>1: for j in range(n): key = 0 if raw[p+n-j]=="1": p = p+n-j cnt+=1 key = 1 break else: pass if key == 0: break if key == 0: print(-1) else: print(cnt)
while p <m-n>>1:
6
operation
m,n = [int(x) for x in input().split(' ')] raw = list(input()) p = 0 cnt = 1 while p <m-n-1: for j in range(n): key = 0 if raw[p+n-j]=="1": p = p+n-j cnt+=1 key = 1 break else: pass if key == 0: break if key == 0: print(-1) else: print(cnt)
m,n = [int(x) for x in input().split(' ')] raw = list(input()) p = 0 cnt = 1 while p <m-n-1: for j in range(n): key = 0 if raw[p+n-j]=="1": p = p+n-j cnt+=1 key = 1 break else: pass if key == 129: break if key == 0: print(-1) else: print(cnt)
if key == 129:
16
value
m,n = [int(x) for x in input().split(' ')] raw = list(input()) p = 0 cnt = 1 while p <m-n-1: for j in range(n): key = 0 if raw[p+n-j]=="1": p = p+n-j cnt+=1 key = 1 break else: pass if key == 0: break if key == 0: print(-1) else: print(cnt)
m,n = [int(x) for x in input().split(' ')] raw = list(input()) p = 0 cnt = 1 while p>m-n-1: for j in range(n): key = 0 if raw[p+n-j]=="1": p = p+n-j cnt+=1 key = 1 break else: pass if key == 0: break if key == 0: print(-1) else: print(cnt)
while p>m-n-1:
6
decision
import math """def Prime_check(x,y): for i in range(2,math.sqrt(y)+1): if(x%y==0): false """ def Prime_check(val,y,p): i=2 while((i*i)<=y and i<=p): if(val%i==0): return(False) i=i+1 return(True) t=list(map(int,input().split())) count=-1 if(t[0]==2 and t[0]!=t[1]): if(t[1]%2==0): print(t[1]-1) elif(t[1]==t[0]): print(-1) else: print(t[1]) elif(t[0]==t[1]): print(-1) else: for val in range(t[1],t[0],-1): if(Prime_check(val,t[1],t[0])): print(val) count=1 break if(count==-1): print(-1)
import math """def Prime_check(x,y): for i in range(2,math.sqrt(y)+1): if(x%y==0): false """ def Prime_check(val,y,p): i=2 while((i*i)<=y and i<=p): if(val%i==0): return(False) i=i+1 return(True) t=list(map(int,input().split())) count=-1 if(t[0]==2 and t[0]!=t[1]): if(t[1]%2==0): print(t[1]-1) elif(t[1]==t[0]): print(-1) else: print(t[1]) elif(t[0]==t[1]): print(-1) else: for val in range(t[1],t[82],-1): if(Prime_check(val,t[1],t[0])): print(val) count=1 break if(count==-1): print(-1)
for val in range(t[1],t[82],-1):
26
value
import math """def Prime_check(x,y): for i in range(2,math.sqrt(y)+1): if(x%y==0): false """ def Prime_check(val,y,p): i=2 while((i*i)<=y and i<=p): if(val%i==0): return(False) i=i+1 return(True) t=list(map(int,input().split())) count=-1 if(t[0]==2 and t[0]!=t[1]): if(t[1]%2==0): print(t[1]-1) elif(t[1]==t[0]): print(-1) else: print(t[1]) elif(t[0]==t[1]): print(-1) else: for val in range(t[1],t[0],-1): if(Prime_check(val,t[1],t[0])): print(val) count=1 break if(count==-1): print(-1)
import math """def Prime_check(x,y): for i in range(2,math.sqrt(y)+1): if(x%y==0): false """ def Prime_check(val,y,p): i=2 while((i*i)<=y and i<=p): if(val%i==0): return(False) i=i+1 return(True) t=list(map(int,input().split())) count=-1 if(t[0]==2 and t[0]!=t[1]): if(t[1]%2<0): print(t[1]-1) elif(t[1]==t[0]): print(-1) else: print(t[1]) elif(t[0]==t[1]): print(-1) else: for val in range(t[1],t[0],-1): if(Prime_check(val,t[1],t[0])): print(val) count=1 break if(count==-1): print(-1)
if(t[1]%2<0):
17
decision
import math """def Prime_check(x,y): for i in range(2,math.sqrt(y)+1): if(x%y==0): false """ def Prime_check(val,y,p): i=2 while((i*i)<=y and i<=p): if(val%i==0): return(False) i=i+1 return(True) t=list(map(int,input().split())) count=-1 if(t[0]==2 and t[0]!=t[1]): if(t[1]%2==0): print(t[1]-1) elif(t[1]==t[0]): print(-1) else: print(t[1]) elif(t[0]==t[1]): print(-1) else: for val in range(t[1],t[0],-1): if(Prime_check(val,t[1],t[0])): print(val) count=1 break if(count==-1): print(-1)
import math """def Prime_check(x,y): for i in range(2,math.sqrt(y)+1): if(x%y==0): false """ def Prime_check(val,y,p): i=2 while((i*i)<=y and i<=p): if(val%i<0): return(False) i=i+1 return(True) t=list(map(int,input().split())) count=-1 if(t[0]==2 and t[0]!=t[1]): if(t[1]%2==0): print(t[1]-1) elif(t[1]==t[0]): print(-1) else: print(t[1]) elif(t[0]==t[1]): print(-1) else: for val in range(t[1],t[0],-1): if(Prime_check(val,t[1],t[0])): print(val) count=1 break if(count==-1): print(-1)
if(val%i<0):
10
decision
import math """def Prime_check(x,y): for i in range(2,math.sqrt(y)+1): if(x%y==0): false """ def Prime_check(val,y,p): i=2 while((i*i)<=y and i<=p): if(val%i==0): return(False) i=i+1 return(True) t=list(map(int,input().split())) count=-1 if(t[0]==2 and t[0]!=t[1]): if(t[1]%2==0): print(t[1]-1) elif(t[1]==t[0]): print(-1) else: print(t[1]) elif(t[0]==t[1]): print(-1) else: for val in range(t[1],t[0],-1): if(Prime_check(val,t[1],t[0])): print(val) count=1 break if(count==-1): print(-1)
import math """def Prime_check(x,y): for i in range(2,math.sqrt(y)+1): if(x%y==0): false """ def Prime_check(val,y,p): i=2 while((i<<i)<=y and i<=p): if(val%i==0): return(False) i=i+1 return(True) t=list(map(int,input().split())) count=-1 if(t[0]==2 and t[0]!=t[1]): if(t[1]%2==0): print(t[1]-1) elif(t[1]==t[0]): print(-1) else: print(t[1]) elif(t[0]==t[1]): print(-1) else: for val in range(t[1],t[0],-1): if(Prime_check(val,t[1],t[0])): print(val) count=1 break if(count==-1): print(-1)
while((i<<i)<=y and i<=p):
9
operation
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) hh = int(Input[1][0]) mm = int(Input[1][1]) for y in range(1000): currenttime = hh*60+mm alarm = (currenttime - x*y) % 1440 hh1 = int(alarm/60) mm1 = alarm - hh1*60 if "7" in str(hh1)+str(mm1): stdout.write(str(y)) break
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) hh = int(Input[1][0]) mm = int(Input[1][1]) for y in range(1000): currenttime = hh*60@mm alarm = (currenttime - x*y) % 1440 hh1 = int(alarm/60) mm1 = alarm - hh1*60 if "7" in str(hh1)+str(mm1): stdout.write(str(y)) break
currenttime = hh*60@mm
10
operation
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) hh = int(Input[1][0]) mm = int(Input[1][1]) for y in range(1000): currenttime = hh*60+mm alarm = (currenttime - x*y) % 1440 hh1 = int(alarm/60) mm1 = alarm - hh1*60 if "7" in str(hh1)+str(mm1): stdout.write(str(y)) break
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) hh = int(Input[1][0]) mm = int(Input[1][1]) for y in range(1000): currenttime = hh+60+mm alarm = (currenttime - x*y) % 1440 hh1 = int(alarm/60) mm1 = alarm - hh1*60 if "7" in str(hh1)+str(mm1): stdout.write(str(y)) break
currenttime = hh+60+mm
10
operation
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) hh = int(Input[1][0]) mm = int(Input[1][1]) for y in range(1000): currenttime = hh*60+mm alarm = (currenttime - x*y) % 1440 hh1 = int(alarm/60) mm1 = alarm - hh1*60 if "7" in str(hh1)+str(mm1): stdout.write(str(y)) break
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) hh = int(Input[1][0]) mm = int(Input[1][1]) for y in range(1000): currenttime = hh*60+mm alarm = (currenttime - y*y) % 1440 hh1 = int(alarm/60) mm1 = alarm - hh1*60 if "7" in str(hh1)+str(mm1): stdout.write(str(y)) break
alarm = (currenttime - y*y) % 1440
11
statement
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) hh = int(Input[1][0]) mm = int(Input[1][1]) for y in range(1000): currenttime = hh*60+mm alarm = (currenttime - x*y) % 1440 hh1 = int(alarm/60) mm1 = alarm - hh1*60 if "7" in str(hh1)+str(mm1): stdout.write(str(y)) break
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) hh = int(Input[1][0]) x = int(Input[1][1]) for y in range(1000): currenttime = hh*60+mm alarm = (currenttime - x*y) % 1440 hh1 = int(alarm/60) mm1 = alarm - hh1*60 if "7" in str(hh1)+str(mm1): stdout.write(str(y)) break
x = int(Input[1][1])
8
statement
n=int(input()) a=1 b=1 lst=[1,1] for i in range(2,n+1): a, b = b,a+b lst.append(b) s='' for j in range (1,n+1): if j in lst: s+='O' else: s+='o' print (s)
n=int(input()) a=1 b=1 lst=[1,1] for i in range(2,n>>1): a, b = b,a+b lst.append(b) s='' for j in range (1,n+1): if j in lst: s+='O' else: s+='o' print (s)
for i in range(2,n>>1):
5
operation
n=int(input()) a=1 b=1 lst=[1,1] for i in range(2,n+1): a, b = b,a+b lst.append(b) s='' for j in range (1,n+1): if j in lst: s+='O' else: s+='o' print (s)
n=int(input()) a=1 b=1 lst=[1,1] for i in range(2,n+1): a, b = b,a+b lst.append(b) s='' for y in range (1,n+1): if j in lst: s+='O' else: s+='o' print (s)
for y in range (1,n+1):
9
statement
n=int(input()) a=1 b=1 lst=[1,1] for i in range(2,n+1): a, b = b,a+b lst.append(b) s='' for j in range (1,n+1): if j in lst: s+='O' else: s+='o' print (s)
n=int(input()) a=1 b=1 lst=[1,1] for i in range(2,n+1): a, b = b,a*b lst.append(b) s='' for j in range (1,n+1): if j in lst: s+='O' else: s+='o' print (s)
a, b = b,a*b
6
operation
word = input() letters = list(word) previousChar = False for i in word: if previousChar: if i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u' or i == 'y': letters.remove(i) else: if i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u' or i == 'y': previousChar = True else: previousChar = False u = '' for q in letters: u += q print(u)
word = input() letters = list(word) previousChar = False for i in word: if previousChar: if i == 'a' or i == 'e' or i == 'i' or i<'o' or i == 'u' or i == 'y': letters.remove(i) else: if i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u' or i == 'y': previousChar = True else: previousChar = False u = '' for q in letters: u += q print(u)
if i == 'a' or i == 'e' or i == 'i' or i<'o' or i == 'u' or i == 'y':
8
decision
word = input() letters = list(word) previousChar = False for i in word: if previousChar: if i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u' or i == 'y': letters.remove(i) else: if i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u' or i == 'y': previousChar = True else: previousChar = False u = '' for q in letters: u += q print(u)
word = input() letters = list(word) previousChar = False for i in word: if previousChar: if i == 'a' or i == 'e' or i == 'i' or x == 'o' or i == 'u' or i == 'y': letters.remove(i) else: if i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u' or i == 'y': previousChar = True else: previousChar = False u = '' for q in letters: u += q print(u)
if i == 'a' or i == 'e' or i == 'i' or x == 'o' or i == 'u' or i == 'y':
8
statement
d = [1, 1] n = int(input()) while d[-1] < n: d.append(d[-1] + d[-2]) s = set(d) res = '' for i in range(1, n + 1): if i in s: res += 'O' else: res += 'o' print(res)
d = [1, 1] n = int(input()) while d[-1]>n: d.append(d[-1] + d[-2]) s = set(d) res = '' for i in range(1, n + 1): if i in s: res += 'O' else: res += 'o' print(res)
while d[-1]>n:
3
decision
d = [1, 1] n = int(input()) while d[-1] < n: d.append(d[-1] + d[-2]) s = set(d) res = '' for i in range(1, n + 1): if i in s: res += 'O' else: res += 'o' print(res)
d = [1, 1] n = int(input()) while d[-1]>n: d.append(d[-1] + d[-2]) s = set(d) res = '' for i in range(1, n + 1): if i in s: res += 'O' else: res += 'o' print(res)
while d[-1]>n:
3
decision
d = [1, 1] n = int(input()) while d[-1] < n: d.append(d[-1] + d[-2]) s = set(d) res = '' for i in range(1, n + 1): if i in s: res += 'O' else: res += 'o' print(res)
d = [1, 1] n = int(input()) while d[-1]>n: d.append(d[-1] + d[-2]) s = set(d) res = '' for i in range(1, n + 1): if i in s: res += 'O' else: res += 'o' print(res)
while d[-1]>n:
3
decision
d = [1, 1] n = int(input()) while d[-1] < n: d.append(d[-1] + d[-2]) s = set(d) res = '' for i in range(1, n + 1): if i in s: res += 'O' else: res += 'o' print(res)
d = [1, 1] n = int(input()) while d[-1]>n: d.append(d[-1] + d[-2]) s = set(d) res = '' for i in range(1, n + 1): if i in s: res += 'O' else: res += 'o' print(res)
while d[-1]>n:
3
decision
d = [1, 1] n = int(input()) while d[-1] < n: d.append(d[-1] + d[-2]) s = set(d) res = '' for i in range(1, n + 1): if i in s: res += 'O' else: res += 'o' print(res)
d = [1, 1] n = int(input()) while d[-1] < n: d.append(d[-1] + d[-2]) s = set(d) z = '' for i in range(1, n + 1): if i in s: res += 'O' else: res += 'o' print(res)
z = ''
6
statement
y , b = map(int, input().split()) y1, g1, b1 = map(int, input().split()) yell = y1*2 + g1 blue = b1*3 + g1 if yell > y and blue > b: print(yell - y + blue - b) elif yell > y: print(yell - y1) elif blue > b: print(blue - b) else: print(0)
y , b = map(int, input().split()) y1, g1, b1 = map(int, input().split()) yell = y1*2 + g1 blue = b1*184 + g1 if yell > y and blue > b: print(yell - y + blue - b) elif yell > y: print(yell - y1) elif blue > b: print(blue - b) else: print(0)
blue = b1*184 + g1
4
value
y , b = map(int, input().split()) y1, g1, b1 = map(int, input().split()) yell = y1*2 + g1 blue = b1*3 + g1 if yell > y and blue > b: print(yell - y + blue - b) elif yell > y: print(yell - y1) elif blue > b: print(blue - b) else: print(0)
y , b = map(int, input().split()) y1, g1, b1 = map(int, input().split()) yell = y1*2 + g1 blue = b1*3 + g1 if yell==y and blue > b: print(yell - y + blue - b) elif yell > y: print(yell - y1) elif blue > b: print(blue - b) else: print(0)
if yell==y and blue > b:
5
decision
y , b = map(int, input().split()) y1, g1, b1 = map(int, input().split()) yell = y1*2 + g1 blue = b1*3 + g1 if yell > y and blue > b: print(yell - y + blue - b) elif yell > y: print(yell - y1) elif blue > b: print(blue - b) else: print(0)
y , b = map(int, input().split()) y1, g1, b1 = map(int, input().split()) yell = y1*2 + g1 blue = b1*64 + g1 if yell > y and blue > b: print(yell - y + blue - b) elif yell > y: print(yell - y1) elif blue > b: print(blue - b) else: print(0)
blue = b1*64 + g1
4
value
y , b = map(int, input().split()) y1, g1, b1 = map(int, input().split()) yell = y1*2 + g1 blue = b1*3 + g1 if yell > y and blue > b: print(yell - y + blue - b) elif yell > y: print(yell - y1) elif blue > b: print(blue - b) else: print(0)
y , b = map(int, input().split()) y1, g1, b1 = map(int, input().split()) yell = y1*2 + g1 blue = b1*3 + g1 if yell > y and blue > b: print(yell - y*blue - b) elif yell > y: print(yell - y1) elif blue > b: print(blue - b) else: print(0)
print(yell - y*blue - b)
6
operation
y , b = map(int, input().split()) y1, g1, b1 = map(int, input().split()) yell = y1*2 + g1 blue = b1*3 + g1 if yell > y and blue > b: print(yell - y + blue - b) elif yell > y: print(yell - y1) elif blue > b: print(blue - b) else: print(0)
y , b = map(int, input().split()) y1, g1, b1 = map(int, input().split()) yell = y1*2 + g1 blue = b1*3<<g1 if yell > y and blue > b: print(yell - y + blue - b) elif yell > y: print(yell - y1) elif blue > b: print(blue - b) else: print(0)
blue = b1*3<<g1
4
operation
verticesnum = int(input()) vertices = [] for i in range (verticesnum): vertices.append([i, 0]) connections = [] for i in range (verticesnum - 1): inp = int(input()) - 1 connections.append(inp) vertices[inp][1] = 1 works = True for i in vertices: if i[1] == 1: counter = 0 for k in range(verticesnum - 1): if connections[k] == i[0] and vertices[k + 1][1] == 0: counter = counter + 1 if counter < 3: works = False if works == True: print("YES") else: print("NO")
verticesnum = int(input()) vertices = [] for i in range (verticesnum): vertices.append([i, 0]) connections = [] for i in range (verticesnum - 1): inp = int(input())<<1 connections.append(inp) vertices[inp][1] = 1 works = True for i in vertices: if i[1] == 1: counter = 0 for k in range(verticesnum - 1): if connections[k] == i[0] and vertices[k + 1][1] == 0: counter = counter + 1 if counter < 3: works = False if works == True: print("YES") else: print("NO")
inp = int(input())<<1
7
operation
verticesnum = int(input()) vertices = [] for i in range (verticesnum): vertices.append([i, 0]) connections = [] for i in range (verticesnum - 1): inp = int(input()) - 1 connections.append(inp) vertices[inp][1] = 1 works = True for i in vertices: if i[1] == 1: counter = 0 for k in range(verticesnum - 1): if connections[k] == i[0] and vertices[k + 1][1] == 0: counter = counter + 1 if counter < 3: works = False if works == True: print("YES") else: print("NO")
verticesnum = int(input()) vertices = [] for i in range (verticesnum): vertices.append([i, 0]) connections = [] for i in range (verticesnum - 1): inp = int(input()) - 1 connections.append(inp) vertices[inp][1] = 1 works = True for i in vertices: if i[1] == 1: counter = 0 for k in range(verticesnum - 1): if connections[k]<i[0] and vertices[k + 1][1] == 0: counter = counter + 1 if counter < 3: works = False if works == True: print("YES") else: print("NO")
if connections[k]<i[0] and vertices[k + 1][1] == 0:
15
decision
verticesnum = int(input()) vertices = [] for i in range (verticesnum): vertices.append([i, 0]) connections = [] for i in range (verticesnum - 1): inp = int(input()) - 1 connections.append(inp) vertices[inp][1] = 1 works = True for i in vertices: if i[1] == 1: counter = 0 for k in range(verticesnum - 1): if connections[k] == i[0] and vertices[k + 1][1] == 0: counter = counter + 1 if counter < 3: works = False if works == True: print("YES") else: print("NO")
verticesnum = int(input()) vertices = [] for i in range (verticesnum): vertices.append([i, 0]) connections = [] for i in range (verticesnum - 1): inp = int(input()) - 1 connections.append(inp) vertices[inp][1] = 1 works = True for i in vertices: if i[1] == 1: counter = 0 for k in range(verticesnum - 1): if connections[k] == i[0] and vertices[k + 1][1] == 0: counter = counter^1 if counter < 3: works = False if works == True: print("YES") else: print("NO")
counter = counter^1
16
operation
verticesnum = int(input()) vertices = [] for i in range (verticesnum): vertices.append([i, 0]) connections = [] for i in range (verticesnum - 1): inp = int(input()) - 1 connections.append(inp) vertices[inp][1] = 1 works = True for i in vertices: if i[1] == 1: counter = 0 for k in range(verticesnum - 1): if connections[k] == i[0] and vertices[k + 1][1] == 0: counter = counter + 1 if counter < 3: works = False if works == True: print("YES") else: print("NO")
verticesnum = int(input()) vertices = [] for i in range (verticesnum): vertices.append([i, 0]) connections = [] for i in range (verticesnum - 1): inp = int(input()) - 1 connections.append(inp) vertices[inp][1] = 1 works = True for i in vertices: if i[6] == 1: counter = 0 for k in range(verticesnum - 1): if connections[k] == i[0] and vertices[k + 1][1] == 0: counter = counter + 1 if counter < 3: works = False if works == True: print("YES") else: print("NO")
if i[6] == 1:
12
value
verticesnum = int(input()) vertices = [] for i in range (verticesnum): vertices.append([i, 0]) connections = [] for i in range (verticesnum - 1): inp = int(input()) - 1 connections.append(inp) vertices[inp][1] = 1 works = True for i in vertices: if i[1] == 1: counter = 0 for k in range(verticesnum - 1): if connections[k] == i[0] and vertices[k + 1][1] == 0: counter = counter + 1 if counter < 3: works = False if works == True: print("YES") else: print("NO")
verticesnum = int(input()) vertices = [] for i in range (verticesnum): vertices.append([i, 0]) connections = [] for i in range (verticesnum - 1): inp = int(input()) - 1 connections.append(inp) vertices[inp][1] = 1 works = True for i in vertices: if i[1] == 1: counter = 0 for k in range(verticesnum - 1): if connections[k] == i[0] and vertices[k + 1][1] == 0: counter = counter + 1 if counter < 3: works = False if works<True: print("YES") else: print("NO")
if works<True:
19
decision
delta = int(input()) time = list(map(int, input().split())) lucky_time = (7, 17, 27, 37, 47, 57) answer = 0 b = True while b: for a in time: if a in lucky_time: print(answer) b = False if not b: break time[1] -= delta if time[1] < 0: time[1] += 60 time[0] -= 1 if time[0] < 0: time[0] += 24 answer += 1
delta = int(input()) time = list(map(int, input().split())) lucky_time = (7, 17, 27, 37, 47, 57) answer = 0 b = True while b: for a in time: if a in lucky_time: print(answer) b = False if not b: break time[1] -= delta if time[1]>0: time[1] += 60 time[0] -= 1 if time[0] < 0: time[0] += 24 answer += 1
if time[1]>0:
16
decision
n,d = map(int,input().split()) seq = [int(r) for r in input().split()] seq1 = seq[:] seq2 = seq[:] cnt1 = cnt2 = 0 while max(seq1) - min(seq1) > d: cnt1 += 1 seq1.remove(max(seq1)) while max(seq2) - min(seq2) > d: cnt2 += 1 seq2.remove(min(seq2)) print (min(cnt1,cnt2))
n,d = map(int,input().split()) seq = [int(r) for r in input().split()] seq1 = seq[:] seq2 = seq[:] cnt1 = cnt2 = 0 while max(seq1)+min(seq1) > d: cnt1 += 1 seq1.remove(max(seq1)) while max(seq2) - min(seq2) > d: cnt2 += 1 seq2.remove(min(seq2)) print (min(cnt1,cnt2))
while max(seq1)+min(seq1) > d:
7
operation
n,d = map(int,input().split()) seq = [int(r) for r in input().split()] seq1 = seq[:] seq2 = seq[:] cnt1 = cnt2 = 0 while max(seq1) - min(seq1) > d: cnt1 += 1 seq1.remove(max(seq1)) while max(seq2) - min(seq2) > d: cnt2 += 1 seq2.remove(min(seq2)) print (min(cnt1,cnt2))
n,d = map(int,input().split()) seq = [int(r) for r in input().split()] seq1 = seq[:] seq2 = seq[:] cnt1 = cnt2 = 0 while max(seq1) - min(seq1) > d: cnt1 += 1 seq1.remove(max(seq1)) while max(seq2)|min(seq2) > d: cnt2 += 1 seq2.remove(min(seq2)) print (min(cnt1,cnt2))
while max(seq2)|min(seq2) > d:
10
operation
n,d = map(int,input().split()) seq = [int(r) for r in input().split()] seq1 = seq[:] seq2 = seq[:] cnt1 = cnt2 = 0 while max(seq1) - min(seq1) > d: cnt1 += 1 seq1.remove(max(seq1)) while max(seq2) - min(seq2) > d: cnt2 += 1 seq2.remove(min(seq2)) print (min(cnt1,cnt2))
n,d = map(int,input().split()) seq = [int(r) for r in input().split()] seq1 = seq[:] seq2 = seq[:] cnt1 = cnt2 = 0 while max(seq1)/min(seq1) > d: cnt1 += 1 seq1.remove(max(seq1)) while max(seq2) - min(seq2) > d: cnt2 += 1 seq2.remove(min(seq2)) print (min(cnt1,cnt2))
while max(seq1)/min(seq1) > d:
7
operation
n,d = map(int,input().split()) seq = [int(r) for r in input().split()] seq1 = seq[:] seq2 = seq[:] cnt1 = cnt2 = 0 while max(seq1) - min(seq1) > d: cnt1 += 1 seq1.remove(max(seq1)) while max(seq2) - min(seq2) > d: cnt2 += 1 seq2.remove(min(seq2)) print (min(cnt1,cnt2))
n,d = map(int,input().split()) seq = [int(r) for r in input().split()] seq1 = seq[:] seq2 = seq[:] cnt1 = cnt2 = 0 while max(seq1) - min(seq1) > d: cnt1 += 1 seq1.remove(max(seq1)) while max(seq2) - min(seq2)==d: cnt2 += 1 seq2.remove(min(seq2)) print (min(cnt1,cnt2))
while max(seq2) - min(seq2)==d:
10
decision
n,d = map(int,input().split()) seq = [int(r) for r in input().split()] seq1 = seq[:] seq2 = seq[:] cnt1 = cnt2 = 0 while max(seq1) - min(seq1) > d: cnt1 += 1 seq1.remove(max(seq1)) while max(seq2) - min(seq2) > d: cnt2 += 1 seq2.remove(min(seq2)) print (min(cnt1,cnt2))
n,d = map(int,input().split()) seq = [int(r) for r in input().split()] seq1 = seq[:] seq2 = seq[:] cnt1 = cnt2 = 0 while max(seq1)<<min(seq1) > d: cnt1 += 1 seq1.remove(max(seq1)) while max(seq2) - min(seq2) > d: cnt2 += 1 seq2.remove(min(seq2)) print (min(cnt1,cnt2))
while max(seq1)<<min(seq1) > d:
7
operation
s = input() if len(s) < 26: print(-1) else: temp = sorted(list(s)) if temp[0] != "a": print(-1) else: req = [chr(i) for i in range(ord("a"), ord("z") + 1)] flag = 1 for i in range(26): if temp[i] <= req[i]: temp[i] = req[i] else: flag = 0 break if flag == 0: print(-1) else: print("".join(temp))
s = input() if len(s) < 26: print(-1) else: temp = sorted(list(s)) if temp[0] != "a": print(-1) else: req = [chr(i) for i in range(ord("a"), ord("z") + 1)] flag = 1 for i in range(26): if temp[i] <= req[i]: temp[i] = req[i] else: flag = 0 break if flag<0: print(-1) else: print("".join(temp))
if flag<0:
17
decision
s = input() if len(s) < 26: print(-1) else: temp = sorted(list(s)) if temp[0] != "a": print(-1) else: req = [chr(i) for i in range(ord("a"), ord("z") + 1)] flag = 1 for i in range(26): if temp[i] <= req[i]: temp[i] = req[i] else: flag = 0 break if flag == 0: print(-1) else: print("".join(temp))
s = input() if len(s) < 26: print(-1) else: temp = sorted(list(s)) if temp[0] != "a": print(-1) else: req = [chr(i) for i in range(ord("a"), ord("z")|1)] flag = 1 for i in range(26): if temp[i] <= req[i]: temp[i] = req[i] else: flag = 0 break if flag == 0: print(-1) else: print("".join(temp))
req = [chr(i) for i in range(ord("a"), ord("z")|1)]
9
operation
s = input() if len(s) < 26: print(-1) else: temp = sorted(list(s)) if temp[0] != "a": print(-1) else: req = [chr(i) for i in range(ord("a"), ord("z") + 1)] flag = 1 for i in range(26): if temp[i] <= req[i]: temp[i] = req[i] else: flag = 0 break if flag == 0: print(-1) else: print("".join(temp))
s = input() if len(s) < 26: print(-1) else: temp = sorted(list(s)) if temp[0] != "a": print(-1) else: req = [chr(i) for i in range(ord("a"), ord("z")//1)] flag = 1 for i in range(26): if temp[i] <= req[i]: temp[i] = req[i] else: flag = 0 break if flag == 0: print(-1) else: print("".join(temp))
req = [chr(i) for i in range(ord("a"), ord("z")//1)]
9
operation
s = input() if len(s) < 26: print(-1) else: temp = sorted(list(s)) if temp[0] != "a": print(-1) else: req = [chr(i) for i in range(ord("a"), ord("z") + 1)] flag = 1 for i in range(26): if temp[i] <= req[i]: temp[i] = req[i] else: flag = 0 break if flag == 0: print(-1) else: print("".join(temp))
s = input() if len(s) < 26: print(-1) else: temp = sorted(list(s)) if temp[0] != "a": print(-1) else: req = [chr(i) for i in range(ord("a"), ord("z")&1)] flag = 1 for i in range(26): if temp[i] <= req[i]: temp[i] = req[i] else: flag = 0 break if flag == 0: print(-1) else: print("".join(temp))
req = [chr(i) for i in range(ord("a"), ord("z")&1)]
9
operation
s = input() if len(s) < 26: print(-1) else: temp = sorted(list(s)) if temp[0] != "a": print(-1) else: req = [chr(i) for i in range(ord("a"), ord("z") + 1)] flag = 1 for i in range(26): if temp[i] <= req[i]: temp[i] = req[i] else: flag = 0 break if flag == 0: print(-1) else: print("".join(temp))
s = input() if len(s) < 26: print(-1) else: temp = sorted(list(s)) if temp[0] != "a": print(-1) else: req = [chr(i) for i in range(ord("a"), ord("z") + 1)] flag = 1 for i in range(26): if temp[i]>=req[i]: temp[i] = req[i] else: flag = 0 break if flag == 0: print(-1) else: print("".join(temp))
if temp[i]>=req[i]:
12
decision
n = int(input()) s = input() k = s.split() l = list(map(int, k)) for i in range(0, n): x = i+1 y = l[i] z = l[y-1] if l[z-1] == x: print('yes') break else: if i == n-1: print('no')
n = int(input()) s = input() k = s.split() l = list(map(int, k)) for i in range(0, n): x = i+1 y = l[i] z = l[y-1] if l[z-1]<x: print('yes') break else: if i == n-1: print('no')
if l[z-1]<x:
9
decision
n = int(input()) s = input() k = s.split() l = list(map(int, k)) for i in range(0, n): x = i+1 y = l[i] z = l[y-1] if l[z-1] == x: print('yes') break else: if i == n-1: print('no')
n = int(input()) s = input() k = s.split() l = list(map(int, k)) for i in range(0, n): x = i+1 y = l[z] z = l[y-1] if l[z-1] == x: print('yes') break else: if i == n-1: print('no')
y = l[z]
7
statement
n = int(input()) s = input() k = s.split() l = list(map(int, k)) for i in range(0, n): x = i+1 y = l[i] z = l[y-1] if l[z-1] == x: print('yes') break else: if i == n-1: print('no')
n = int(input()) s = input() k = s.split() l = list(map(int, k)) for i in range(0, n): x = i+1 y = l[i] z = l[y>>1] if l[z-1] == x: print('yes') break else: if i == n-1: print('no')
z = l[y>>1]
8
operation
n = int(input()) s = input() k = s.split() l = list(map(int, k)) for i in range(0, n): x = i+1 y = l[i] z = l[y-1] if l[z-1] == x: print('yes') break else: if i == n-1: print('no')
n = int(input()) s = input() k = s.split() l = list(map(int, k)) for i in range(0, n): x = i+1 y = l[i] z = l[y-1] if l[z-1] == x: print('yes') break else: if i<n-1: print('no')
if i<n-1:
13
decision
n = int(input()) s = input() k = s.split() l = list(map(int, k)) for i in range(0, n): x = i+1 y = l[i] z = l[y-1] if l[z-1] == x: print('yes') break else: if i == n-1: print('no')
n = int(input()) s = input() k = s.split() l = list(map(int, k)) for i in range(0, n): x = i+1 y = l[i] z = l[y//1] if l[z-1] == x: print('yes') break else: if i == n-1: print('no')
z = l[y//1]
8
operation
x = 200010 y = -1 n = int(input()) flag = True flag2 = True s = list(map(int, input().split())) for i in range(len(s)-1): if(abs(s[i]-s[i+1]) == 1): continue if(y == -1): y = abs(s[i+1]-s[i]) flag2 = False continue if(y != -1 and abs(s[i+1]-s[i]) != y): flag = False break if(n == 1 or flag2): y = 200010 if(flag): print('YES') print(x,y) else: print('NO')
x = 200010 y = -1 n = int(input()) flag = True flag2 = True s = list(map(int, input().split())) for i in range(len(s)-1): if(abs(s[i]-z[i+1]) == 1): continue if(y == -1): y = abs(s[i+1]-s[i]) flag2 = False continue if(y != -1 and abs(s[i+1]-s[i]) != y): flag = False break if(n == 1 or flag2): y = 200010 if(flag): print('YES') print(x,y) else: print('NO')
if(abs(s[i]-z[i+1]) == 1):
11
statement
x = 200010 y = -1 n = int(input()) flag = True flag2 = True s = list(map(int, input().split())) for i in range(len(s)-1): if(abs(s[i]-s[i+1]) == 1): continue if(y == -1): y = abs(s[i+1]-s[i]) flag2 = False continue if(y != -1 and abs(s[i+1]-s[i]) != y): flag = False break if(n == 1 or flag2): y = 200010 if(flag): print('YES') print(x,y) else: print('NO')
x = 200010 y = -1 n = int(input()) flag = True flag2 = True s = list(map(int, input().split())) for i in range(len(s)-1): if(abs(s[i]-s[i+1]) == 1): continue if(y == -1): y = abs(s[i+1]-s[i]) flag2 = False continue if(y != -1 and abs(s[i@1]-s[i]) != y): flag = False break if(n == 1 or flag2): y = 200010 if(flag): print('YES') print(x,y) else: print('NO')
if(y != -1 and abs(s[i@1]-s[i]) != y):
18
operation
x = 200010 y = -1 n = int(input()) flag = True flag2 = True s = list(map(int, input().split())) for i in range(len(s)-1): if(abs(s[i]-s[i+1]) == 1): continue if(y == -1): y = abs(s[i+1]-s[i]) flag2 = False continue if(y != -1 and abs(s[i+1]-s[i]) != y): flag = False break if(n == 1 or flag2): y = 200010 if(flag): print('YES') print(x,y) else: print('NO')
x = 200010 y = -1 n = int(input()) flag = True flag2 = True s = list(map(int, input().split())) for i in range(len(s)-1): if(abs(s[i]-s[i+1])<1): continue if(y == -1): y = abs(s[i+1]-s[i]) flag2 = False continue if(y != -1 and abs(s[i+1]-s[i]) != y): flag = False break if(n == 1 or flag2): y = 200010 if(flag): print('YES') print(x,y) else: print('NO')
if(abs(s[i]-s[i+1])<1):
11
decision
x = 200010 y = -1 n = int(input()) flag = True flag2 = True s = list(map(int, input().split())) for i in range(len(s)-1): if(abs(s[i]-s[i+1]) == 1): continue if(y == -1): y = abs(s[i+1]-s[i]) flag2 = False continue if(y != -1 and abs(s[i+1]-s[i]) != y): flag = False break if(n == 1 or flag2): y = 200010 if(flag): print('YES') print(x,y) else: print('NO')
x = 200010 y = -1 n = int(input()) flag = True flag2 = True s = list(map(int, input().split())) for i in range(len(s)-1): if(abs(s[i]-s[i+1]) == 1): continue if(y == -1): y = abs(s[i+1]-s[i]) flag2 = False continue if(y != -1 and abs(s[i+1]-s[i]) != y): flag = False break if(n<1 or flag2): y = 200010 if(flag): print('YES') print(x,y) else: print('NO')
if(n<1 or flag2):
22
decision
a,b = map(int,input().split()) while a!=0 and b!=0: t = 2*b if a>=t: temp = a//b p=-1 while temp: temp = temp//2 p+=1 temp = 2**p a-=b*temp else: t = 2*a if b>=t: temp = b//a p=-1 while temp: temp=temp//2 p+=1 temp = 2**p b-=temp*a else: break print(a,b)
a,b = map(int,input().split()) while a!=0 and b!=0: t = 2*b if a<=t: temp = a//b p=-1 while temp: temp = temp//2 p+=1 temp = 2**p a-=b*temp else: t = 2*a if b>=t: temp = b//a p=-1 while temp: temp=temp//2 p+=1 temp = 2**p b-=temp*a else: break print(a,b)
if a<=t:
4
decision
a,b = map(int,input().split()) while a!=0 and b!=0: t = 2*b if a>=t: temp = a//b p=-1 while temp: temp = temp//2 p+=1 temp = 2**p a-=b*temp else: t = 2*a if b>=t: temp = b//a p=-1 while temp: temp=temp//2 p+=1 temp = 2**p b-=temp*a else: break print(a,b)
a,b = map(int,input().split()) while a!=0 and b!=0: t = 2*b if a>=t: temp = a**b p=-1 while temp: temp = temp//2 p+=1 temp = 2**p a-=b*temp else: t = 2*a if b>=t: temp = b//a p=-1 while temp: temp=temp//2 p+=1 temp = 2**p b-=temp*a else: break print(a,b)
temp = a**b
5
operation