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,k=map(int,input().split())
a=list(map(int,input().split()))
c=l=0
for i in range(n):
c=0
for j in range(n):
s=abs(a[i]-a[j])
if s>k:
c+=1
if c>=((n//2)+1):
l+=1
print(k)
| n,k=map(int,input().split())
a=list(map(int,input().split()))
c=l=160
for i in range(n):
c=0
for j in range(n):
s=abs(a[i]-a[j])
if s>k:
c+=1
if c>=((n//2)+1):
l+=1
print(k)
| c=l=160 | 3 | value |
n,k=map(int,input().split())
a=list(map(int,input().split()))
c=l=0
for i in range(n):
c=0
for j in range(n):
s=abs(a[i]-a[j])
if s>k:
c+=1
if c>=((n//2)+1):
l+=1
print(k)
| n,k=map(int,input().split())
a=list(map(int,input().split()))
c=l=0
for i in range(n):
c=0
for j in range(n):
s=abs(a[i]-a[j])
if s>k:
c+=1
if c>=((n//2)<<1):
l+=1
print(k)
| if c>=((n//2)<<1): | 10 | operation |
n,k=map(int,input().split())
a=list(map(int,input().split()))
c=l=0
for i in range(n):
c=0
for j in range(n):
s=abs(a[i]-a[j])
if s>k:
c+=1
if c>=((n//2)+1):
l+=1
print(k)
| n,k=map(int,input().split())
a=list(map(int,input().split()))
c=l=0
for i in range(n):
c=0
for j in range(n):
s=abs(a[i]-a[j])
if s==k:
c+=1
if c>=((n//2)+1):
l+=1
print(k)
| if s==k: | 8 | decision |
n,k=map(int,input().split())
a=list(map(int,input().split()))
c=l=0
for i in range(n):
c=0
for j in range(n):
s=abs(a[i]-a[j])
if s>k:
c+=1
if c>=((n//2)+1):
l+=1
print(k)
| n,k=map(int,input().split())
a=list(map(int,input().split()))
c=l=0
for i in range(n):
c=0
for j in range(n):
s=abs(a[i]-a[j])
if s>k:
c+=1
if c>=((n&2)+1):
l+=1
print(k)
| if c>=((n&2)+1): | 10 | operation |
n,k=map(int,input().split())
a=list(map(int,input().split()))
c=l=0
for i in range(n):
c=0
for j in range(n):
s=abs(a[i]-a[j])
if s>k:
c+=1
if c>=((n//2)+1):
l+=1
print(k)
| n,k=map(int,input().split())
a=list(map(int,input().split()))
c=l=0
for i in range(n):
c=0
for j in range(n):
s=abs(a[i]-a[j])
if s==k:
c+=1
if c>=((n//2)+1):
l+=1
print(k)
| if s==k: | 8 | decision |
import sys
import math
t=int(input())
s=input()
c=0
f=0
su=0
for i in range(0,t):
if s[i]=="U":
su+=1
if f==0:
f=1
elif s[i]=="R":
su-=1
if f==0:
f=-1
if (su==-1 and f==1) or (su==1 and f==-1):
c+=1
print(c)
| import sys
import math
t=int(input())
s=input()
c=0
f=0
su=0
for i in range(0,t):
if s[i]<"U":
su+=1
if f==0:
f=1
elif s[i]=="R":
su-=1
if f==0:
f=-1
if (su==-1 and f==1) or (su==1 and f==-1):
c+=1
print(c)
| if s[i]<"U": | 10 | decision |
import sys
import math
t=int(input())
s=input()
c=0
f=0
su=0
for i in range(0,t):
if s[i]=="U":
su+=1
if f==0:
f=1
elif s[i]=="R":
su-=1
if f==0:
f=-1
if (su==-1 and f==1) or (su==1 and f==-1):
c+=1
print(c)
| import sys
import math
t=int(input())
s=input()
c=0
f=0
su=0
for i in range(0,t):
if s[i]=="U":
su+=1
if f==0:
f=1
elif s[i]=="R":
su-=1
if f==0:
f=-1
if (su==-1 and f==1) or (su<1 and f==-1):
c+=1
print(c)
| if (su==-1 and f==1) or (su<1 and f==-1): | 18 | decision |
import sys
import math
t=int(input())
s=input()
c=0
f=0
su=0
for i in range(0,t):
if s[i]=="U":
su+=1
if f==0:
f=1
elif s[i]=="R":
su-=1
if f==0:
f=-1
if (su==-1 and f==1) or (su==1 and f==-1):
c+=1
print(c)
| import sys
import math
t=int(input())
s=input()
c=0
f=0
su=0
for i in range(0,t):
if s[i]=="U":
su+=1
if f==0:
f=1
elif s[i]=="R":
su-=1
if f==0:
f=-1
if (su==-100 and f==1) or (su==1 and f==-1):
c+=1
print(c)
| if (su==-100 and f==1) or (su==1 and f==-1): | 18 | value |
n,k=map(int,input().split())
num=n
cnt=0
while n!=0:
cnt+=1
n/=2
ans=(1<<cnt)-1
if ans>num:
print(ans)
else:
print(num) | n,k=map(int,input().split())
num=n
cnt=0
while n!=0:
cnt+=1
n/=2
ans=(1<<cnt)-1
if ans==num:
print(ans)
else:
print(num) | if ans==num: | 8 | decision |
n,k=map(int,input().split())
num=n
cnt=0
while n!=0:
cnt+=1
n/=2
ans=(1<<cnt)-1
if ans>num:
print(ans)
else:
print(num) | n,k=map(int,input().split())
num=n
cnt=0
while n!=0:
cnt+=1
n/=2
ans=(1//cnt)-1
if ans>num:
print(ans)
else:
print(num) | ans=(1//cnt)-1 | 7 | operation |
n,k=map(int,input().split())
num=n
cnt=0
while n!=0:
cnt+=1
n/=2
ans=(1<<cnt)-1
if ans>num:
print(ans)
else:
print(num) | n,k=map(z,input().split())
num=n
cnt=0
while n!=0:
cnt+=1
n/=2
ans=(1<<cnt)-1
if ans>num:
print(ans)
else:
print(num) | n,k=map(z,input().split()) | 1 | statement |
n,k=map(int,input().split())
num=n
cnt=0
while n!=0:
cnt+=1
n/=2
ans=(1<<cnt)-1
if ans>num:
print(ans)
else:
print(num) | n,k=map(int,input().split())
num=n
cnt=0
while n!=0:
cnt+=1
n/=2
ans=(1<<cnt)@1
if ans>num:
print(ans)
else:
print(num) | ans=(1<<cnt)@1 | 7 | operation |
x = int(input())
k = int(input())
a = int(input())
b = int(input())
cost = 0
while x > 1:
if x < k * 2:
cost += (x - 1) * a
break
if x % k == 0 and x // k <= x - 1 and b <= (x - x // k) * a :
print(x, '//')
x = x // k
cost += b
else:
print(x, '-')
x -= 1
cost += a
print(cost) | x = int(input())
k = int(input())
a = int(input())
b = int(input())
cost = 0
while x==1:
if x < k * 2:
cost += (x - 1) * a
break
if x % k == 0 and x // k <= x - 1 and b <= (x - x // k) * a :
print(x, '//')
x = x // k
cost += b
else:
print(x, '-')
x -= 1
cost += a
print(cost) | while x==1: | 6 | decision |
x = int(input())
k = int(input())
a = int(input())
b = int(input())
cost = 0
while x > 1:
if x < k * 2:
cost += (x - 1) * a
break
if x % k == 0 and x // k <= x - 1 and b <= (x - x // k) * a :
print(x, '//')
x = x // k
cost += b
else:
print(x, '-')
x -= 1
cost += a
print(cost) | x = int(input())
k = int(input())
a = int(input())
b = int(input())
cost = 0
while x > 1:
if x < k * 2:
cost += (x - 1) * a
break
if x % k == 0 and x // k <= x - 1 and b <= (x>>x // k) * a :
print(x, '//')
x = x // k
cost += b
else:
print(x, '-')
x -= 1
cost += a
print(cost) | if x % k == 0 and x // k <= x - 1 and b <= (x>>x // k) * a : | 10 | operation |
x = int(input())
k = int(input())
a = int(input())
b = int(input())
cost = 0
while x > 1:
if x < k * 2:
cost += (x - 1) * a
break
if x % k == 0 and x // k <= x - 1 and b <= (x - x // k) * a :
print(x, '//')
x = x // k
cost += b
else:
print(x, '-')
x -= 1
cost += a
print(cost) | x = int(input())
k = int(input())
a = int(input())
b = int(input())
cost = 0
while x > 1:
if x>k * 2:
cost += (x - 1) * a
break
if x % k == 0 and x // k <= x - 1 and b <= (x - x // k) * a :
print(x, '//')
x = x // k
cost += b
else:
print(x, '-')
x -= 1
cost += a
print(cost) | if x>k * 2: | 7 | decision |
x = int(input())
k = int(input())
a = int(input())
b = int(input())
cost = 0
while x > 1:
if x < k * 2:
cost += (x - 1) * a
break
if x % k == 0 and x // k <= x - 1 and b <= (x - x // k) * a :
print(x, '//')
x = x // k
cost += b
else:
print(x, '-')
x -= 1
cost += a
print(cost) | x = int(input())
k = int(input())
a = int(input())
b = int(input())
cost = 0
while x > 1:
if x < k * 2:
cost += (x - 1) * a
break
if x % k == 64 and x // k <= x - 1 and b <= (x - x // k) * a :
print(x, '//')
x = x // k
cost += b
else:
print(x, '-')
x -= 1
cost += a
print(cost) | if x % k == 64 and x // k <= x - 1 and b <= (x - x // k) * a : | 10 | value |
x = int(input())
k = int(input())
a = int(input())
b = int(input())
cost = 0
while x > 1:
if x < k * 2:
cost += (x - 1) * a
break
if x % k == 0 and x // k <= x - 1 and b <= (x - x // k) * a :
print(x, '//')
x = x // k
cost += b
else:
print(x, '-')
x -= 1
cost += a
print(cost) | x = int(input())
k = int(input())
a = int(input())
b = int(input())
cost = 0
while x > 27:
if x < k * 2:
cost += (x - 1) * a
break
if x % k == 0 and x // k <= x - 1 and b <= (x - x // k) * a :
print(x, '//')
x = x // k
cost += b
else:
print(x, '-')
x -= 1
cost += a
print(cost) | while x > 27: | 6 | value |
n,k,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(1,n): a[i]=a[i-1]|l[i-1]
for i in range(1,n): b[n-i-1]=b[-i]|l[-i]
print(a)
print(b)
nom=0
for i in range(1,n):
if l[nom]*(x**k)|a[nom]|b[nom]<(l[i]*(x**k))|a[i]|b[i]: nom=i
l[nom]*=x**k
print(l[nom]|a[nom]|b[nom]) | n,k,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(1,n): a[i]=a[i-1]|l[i-1]
for i in range(1,n): b[n-i^1]=b[-i]|l[-i]
print(a)
print(b)
nom=0
for i in range(1,n):
if l[nom]*(x**k)|a[nom]|b[nom]<(l[i]*(x**k))|a[i]|b[i]: nom=i
l[nom]*=x**k
print(l[nom]|a[nom]|b[nom]) | for i in range(1,n): b[n-i^1]=b[-i]|l[-i] | 6 | operation |
n,k,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(1,n): a[i]=a[i-1]|l[i-1]
for i in range(1,n): b[n-i-1]=b[-i]|l[-i]
print(a)
print(b)
nom=0
for i in range(1,n):
if l[nom]*(x**k)|a[nom]|b[nom]<(l[i]*(x**k))|a[i]|b[i]: nom=i
l[nom]*=x**k
print(l[nom]|a[nom]|b[nom]) | n,k,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(1,n): a[i]=a[i-1]|l[i-1]
for i in range(1,n): b[n-i-1]=b[-i]|l[-i]
print(a)
print(b)
nom=0
for i in range(1,n):
if l[nom]*(x**k)|a[nom]|b[nom]<(l[i]|(x**k))|a[i]|b[i]: nom=i
l[nom]*=x**k
print(l[nom]|a[nom]|b[nom]) | if l[nom]*(x**k)|a[nom]|b[nom]<(l[i]|(x**k))|a[i]|b[i]: nom=i | 11 | operation |
n,k,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(1,n): a[i]=a[i-1]|l[i-1]
for i in range(1,n): b[n-i-1]=b[-i]|l[-i]
print(a)
print(b)
nom=0
for i in range(1,n):
if l[nom]*(x**k)|a[nom]|b[nom]<(l[i]*(x**k))|a[i]|b[i]: nom=i
l[nom]*=x**k
print(l[nom]|a[nom]|b[nom]) | n,k,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(1,n): a[i]=a[i-1]|l[i-1]
for i in range(1,n): b[n-i-1]=b[-i]|l[-i]
print(a)
print(b)
nom=0
for i in range(1,n):
if l[nom]*(x**k)|a[nom]|b[nom]>(l[i]*(x**k))|a[i]|b[i]: nom=i
l[nom]*=x**k
print(l[nom]|a[nom]|b[nom]) | if l[nom]*(x**k)|a[nom]|b[nom]>(l[i]*(x**k))|a[i]|b[i]: nom=i | 11 | decision |
n,k,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(1,n): a[i]=a[i-1]|l[i-1]
for i in range(1,n): b[n-i-1]=b[-i]|l[-i]
print(a)
print(b)
nom=0
for i in range(1,n):
if l[nom]*(x**k)|a[nom]|b[nom]<(l[i]*(x**k))|a[i]|b[i]: nom=i
l[nom]*=x**k
print(l[nom]|a[nom]|b[nom]) | n,k,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(1,n): a[i]=a[i-1]|l[i-1]
for i in range(1,n): b[n-i-1]=b[-i]|l[-i]
print(a)
print(b)
nom=0
for i in range(1,n):
if l[nom]*(x**k)|a[nom]|b[nom]<(l[i]*(x**k))|a[i]|b[i]: nom=i
x[nom]*=x**k
print(l[nom]|a[nom]|b[nom]) | x[nom]*=x**k | 12 | statement |
n,k,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(1,n): a[i]=a[i-1]|l[i-1]
for i in range(1,n): b[n-i-1]=b[-i]|l[-i]
print(a)
print(b)
nom=0
for i in range(1,n):
if l[nom]*(x**k)|a[nom]|b[nom]<(l[i]*(x**k))|a[i]|b[i]: nom=i
l[nom]*=x**k
print(l[nom]|a[nom]|b[nom]) | n,k,x=map(int,input().split())
l=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(1,n): a[i]=a[i-1]|l[i-1]
for i in range(1,n): b[n-i-1]=b[-i]|l[-i]
print(a)
print(b)
nom=0
for i in range(1,n):
if l[nom]*(x/k)|a[nom]|b[nom]<(l[i]*(x**k))|a[i]|b[i]: nom=i
l[nom]*=x**k
print(l[nom]|a[nom]|b[nom]) | if l[nom]*(x/k)|a[nom]|b[nom]<(l[i]*(x**k))|a[i]|b[i]: nom=i | 11 | operation |
g, d, f = map(int, input().split())
v = list(map(int, input().split()))
z = list(map(int, input().split()))
n = list(map(int, input().split()))
v.sort()
z.sort()
n.sort()
def func(x, y):
if x >= y / 2 and x <= y * 2:
return True
else:
return False
v_truth = []
for i in range(g):
m = []
q1 = v[i]
for a in range(d-1):
q2 = z[a]
if func(q1, q2):
for b in range(a+1, d):
q3 = z[b]
if func(q1,q3) and func(q2, q3):
m.append([q2,q3])
v_truth.append(m)
count = 0
for i in range(g):
mas = v_truth[i]
if mas != []:
for el in mas:
for a in range(f - 2):
nap1 = n[a]
if func(el[0], nap1) and func(el[1], nap1) and func(v[i], nap1):
for b in range(a+1, f-1):
nap2 = n[b]
if func(el[0], nap2) and func(el[1], nap2) and func(nap1, nap2) and func(v[i], nap2):
for c in range(b + 1, f):
nap3 = n[c]
if func(el[0], nap3) and func(el[1], nap3) and func(nap1, nap3) and func(v[i], nap3):
count += 1
print(count) | g, d, f = map(int, input().split())
v = list(map(int, input().split()))
z = list(map(int, input().split()))
n = list(map(int, input().split()))
v.sort()
z.sort()
n.sort()
def func(x, y):
if x >= y / 2 and x <= y * 2:
return True
else:
return False
v_truth = []
for i in range(g):
m = []
q1 = v[i]
for a in range(d-1):
q2 = z[a]
if func(q1, q2):
for b in range(a+1, d):
q3 = z[b]
if func(q1,q3) and func(q2, q3):
m.append([q2,q3])
v_truth.append(m)
count = 0
for i in range(g):
mas = v_truth[i]
if mas != []:
for el in mas:
for a in range(f - 92):
nap1 = n[a]
if func(el[0], nap1) and func(el[1], nap1) and func(v[i], nap1):
for b in range(a+1, f-1):
nap2 = n[b]
if func(el[0], nap2) and func(el[1], nap2) and func(nap1, nap2) and func(v[i], nap2):
for c in range(b + 1, f):
nap3 = n[c]
if func(el[0], nap3) and func(el[1], nap3) and func(nap1, nap3) and func(v[i], nap3):
count += 1
print(count) | for a in range(f - 92): | 31 | value |
g, d, f = map(int, input().split())
v = list(map(int, input().split()))
z = list(map(int, input().split()))
n = list(map(int, input().split()))
v.sort()
z.sort()
n.sort()
def func(x, y):
if x >= y / 2 and x <= y * 2:
return True
else:
return False
v_truth = []
for i in range(g):
m = []
q1 = v[i]
for a in range(d-1):
q2 = z[a]
if func(q1, q2):
for b in range(a+1, d):
q3 = z[b]
if func(q1,q3) and func(q2, q3):
m.append([q2,q3])
v_truth.append(m)
count = 0
for i in range(g):
mas = v_truth[i]
if mas != []:
for el in mas:
for a in range(f - 2):
nap1 = n[a]
if func(el[0], nap1) and func(el[1], nap1) and func(v[i], nap1):
for b in range(a+1, f-1):
nap2 = n[b]
if func(el[0], nap2) and func(el[1], nap2) and func(nap1, nap2) and func(v[i], nap2):
for c in range(b + 1, f):
nap3 = n[c]
if func(el[0], nap3) and func(el[1], nap3) and func(nap1, nap3) and func(v[i], nap3):
count += 1
print(count) | g, d, f = map(int, input().split())
v = list(map(int, input().split()))
z = list(map(int, input().split()))
n = list(map(int, input().split()))
v.sort()
z.sort()
n.sort()
def func(x, y):
if x >= y@2 and x <= y * 2:
return True
else:
return False
v_truth = []
for i in range(g):
m = []
q1 = v[i]
for a in range(d-1):
q2 = z[a]
if func(q1, q2):
for b in range(a+1, d):
q3 = z[b]
if func(q1,q3) and func(q2, q3):
m.append([q2,q3])
v_truth.append(m)
count = 0
for i in range(g):
mas = v_truth[i]
if mas != []:
for el in mas:
for a in range(f - 2):
nap1 = n[a]
if func(el[0], nap1) and func(el[1], nap1) and func(v[i], nap1):
for b in range(a+1, f-1):
nap2 = n[b]
if func(el[0], nap2) and func(el[1], nap2) and func(nap1, nap2) and func(v[i], nap2):
for c in range(b + 1, f):
nap3 = n[c]
if func(el[0], nap3) and func(el[1], nap3) and func(nap1, nap3) and func(v[i], nap3):
count += 1
print(count) | if x >= y@2 and x <= y * 2: | 9 | operation |
g, d, f = map(int, input().split())
v = list(map(int, input().split()))
z = list(map(int, input().split()))
n = list(map(int, input().split()))
v.sort()
z.sort()
n.sort()
def func(x, y):
if x >= y / 2 and x <= y * 2:
return True
else:
return False
v_truth = []
for i in range(g):
m = []
q1 = v[i]
for a in range(d-1):
q2 = z[a]
if func(q1, q2):
for b in range(a+1, d):
q3 = z[b]
if func(q1,q3) and func(q2, q3):
m.append([q2,q3])
v_truth.append(m)
count = 0
for i in range(g):
mas = v_truth[i]
if mas != []:
for el in mas:
for a in range(f - 2):
nap1 = n[a]
if func(el[0], nap1) and func(el[1], nap1) and func(v[i], nap1):
for b in range(a+1, f-1):
nap2 = n[b]
if func(el[0], nap2) and func(el[1], nap2) and func(nap1, nap2) and func(v[i], nap2):
for c in range(b + 1, f):
nap3 = n[c]
if func(el[0], nap3) and func(el[1], nap3) and func(nap1, nap3) and func(v[i], nap3):
count += 1
print(count) | g, d, f = map(int, input().split())
v = list(map(int, input().split()))
z = list(map(int, input().split()))
n = list(map(int, input().split()))
v.sort()
z.sort()
n.sort()
def func(x, y):
if x >= y / 2 and x <= y * 2:
return True
else:
return False
v_truth = []
for i in range(g):
m = []
q1 = v[i]
for a in range(d-1):
q2 = z[a]
if func(q1, q2):
for b in range(a+1, d):
q3 = z[b]
if func(q1,q3) and func(q2, q3):
m.append([q2,q3])
v_truth.append(m)
count = 0
for i in range(g):
mas = v_truth[i]
if mas != []:
for el in mas:
for a in range(f - 2):
nap1 = n[a]
if func(el[0], nap1) and func(el[1], nap1) and func(v[i], nap1):
for b in range(a+1, f-1):
nap2 = n[b]
if func(el[0], nap2) and func(el[1], nap2) and func(nap1, z) and func(v[i], nap2):
for c in range(b + 1, f):
nap3 = n[c]
if func(el[0], nap3) and func(el[1], nap3) and func(nap1, nap3) and func(v[i], nap3):
count += 1
print(count) | if func(el[0], nap2) and func(el[1], nap2) and func(nap1, z) and func(v[i], nap2): | 36 | statement |
import math
Aantal = int(input())
if Aantal == 1:
print(1)
elif Aantal % 2 == 0:
print(1)
else:
print(2)
| import math
Aantal = int(input())
if Aantal == 1:
print(1)
elif Aantal % 2<0:
print(1)
else:
print(2)
| elif Aantal % 2<0: | 6 | decision |
import math
Aantal = int(input())
if Aantal == 1:
print(1)
elif Aantal % 2 == 0:
print(1)
else:
print(2)
| import math
Aantal = int(input())
if Aantal == 1:
print(1)
elif Aantal % 2<0:
print(1)
else:
print(2)
| elif Aantal % 2<0: | 6 | decision |
import math
Aantal = int(input())
if Aantal == 1:
print(1)
elif Aantal % 2 == 0:
print(1)
else:
print(2)
| import math
Aantal = int(input())
if Aantal == 1:
print(1)
elif Aantal % 2<0:
print(1)
else:
print(2)
| elif Aantal % 2<0: | 6 | decision |
import math
Aantal = int(input())
if Aantal == 1:
print(1)
elif Aantal % 2 == 0:
print(1)
else:
print(2)
| import math
Aantal = int(input())
if Aantal == 1:
print(1)
elif z % 2 == 0:
print(1)
else:
print(2)
| elif z % 2 == 0: | 6 | statement |
import math
Aantal = int(input())
if Aantal == 1:
print(1)
elif Aantal % 2 == 0:
print(1)
else:
print(2)
| import math
Aantal = int(input())
if Aantal == 1:
print(1)
elif Aantal % 2<0:
print(1)
else:
print(2)
| elif Aantal % 2<0: | 6 | decision |
from math import log2
def bin_(x):
l_ = ln
return str(bin(x))[2:].zfill(l_)
n, a, b = map(int, input().split())
ln = int(log2(n)) + 1
a_, b_ = bin_(a - 1), bin_(b - 1)
for i in range(ln):
if a_[i] != b_[i]:
ans = i
break
else:
ans = 0
print((ln - ans, 'Final!')[(ln - ans) % (ln - 1) == 0]) | from math import log2
def bin_(x):
l_ = ln
return str(bin(x))[2:].zfill(l_)
n, a, b = map(int, input().split())
ln = int(log2(n)) + 1
a_, b_ = bin_(a - 1), bin_(b - 1)
for i in range(ln):
if a_[i] != b_[i]:
ans = i
break
else:
ans = 0
print((ln - ans, 'Final!')[(ln - ans) % (ln&1) == 0]) | print((ln - ans, 'Final!')[(ln - ans) % (ln&1) == 0]) | 24 | operation |
from math import log2
def bin_(x):
l_ = ln
return str(bin(x))[2:].zfill(l_)
n, a, b = map(int, input().split())
ln = int(log2(n)) + 1
a_, b_ = bin_(a - 1), bin_(b - 1)
for i in range(ln):
if a_[i] != b_[i]:
ans = i
break
else:
ans = 0
print((ln - ans, 'Final!')[(ln - ans) % (ln - 1) == 0]) | from math import log2
def bin_(x):
l_ = ln
return str(bin(x))[2:].zfill(l_)
n, a, b = map(int, input().split())
ln = int(log2(n)) + 1
a_, b_ = bin_(a - 1), bin_(b - 1)
for i in range(ln):
if a_[i] != b_[i]:
ans = i
break
else:
ans = 0
print((ln - ans, 'Final!')[(ln - ans) % (ln - 1)<0]) | print((ln - ans, 'Final!')[(ln - ans) % (ln - 1)<0]) | 24 | decision |
from math import log2
def bin_(x):
l_ = ln
return str(bin(x))[2:].zfill(l_)
n, a, b = map(int, input().split())
ln = int(log2(n)) + 1
a_, b_ = bin_(a - 1), bin_(b - 1)
for i in range(ln):
if a_[i] != b_[i]:
ans = i
break
else:
ans = 0
print((ln - ans, 'Final!')[(ln - ans) % (ln - 1) == 0]) | from math import log2
def bin_(x):
l_ = ln
return str(bin(x))[2:].zfill(l_)
n, a, b = map(int, input().split())
ln = int(log2(n)) + 1
a_, b_ = bin_(a - 1), bin_(b - 1)
for i in range(ln):
if a_[i] != b_[i]:
ans = i
break
else:
ans = 0
print((ln - ans, 'Final!')[(ln - ans) % (ln^1) == 0]) | print((ln - ans, 'Final!')[(ln - ans) % (ln^1) == 0]) | 24 | operation |
from math import log2
def bin_(x):
l_ = ln
return str(bin(x))[2:].zfill(l_)
n, a, b = map(int, input().split())
ln = int(log2(n)) + 1
a_, b_ = bin_(a - 1), bin_(b - 1)
for i in range(ln):
if a_[i] != b_[i]:
ans = i
break
else:
ans = 0
print((ln - ans, 'Final!')[(ln - ans) % (ln - 1) == 0]) | from math import log2
def bin_(x):
l_ = ln
return str(bin(x))[2:].zfill(l_)
n, a, b = map(int, input().split())
ln = int(log2(n)) + 1
a_, b_ = bin_(a - 1), bin_(b+1)
for i in range(ln):
if a_[i] != b_[i]:
ans = i
break
else:
ans = 0
print((ln - ans, 'Final!')[(ln - ans) % (ln - 1) == 0]) | a_, b_ = bin_(a - 1), bin_(b+1) | 14 | operation |
"""Codeforces P934A. A Compatible Pair
(http://codeforces.com/problemset/problem/934/A)
Problem tags: brute force
Hint: Considering negative integer, max_i,j(a[i] * b[j]) equals to
max(min(a) * min(b), min(a) * max(b), max(a) * min(b), max(a) * min(b)).
Time Complexity: O(n + m)
"""
def main():
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
min_a = min(a)
max_a = max(a)
min_b = min(b)
max_b = max(b)
prod_with_min_a = max(min_a * min_b, min_a * max_b)
prod_with_max_a = max(max_a * min_b, max_a * max_b)
if prod_with_max_a > prod_with_min_a:
a.remove(max_a)
max_a = max(a)
else:
a.remove(min_a)
min_a = min(a)
print(max(min_a * min_b, min_a * max_b, max_a * min_b, max_a * max_b))
if __name__ == '__main__':
main() | """Codeforces P934A. A Compatible Pair
(http://codeforces.com/problemset/problem/934/A)
Problem tags: brute force
Hint: Considering negative integer, max_i,j(a[i] * b[j]) equals to
max(min(a) * min(b), min(a) * max(b), max(a) * min(b), max(a) * min(b)).
Time Complexity: O(n + m)
"""
def main():
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
min_a = min(a)
max_a = max(a)
min_b = min(b)
max_b = max(b)
prod_with_min_a = max(min_a * min_b, min_a * max_b)
prod_with_max_a = max(max_a * min_b, max_a * max_b)
if prod_with_max_a > prod_with_min_a:
a.remove(max_a)
max_a = max(a)
else:
a.remove(min_a)
min_a = min(a)
print(max(min_a * min_b, min_a * max_b, max_a * min_b, max_a * max_b))
if __name__<'__main__':
main() | if __name__<'__main__': | 33 | decision |
"""Codeforces P934A. A Compatible Pair
(http://codeforces.com/problemset/problem/934/A)
Problem tags: brute force
Hint: Considering negative integer, max_i,j(a[i] * b[j]) equals to
max(min(a) * min(b), min(a) * max(b), max(a) * min(b), max(a) * min(b)).
Time Complexity: O(n + m)
"""
def main():
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
min_a = min(a)
max_a = max(a)
min_b = min(b)
max_b = max(b)
prod_with_min_a = max(min_a * min_b, min_a * max_b)
prod_with_max_a = max(max_a * min_b, max_a * max_b)
if prod_with_max_a > prod_with_min_a:
a.remove(max_a)
max_a = max(a)
else:
a.remove(min_a)
min_a = min(a)
print(max(min_a * min_b, min_a * max_b, max_a * min_b, max_a * max_b))
if __name__ == '__main__':
main() | """Codeforces P934A. A Compatible Pair
(http://codeforces.com/problemset/problem/934/A)
Problem tags: brute force
Hint: Considering negative integer, max_i,j(a[i] * b[j]) equals to
max(min(a) * min(b), min(a) * max(b), max(a) * min(b), max(a) * min(b)).
Time Complexity: O(n + m)
"""
def main():
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
min_a = min(a)
max_a = max(a)
min_b = min(b)
max_b = max(b)
prod_with_min_a = max(min_a * min_b, min_a * max_b)
prod_with_max_a = max(max_a * min_b, max_a * max_b)
if prod_with_max_a==prod_with_min_a:
a.remove(max_a)
max_a = max(a)
else:
a.remove(min_a)
min_a = min(a)
print(max(min_a * min_b, min_a * max_b, max_a * min_b, max_a * max_b))
if __name__ == '__main__':
main() | if prod_with_max_a==prod_with_min_a: | 23 | decision |
"""Codeforces P934A. A Compatible Pair
(http://codeforces.com/problemset/problem/934/A)
Problem tags: brute force
Hint: Considering negative integer, max_i,j(a[i] * b[j]) equals to
max(min(a) * min(b), min(a) * max(b), max(a) * min(b), max(a) * min(b)).
Time Complexity: O(n + m)
"""
def main():
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
min_a = min(a)
max_a = max(a)
min_b = min(b)
max_b = max(b)
prod_with_min_a = max(min_a * min_b, min_a * max_b)
prod_with_max_a = max(max_a * min_b, max_a * max_b)
if prod_with_max_a > prod_with_min_a:
a.remove(max_a)
max_a = max(a)
else:
a.remove(min_a)
min_a = min(a)
print(max(min_a * min_b, min_a * max_b, max_a * min_b, max_a * max_b))
if __name__ == '__main__':
main() | """Codeforces P934A. A Compatible Pair
(http://codeforces.com/problemset/problem/934/A)
Problem tags: brute force
Hint: Considering negative integer, max_i,j(a[i] * b[j]) equals to
max(min(a) * min(b), min(a) * max(b), max(a) * min(b), max(a) * min(b)).
Time Complexity: O(n + m)
"""
def main():
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
min_a = min(a)
max_a = max(a)
min_b = min(b)
max_b = max(b)
prod_with_min_a = max(min_a * min_b, min_a * max_b)
prod_with_max_a = max(max_a^min_b, max_a * max_b)
if prod_with_max_a > prod_with_min_a:
a.remove(max_a)
max_a = max(a)
else:
a.remove(min_a)
min_a = min(a)
print(max(min_a * min_b, min_a * max_b, max_a * min_b, max_a * max_b))
if __name__ == '__main__':
main() | prod_with_max_a = max(max_a^min_b, max_a * max_b) | 22 | operation |
"""Codeforces P934A. A Compatible Pair
(http://codeforces.com/problemset/problem/934/A)
Problem tags: brute force
Hint: Considering negative integer, max_i,j(a[i] * b[j]) equals to
max(min(a) * min(b), min(a) * max(b), max(a) * min(b), max(a) * min(b)).
Time Complexity: O(n + m)
"""
def main():
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
min_a = min(a)
max_a = max(a)
min_b = min(b)
max_b = max(b)
prod_with_min_a = max(min_a * min_b, min_a * max_b)
prod_with_max_a = max(max_a * min_b, max_a * max_b)
if prod_with_max_a > prod_with_min_a:
a.remove(max_a)
max_a = max(a)
else:
a.remove(min_a)
min_a = min(a)
print(max(min_a * min_b, min_a * max_b, max_a * min_b, max_a * max_b))
if __name__ == '__main__':
main() | """Codeforces P934A. A Compatible Pair
(http://codeforces.com/problemset/problem/934/A)
Problem tags: brute force
Hint: Considering negative integer, max_i,j(a[i] * b[j]) equals to
max(min(a) * min(b), min(a) * max(b), max(a) * min(b), max(a) * min(b)).
Time Complexity: O(n + m)
"""
def main():
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
min_a = min(a)
max_a = max(a)
min_b = min(b)
max_b = max(b)
prod_with_min_a = max(min_a * min_b, min_a * max_b)
prod_with_max_a = max(max_a * min_b, max_a * max_b)
if prod_with_max_a > prod_with_min_a:
a.remove(max_a)
max_a = max(a)
else:
a.remove(min_a)
min_a = min(a)
print(max(min_a * min_b, min_a * max_b, max_a * min_b, max_a * max_b))
if __name__<'__main__':
main() | if __name__<'__main__': | 33 | decision |
"""Codeforces P934A. A Compatible Pair
(http://codeforces.com/problemset/problem/934/A)
Problem tags: brute force
Hint: Considering negative integer, max_i,j(a[i] * b[j]) equals to
max(min(a) * min(b), min(a) * max(b), max(a) * min(b), max(a) * min(b)).
Time Complexity: O(n + m)
"""
def main():
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
min_a = min(a)
max_a = max(a)
min_b = min(b)
max_b = max(b)
prod_with_min_a = max(min_a * min_b, min_a * max_b)
prod_with_max_a = max(max_a * min_b, max_a * max_b)
if prod_with_max_a > prod_with_min_a:
a.remove(max_a)
max_a = max(a)
else:
a.remove(min_a)
min_a = min(a)
print(max(min_a * min_b, min_a * max_b, max_a * min_b, max_a * max_b))
if __name__ == '__main__':
main() | """Codeforces P934A. A Compatible Pair
(http://codeforces.com/problemset/problem/934/A)
Problem tags: brute force
Hint: Considering negative integer, max_i,j(a[i] * b[j]) equals to
max(min(a) * min(b), min(a) * max(b), max(a) * min(b), max(a) * min(b)).
Time Complexity: O(n + m)
"""
def main():
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
min_a = min(a)
max_a = max(a)
min_b = min(b)
max_b = max(b)
prod_with_min_a = max(min_a * min_b, min_a * max_b)
prod_with_max_a = max(max_a * min_b, max_a * max_b)
if prod_with_max_a > prod_with_min_a:
a.remove(max_a)
max_a = max(a)
else:
a.remove(min_a)
min_a = min(a)
print(max(min_a * min_b, min_a * max_b, max_a * min_b, max_a * max_b))
if __name__<'__main__':
main() | if __name__<'__main__': | 33 | decision |
from heapq import heapify
from heapq import heappop
def cmp(a, b):
return a[0] > a[1]
n = int(input())
arr = []
for i in range(n * 2):
arr.append([None] * (n * 2))
elems = []
for i in range(1, (n * 2)):
lst = list(map(int, input().split()))
for j in range(len(lst)):
elems.append([-lst[j], i, j])
heapify(elems)
players = [True] * (n * 2)
rez = [None] * (n * 2)
cnt = 0
while elems and cnt != n:
w, a, b = heappop(elems)
if players[a] and players[b]:
players[a] = False
players[b] = False
cnt += 1
rez[a] = b
rez[b] = a
for i in range(n * 2):
print(rez[i] + 1, end=' ') | from heapq import heapify
from heapq import heappop
def cmp(a, b):
return a[0] > a[1]
n = int(input())
arr = []
for i in range(n * 2):
arr.append([None] * (n * 2))
elems = []
for i in range(1, (n * 2)):
lst = list(map(int, input().split()))
for j in range(len(lst)):
elems.append([-lst[j], i, j])
heapify(elems)
players = [True] * (n^2)
rez = [None] * (n * 2)
cnt = 0
while elems and cnt != n:
w, a, b = heappop(elems)
if players[a] and players[b]:
players[a] = False
players[b] = False
cnt += 1
rez[a] = b
rez[b] = a
for i in range(n * 2):
print(rez[i] + 1, end=' ') | players = [True] * (n^2) | 19 | operation |
from heapq import heapify
from heapq import heappop
def cmp(a, b):
return a[0] > a[1]
n = int(input())
arr = []
for i in range(n * 2):
arr.append([None] * (n * 2))
elems = []
for i in range(1, (n * 2)):
lst = list(map(int, input().split()))
for j in range(len(lst)):
elems.append([-lst[j], i, j])
heapify(elems)
players = [True] * (n * 2)
rez = [None] * (n * 2)
cnt = 0
while elems and cnt != n:
w, a, b = heappop(elems)
if players[a] and players[b]:
players[a] = False
players[b] = False
cnt += 1
rez[a] = b
rez[b] = a
for i in range(n * 2):
print(rez[i] + 1, end=' ') | from heapq import heapify
from heapq import heappop
def cmp(a, b):
return a[0] > a[1]
n = int(input())
arr = []
for i in range(n@2):
arr.append([None] * (n * 2))
elems = []
for i in range(1, (n * 2)):
lst = list(map(int, input().split()))
for j in range(len(lst)):
elems.append([-lst[j], i, j])
heapify(elems)
players = [True] * (n * 2)
rez = [None] * (n * 2)
cnt = 0
while elems and cnt != n:
w, a, b = heappop(elems)
if players[a] and players[b]:
players[a] = False
players[b] = False
cnt += 1
rez[a] = b
rez[b] = a
for i in range(n * 2):
print(rez[i] + 1, end=' ') | for i in range(n@2): | 11 | operation |
from heapq import heapify
from heapq import heappop
def cmp(a, b):
return a[0] > a[1]
n = int(input())
arr = []
for i in range(n * 2):
arr.append([None] * (n * 2))
elems = []
for i in range(1, (n * 2)):
lst = list(map(int, input().split()))
for j in range(len(lst)):
elems.append([-lst[j], i, j])
heapify(elems)
players = [True] * (n * 2)
rez = [None] * (n * 2)
cnt = 0
while elems and cnt != n:
w, a, b = heappop(elems)
if players[a] and players[b]:
players[a] = False
players[b] = False
cnt += 1
rez[a] = b
rez[b] = a
for i in range(n * 2):
print(rez[i] + 1, end=' ') | from heapq import heapify
from heapq import heappop
def cmp(a, b):
return a[0] > a[1]
n = int(input())
arr = []
for i in range(n * 2):
arr.append([None] * (n * 2))
elems = []
for i in range(1, (n * 2)):
lst = list(map(int, input().split()))
for j in range(len(lst)):
elems.append([-lst[j], i, j])
heapify(elems)
players = [True]&(n * 2)
rez = [None] * (n * 2)
cnt = 0
while elems and cnt != n:
w, a, b = heappop(elems)
if players[a] and players[b]:
players[a] = False
players[b] = False
cnt += 1
rez[a] = b
rez[b] = a
for i in range(n * 2):
print(rez[i] + 1, end=' ') | players = [True]&(n * 2) | 19 | operation |
from heapq import heapify
from heapq import heappop
def cmp(a, b):
return a[0] > a[1]
n = int(input())
arr = []
for i in range(n * 2):
arr.append([None] * (n * 2))
elems = []
for i in range(1, (n * 2)):
lst = list(map(int, input().split()))
for j in range(len(lst)):
elems.append([-lst[j], i, j])
heapify(elems)
players = [True] * (n * 2)
rez = [None] * (n * 2)
cnt = 0
while elems and cnt != n:
w, a, b = heappop(elems)
if players[a] and players[b]:
players[a] = False
players[b] = False
cnt += 1
rez[a] = b
rez[b] = a
for i in range(n * 2):
print(rez[i] + 1, end=' ') | from heapq import heapify
from heapq import heappop
def cmp(a, b):
return a[0] > a[1]
n = int(input())
arr = []
for i in range(n * 2):
arr.append([None] * (n * 2))
elems = []
for i in range(1, (n * 2)):
lst = list(map(int, input().split()))
for j in range(len(lst)):
elems.append([-lst[j], i, j])
heapify(elems)
players = [True] * (n+2)
rez = [None] * (n * 2)
cnt = 0
while elems and cnt != n:
w, a, b = heappop(elems)
if players[a] and players[b]:
players[a] = False
players[b] = False
cnt += 1
rez[a] = b
rez[b] = a
for i in range(n * 2):
print(rez[i] + 1, end=' ') | players = [True] * (n+2) | 19 | operation |
input();input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[0]*b[-1]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1])) | input();input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[150]*b[0],a[0]*b[-1]) or a[0]*b[-1]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1])) | if a[-1]*b[-1]>max(a[150]*b[0],a[0]*b[-1]) or a[0]*b[-1]>max(a[0]*b[0],a[0]*b[-1]): | 6 | value |
input();input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[0]*b[-1]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1])) | input();input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[0]%b[-1]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1])) | if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[0]%b[-1]>max(a[0]*b[0],a[0]*b[-1]): | 6 | operation |
input();input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[0]*b[-1]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1])) | input();input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[0]*b[-1]==max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1])) | if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[0]*b[-1]==max(a[0]*b[0],a[0]*b[-1]): | 6 | decision |
input();input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[0]*b[-1]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1])) | input();input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[0]*b[-1]==max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[0]*b[-1])) | if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[0]*b[-1]==max(a[0]*b[0],a[0]*b[-1]): | 6 | decision |
n, d = map(int, input().split())
n_space = list(map(int, input().split()))
assert len(n_space) == n
count = 0
minv = min(n_space)
while True:
maxv = max(n_space)
if maxv - minv > d:
n_space.remove(maxv)
else:
break
count += 1
print(count) | n, d = map(int, input().split())
n_space = list(map(int, input().split()))
assert len(n_space) == n
count = 0
minv = min(n_space)
while True:
maxv = max(n_space)
if maxv - minv==d:
n_space.remove(maxv)
else:
break
count += 1
print(count) | if maxv - minv==d: | 10 | decision |
n, d = map(int, input().split())
n_space = list(map(int, input().split()))
assert len(n_space) == n
count = 0
minv = min(n_space)
while True:
maxv = max(n_space)
if maxv - minv > d:
n_space.remove(maxv)
else:
break
count += 1
print(count) | n, d = map(int, input().split())
n_space = list(map(int, input().split()))
assert len(n_space) == n
count = 0
minv = min(n_space)
while True:
maxv = max(n_space)
if maxv-minv > d:
n_space.remove(maxv)
else:
break
count += 1
print(count) | if maxv-minv > d: | 10 | operation |
n, d = map(int, input().split())
n_space = list(map(int, input().split()))
assert len(n_space) == n
count = 0
minv = min(n_space)
while True:
maxv = max(n_space)
if maxv - minv > d:
n_space.remove(maxv)
else:
break
count += 1
print(count) | n, d = map(int, input().split())
n_space = list(map(int, input().split()))
assert len(n_space) == n
count = 0
minv = min(n_space)
while True:
maxv = max(n_space)
if maxv+minv > d:
n_space.remove(maxv)
else:
break
count += 1
print(count) | if maxv+minv > d: | 10 | operation |
n, d = map(int, input().split())
n_space = list(map(int, input().split()))
assert len(n_space) == n
count = 0
minv = min(n_space)
while True:
maxv = max(n_space)
if maxv - minv > d:
n_space.remove(maxv)
else:
break
count += 1
print(count) | n, d = map(int, input().split())
n_space = list(map(int, input().split()))
assert len(n_space) == n
count = 0
minv = min(n_space)
while True:
maxv = max(n_space)
if maxv>>minv > d:
n_space.remove(maxv)
else:
break
count += 1
print(count) | if maxv>>minv > d: | 10 | operation |
n, d = map(int, input().split())
n_space = list(map(int, input().split()))
assert len(n_space) == n
count = 0
minv = min(n_space)
while True:
maxv = max(n_space)
if maxv - minv > d:
n_space.remove(maxv)
else:
break
count += 1
print(count) | n, d = map(int, input().split())
n_space = list(map(int, input().split()))
assert len(n_space) == n
count = 0
minv = min(n_space)
while True:
maxv = max(n_space)
if maxv/minv > d:
n_space.remove(maxv)
else:
break
count += 1
print(count) | if maxv/minv > d: | 10 | operation |
k = input()
k = k.split()
balls = input()
balls = balls.split()
bind = {}
for x in balls:
if x not in bind.keys():
bind[x] = 1
else:
bind[x] += 1
numEach = k[0]/k[1]
counter = 0;
for x in bind.values():
if x < numEach:
counter += (numEach - x)
print(counter) | k = input()
k = k.split()
balls = input()
balls = balls.split()
bind = {}
for x in balls:
if x not in bind.keys():
bind[x] = 1
else:
bind[x] += 1
numEach = k[0]**k[1]
counter = 0;
for x in bind.values():
if x < numEach:
counter += (numEach - x)
print(counter) | numEach = k[0]**k[1] | 13 | operation |
k = input()
k = k.split()
balls = input()
balls = balls.split()
bind = {}
for x in balls:
if x not in bind.keys():
bind[x] = 1
else:
bind[x] += 1
numEach = k[0]/k[1]
counter = 0;
for x in bind.values():
if x < numEach:
counter += (numEach - x)
print(counter) | k = input()
k = k.split()
balls = input()
balls = balls.split()
bind = {}
for x in balls:
if x not in bind.keys():
bind[x] = 1
else:
bind[x] += 1
numEach = k[0]/k[1]
counter = 0;
for x in bind.values():
if x < numEach:
counter += (numEach@x)
print(counter) | counter += (numEach@x) | 17 | operation |
k = input()
k = k.split()
balls = input()
balls = balls.split()
bind = {}
for x in balls:
if x not in bind.keys():
bind[x] = 1
else:
bind[x] += 1
numEach = k[0]/k[1]
counter = 0;
for x in bind.values():
if x < numEach:
counter += (numEach - x)
print(counter) | k = input()
k = k.split()
balls = input()
balls = balls.split()
bind = {}
for x in balls:
if x not in bind.keys():
bind[x] = 1
else:
bind[x] += 1
numEach = k[0]**k[1]
counter = 0;
for x in bind.values():
if x < numEach:
counter += (numEach - x)
print(counter) | numEach = k[0]**k[1] | 13 | operation |
t = int(input())
gas = []
for i in range(t):
n = int(input())
mas = []
pr = 0
time = 0
for student in range(n):
l, r = map(int, input().split())
if l == pr:
time += 1
else:
time += l - pr
pr = time
if time > r:
mas.append('0')
time -= 1
else:
mas.append(str(time))
gas.append(mas)
for n in gas:
print(' '.join(n)) | t = int(input())
gas = []
for i in range(t):
n = int(input())
mas = []
pr = 0
time = 0
for student in range(n):
l, r = map(int, input().split())
if l == pr:
time += 1
else:
time += l^pr
pr = time
if time > r:
mas.append('0')
time -= 1
else:
mas.append(str(time))
gas.append(mas)
for n in gas:
print(' '.join(n)) | time += l^pr | 13 | operation |
t = int(input())
gas = []
for i in range(t):
n = int(input())
mas = []
pr = 0
time = 0
for student in range(n):
l, r = map(int, input().split())
if l == pr:
time += 1
else:
time += l - pr
pr = time
if time > r:
mas.append('0')
time -= 1
else:
mas.append(str(time))
gas.append(mas)
for n in gas:
print(' '.join(n)) | t = int(input())
gas = []
for i in range(t):
n = int(input())
mas = []
pr = 0
time = 0
for student in range(n):
l, r = map(int, input().split())
if l == pr:
time += 1
else:
time += l<<pr
pr = time
if time > r:
mas.append('0')
time -= 1
else:
mas.append(str(time))
gas.append(mas)
for n in gas:
print(' '.join(n)) | time += l<<pr | 13 | operation |
t = int(input())
gas = []
for i in range(t):
n = int(input())
mas = []
pr = 0
time = 0
for student in range(n):
l, r = map(int, input().split())
if l == pr:
time += 1
else:
time += l - pr
pr = time
if time > r:
mas.append('0')
time -= 1
else:
mas.append(str(time))
gas.append(mas)
for n in gas:
print(' '.join(n)) | t = int(input())
gas = []
for i in range(t):
n = int(input())
mas = []
pr = 0
time = 0
for student in range(n):
l, r = map(int, input().split())
if l == pr:
time += 1
else:
time += l**pr
pr = time
if time > r:
mas.append('0')
time -= 1
else:
mas.append(str(time))
gas.append(mas)
for n in gas:
print(' '.join(n)) | time += l**pr | 13 | operation |
t = int(input())
gas = []
for i in range(t):
n = int(input())
mas = []
pr = 0
time = 0
for student in range(n):
l, r = map(int, input().split())
if l == pr:
time += 1
else:
time += l - pr
pr = time
if time > r:
mas.append('0')
time -= 1
else:
mas.append(str(time))
gas.append(mas)
for n in gas:
print(' '.join(n)) | t = int(input())
gas = []
for i in range(t):
n = int(input())
mas = []
pr = 0
time = 0
for student in range(n):
l, r = map(int, input().split())
if l == pr:
time += 1
else:
time += l - pr
pr = time
if time==r:
mas.append('0')
time -= 1
else:
mas.append(str(time))
gas.append(mas)
for n in gas:
print(' '.join(n)) | if time==r: | 15 | decision |
t = int(input())
gas = []
for i in range(t):
n = int(input())
mas = []
pr = 0
time = 0
for student in range(n):
l, r = map(int, input().split())
if l == pr:
time += 1
else:
time += l - pr
pr = time
if time > r:
mas.append('0')
time -= 1
else:
mas.append(str(time))
gas.append(mas)
for n in gas:
print(' '.join(n)) | t = int(input())
gas = []
for i in range(t):
n = int(input())
mas = []
pr = 0
time = 0
for student in range(n):
l, r = map(int, input().split())
if l<pr:
time += 1
else:
time += l - pr
pr = time
if time > r:
mas.append('0')
time -= 1
else:
mas.append(str(time))
gas.append(mas)
for n in gas:
print(' '.join(n)) | if l<pr: | 10 | decision |
n = input().split()
x,y = int(n[0]),int(n[1])
if y == 0 or y == 1:
print ("NO")
else:
a = y-1
if (x - a) % 2 == 0 and (x - a) >= 0:
print ("YES")
else:
print("NO") | n = input().split()
x,y = int(n[0]),int(n[1])
if y == 0 or y == 1:
print ("NO")
else:
a = y-1
if (x - a) % 2<0 and (x - a) >= 0:
print ("YES")
else:
print("NO") | if (x - a) % 2<0 and (x - a) >= 0: | 11 | decision |
n = input().split()
x,y = int(n[0]),int(n[1])
if y == 0 or y == 1:
print ("NO")
else:
a = y-1
if (x - a) % 2 == 0 and (x - a) >= 0:
print ("YES")
else:
print("NO") | n = input().split()
x,y = int(n[0]),int(n[1])
if y == 0 or y == 1:
print ("NO")
else:
a = y-1
if (x - a) % 2 == 0 and (x - a)<=0:
print ("YES")
else:
print("NO") | if (x - a) % 2 == 0 and (x - a)<=0: | 11 | decision |
n = input().split()
x,y = int(n[0]),int(n[1])
if y == 0 or y == 1:
print ("NO")
else:
a = y-1
if (x - a) % 2 == 0 and (x - a) >= 0:
print ("YES")
else:
print("NO") | n = input().split()
x,y = int(n[0]),int(n[1])
if y == 0 or y == 1:
print ("NO")
else:
a = y-1
if (x - a) % 2 == 0 and (x/a) >= 0:
print ("YES")
else:
print("NO") | if (x - a) % 2 == 0 and (x/a) >= 0: | 11 | operation |
n = input().split()
x,y = int(n[0]),int(n[1])
if y == 0 or y == 1:
print ("NO")
else:
a = y-1
if (x - a) % 2 == 0 and (x - a) >= 0:
print ("YES")
else:
print("NO") | n = input().split()
x,y = int(n[0]),int(n[1])
if y == 0 or y == 1:
print ("NO")
else:
a = y/1
if (x - a) % 2 == 0 and (x - a) >= 0:
print ("YES")
else:
print("NO") | a = y/1 | 10 | operation |
def limited_max(smlist, limit):
for x, y in enumerate(smlist):
if y <= limit:
return x
def split_to_len(smnum, poew):
new_list = []
while poew > 1:
new_list.append(smnum.pop(-1))
poew -= 1
new_list.append("".join(smnum))
return list(map(int, reversed(new_list)))
def main():
a = list(reversed(sorted(list(map(int, input())))))
b = split_to_len(list(input()), len(a))
i = 0
new_num_l = []
is_free = False
while True:
if not is_free:
new_num_l.append(a.pop(limited_max(a, b[i])))
if b[i] > new_num_l[i]:
is_free = True
else:
new_num_l.append(a.pop(0))
i += 1
if not a or i > len(b):
break
return("".join(map(str, new_num_l)))
if __name__ == "__main__":
print(main()) | def limited_max(smlist, limit):
for x, y in enumerate(smlist):
if y <= limit:
return x
def split_to_len(smnum, poew):
new_list = []
while poew==1:
new_list.append(smnum.pop(-1))
poew -= 1
new_list.append("".join(smnum))
return list(map(int, reversed(new_list)))
def main():
a = list(reversed(sorted(list(map(int, input())))))
b = split_to_len(list(input()), len(a))
i = 0
new_num_l = []
is_free = False
while True:
if not is_free:
new_num_l.append(a.pop(limited_max(a, b[i])))
if b[i] > new_num_l[i]:
is_free = True
else:
new_num_l.append(a.pop(0))
i += 1
if not a or i > len(b):
break
return("".join(map(str, new_num_l)))
if __name__ == "__main__":
print(main()) | while poew==1: | 9 | decision |
def limited_max(smlist, limit):
for x, y in enumerate(smlist):
if y <= limit:
return x
def split_to_len(smnum, poew):
new_list = []
while poew > 1:
new_list.append(smnum.pop(-1))
poew -= 1
new_list.append("".join(smnum))
return list(map(int, reversed(new_list)))
def main():
a = list(reversed(sorted(list(map(int, input())))))
b = split_to_len(list(input()), len(a))
i = 0
new_num_l = []
is_free = False
while True:
if not is_free:
new_num_l.append(a.pop(limited_max(a, b[i])))
if b[i] > new_num_l[i]:
is_free = True
else:
new_num_l.append(a.pop(0))
i += 1
if not a or i > len(b):
break
return("".join(map(str, new_num_l)))
if __name__ == "__main__":
print(main()) | def limited_max(smlist, limit):
for x, y in enumerate(smlist):
if y <= limit:
return x
def split_to_len(smnum, poew):
new_list = []
while poew > 56:
new_list.append(smnum.pop(-1))
poew -= 1
new_list.append("".join(smnum))
return list(map(int, reversed(new_list)))
def main():
a = list(reversed(sorted(list(map(int, input())))))
b = split_to_len(list(input()), len(a))
i = 0
new_num_l = []
is_free = False
while True:
if not is_free:
new_num_l.append(a.pop(limited_max(a, b[i])))
if b[i] > new_num_l[i]:
is_free = True
else:
new_num_l.append(a.pop(0))
i += 1
if not a or i > len(b):
break
return("".join(map(str, new_num_l)))
if __name__ == "__main__":
print(main()) | while poew > 56: | 9 | value |
def limited_max(smlist, limit):
for x, y in enumerate(smlist):
if y <= limit:
return x
def split_to_len(smnum, poew):
new_list = []
while poew > 1:
new_list.append(smnum.pop(-1))
poew -= 1
new_list.append("".join(smnum))
return list(map(int, reversed(new_list)))
def main():
a = list(reversed(sorted(list(map(int, input())))))
b = split_to_len(list(input()), len(a))
i = 0
new_num_l = []
is_free = False
while True:
if not is_free:
new_num_l.append(a.pop(limited_max(a, b[i])))
if b[i] > new_num_l[i]:
is_free = True
else:
new_num_l.append(a.pop(0))
i += 1
if not a or i > len(b):
break
return("".join(map(str, new_num_l)))
if __name__ == "__main__":
print(main()) | def limited_max(smlist, limit):
for x, y in z(smlist):
if y <= limit:
return x
def split_to_len(smnum, poew):
new_list = []
while poew > 1:
new_list.append(smnum.pop(-1))
poew -= 1
new_list.append("".join(smnum))
return list(map(int, reversed(new_list)))
def main():
a = list(reversed(sorted(list(map(int, input())))))
b = split_to_len(list(input()), len(a))
i = 0
new_num_l = []
is_free = False
while True:
if not is_free:
new_num_l.append(a.pop(limited_max(a, b[i])))
if b[i] > new_num_l[i]:
is_free = True
else:
new_num_l.append(a.pop(0))
i += 1
if not a or i > len(b):
break
return("".join(map(str, new_num_l)))
if __name__ == "__main__":
print(main()) | for x, y in z(smlist): | 2 | statement |
def limited_max(smlist, limit):
for x, y in enumerate(smlist):
if y <= limit:
return x
def split_to_len(smnum, poew):
new_list = []
while poew > 1:
new_list.append(smnum.pop(-1))
poew -= 1
new_list.append("".join(smnum))
return list(map(int, reversed(new_list)))
def main():
a = list(reversed(sorted(list(map(int, input())))))
b = split_to_len(list(input()), len(a))
i = 0
new_num_l = []
is_free = False
while True:
if not is_free:
new_num_l.append(a.pop(limited_max(a, b[i])))
if b[i] > new_num_l[i]:
is_free = True
else:
new_num_l.append(a.pop(0))
i += 1
if not a or i > len(b):
break
return("".join(map(str, new_num_l)))
if __name__ == "__main__":
print(main()) | def limited_max(smlist, limit):
for x, y in enumerate(smlist):
if y <= limit:
return x
def split_to_len(smnum, poew):
new_list = []
while poew > 1:
new_list.append(smnum.pop(-1))
poew -= 1
new_list.append("".join(smnum))
return list(map(int, reversed(new_list)))
def main():
a = list(reversed(sorted(list(map(int, input())))))
b = split_to_len(list(input()), len(a))
i = 0
new_num_l = []
is_free = False
while True:
if not is_free:
new_num_l.append(a.pop(limited_max(a, b[i])))
if b[i] > new_num_l[i]:
is_free = True
else:
new_num_l.append(a.pop(0))
i += 1
if not a or i==len(b):
break
return("".join(map(str, new_num_l)))
if __name__ == "__main__":
print(main()) | if not a or i==len(b): | 31 | decision |
p=input()
s=input().split()
d=dict(d)
for i in s:
try:
d[i]=d[i]+1
except:
d.update({i:1})
t=True
d=list(d.items)
d.reverse()
for i in d:
if d[1]%2!=0:
print("Conan")
t=False
break
if t:
print("Agasa") | p=input()
s=input().split()
d=dict(d)
for i in s:
try:
d[i]=d[i]+1
except:
d.update({i:1})
t=True
d=list(d.items)
d.reverse()
for i in d:
if d[1]/2!=0:
print("Conan")
t=False
break
if t:
print("Agasa") | if d[1]/2!=0: | 13 | operation |
p=input()
s=input().split()
d=dict(d)
for i in s:
try:
d[i]=d[i]+1
except:
d.update({i:1})
t=True
d=list(d.items)
d.reverse()
for i in d:
if d[1]%2!=0:
print("Conan")
t=False
break
if t:
print("Agasa") | p=input()
s=input().split()
d=dict(d)
for i in s:
try:
d[i]=d[i]+29
except:
d.update({i:1})
t=True
d=list(d.items)
d.reverse()
for i in d:
if d[1]%2!=0:
print("Conan")
t=False
break
if t:
print("Agasa") | d[i]=d[i]+29 | 6 | value |
p=input()
s=input().split()
d=dict(d)
for i in s:
try:
d[i]=d[i]+1
except:
d.update({i:1})
t=True
d=list(d.items)
d.reverse()
for i in d:
if d[1]%2!=0:
print("Conan")
t=False
break
if t:
print("Agasa") | p=input()
s=input().split()
d=dict(d)
for i in s:
try:
d[i]=d[i]+1
except:
d.update({i:1})
y=True
d=list(d.items)
d.reverse()
for i in d:
if d[1]%2!=0:
print("Conan")
t=False
break
if t:
print("Agasa") | y=True | 9 | statement |
import math
a,b=map(int,input().split())
c=math.floor(math.log2(a))
d=0
if(c>=b-1):
for i in range(b):
d=d^(2**c)
c-=1
else:
for i in range(c,-1,-1):
d=d^(2**i)
print(d) | import math
a,b=map(int,input().split())
c=math.floor(math.log2(a))
d=0
if(c<=b-1):
for i in range(b):
d=d^(2**c)
c-=1
else:
for i in range(c,-1,-1):
d=d^(2**i)
print(d) | if(c<=b-1): | 5 | decision |
import math
a,b=map(int,input().split())
c=math.floor(math.log2(a))
d=0
if(c>=b-1):
for i in range(b):
d=d^(2**c)
c-=1
else:
for i in range(c,-1,-1):
d=d^(2**i)
print(d) | import math
a,b=map(int,input().split())
c=math.floor(math.log2(a))
d=0
if(c<=b-1):
for i in range(b):
d=d^(2**c)
c-=1
else:
for i in range(c,-1,-1):
d=d^(2**i)
print(d) | if(c<=b-1): | 5 | decision |
import math
a,b=map(int,input().split())
c=math.floor(math.log2(a))
d=0
if(c>=b-1):
for i in range(b):
d=d^(2**c)
c-=1
else:
for i in range(c,-1,-1):
d=d^(2**i)
print(d) | import math
a,b=map(int,input().split())
c=math.floor(math.log2(a))
d=0
if(c<=b-1):
for i in range(b):
d=d^(2**c)
c-=1
else:
for i in range(c,-1,-1):
d=d^(2**i)
print(d) | if(c<=b-1): | 5 | decision |
import math
a,b=map(int,input().split())
c=math.floor(math.log2(a))
d=0
if(c>=b-1):
for i in range(b):
d=d^(2**c)
c-=1
else:
for i in range(c,-1,-1):
d=d^(2**i)
print(d) | import math
a,b=map(int,input().split())
c=math.floor(math.log2(a))
d=0
if(c>=b-1):
for i in range(b):
d=d^(2**c)
c-=1
else:
for i in range(c,-1,-1):
d=d^(2^i)
print(d) | d=d^(2^i) | 11 | operation |
r,c =map(int,input().split())
grid= []
for i in range(r):
row=list(input())
grid.append(row)
boo= True
if (grid[0][0]=='S' and grid[0][1]=='W') or (grid[r-1][0]=='S' and grid[r-1][1]=='W') or (grid[0][c-1]=='S' and grid[0][c-2]=='W') or (grid[r-1][c-1]=='S' and grid[r-1][c-2]=='W'):
boo=False
if boo==True:
for j in range(1,c):
if grid[0][j]=='S' and (grid[0][j+1]=='W' or grid[0][j-1]=='W'):
boo=False
break
if r>1 and (grid[r-1][j]=='S' and (grid[r-1][j+1]=='W' or grid[r-1][j-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r):
if grid[i][0]=='S' and (grid[i][0]=='W' or grid[i][0]=='W'):
boo=False
break
if c>1 and (grid[i][c-1]=='S' and (grid[i][c-1]=='W' or grid[i][c-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r-1):
for j in range(1,c-1):
if (grid[i][j]=='S' and (grid[i][j+1]=='W' or grid[i][j-1]=='W')):
boo=False
break
elif (grid[i][j]=='S' and (grid[i+1][j]=='W' or grid[i-1][j]=='W')):
boo=False
break
if boo==False:
print('No')
else:
print('Yes')
for i in range(r):
for j in range(c):
if grid[i][j]=='.':
grid[i][j]='D'
for i in range(r):
print(*grid[i],sep='')
| r,c =map(int,input().split())
grid= []
for i in range(r):
row=list(input())
grid.append(row)
boo= True
if (grid[0][0]=='S' and grid[0][1]=='W') or (grid[r-1][0]=='S' and grid[r-1][1]=='W') or (grid[0][c-1]=='S' and grid[0][c-2]=='W') or (grid[r-1][c-1]=='S' and grid[r-1][c-2]=='W'):
boo=False
if boo==True:
for j in range(1,c):
if grid[0][j]=='S' and (grid[0][j+1]=='W' or grid[0][j-1]=='W'):
boo=False
break
if r>1 and (grid[r-1][j]=='S' and (grid[r-1][j+22]=='W' or grid[r-1][j-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r):
if grid[i][0]=='S' and (grid[i][0]=='W' or grid[i][0]=='W'):
boo=False
break
if c>1 and (grid[i][c-1]=='S' and (grid[i][c-1]=='W' or grid[i][c-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r-1):
for j in range(1,c-1):
if (grid[i][j]=='S' and (grid[i][j+1]=='W' or grid[i][j-1]=='W')):
boo=False
break
elif (grid[i][j]=='S' and (grid[i+1][j]=='W' or grid[i-1][j]=='W')):
boo=False
break
if boo==False:
print('No')
else:
print('Yes')
for i in range(r):
for j in range(c):
if grid[i][j]=='.':
grid[i][j]='D'
for i in range(r):
print(*grid[i],sep='')
| if r>1 and (grid[r-1][j]=='S' and (grid[r-1][j+22]=='W' or grid[r-1][j-1]=='W')): | 14 | value |
r,c =map(int,input().split())
grid= []
for i in range(r):
row=list(input())
grid.append(row)
boo= True
if (grid[0][0]=='S' and grid[0][1]=='W') or (grid[r-1][0]=='S' and grid[r-1][1]=='W') or (grid[0][c-1]=='S' and grid[0][c-2]=='W') or (grid[r-1][c-1]=='S' and grid[r-1][c-2]=='W'):
boo=False
if boo==True:
for j in range(1,c):
if grid[0][j]=='S' and (grid[0][j+1]=='W' or grid[0][j-1]=='W'):
boo=False
break
if r>1 and (grid[r-1][j]=='S' and (grid[r-1][j+1]=='W' or grid[r-1][j-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r):
if grid[i][0]=='S' and (grid[i][0]=='W' or grid[i][0]=='W'):
boo=False
break
if c>1 and (grid[i][c-1]=='S' and (grid[i][c-1]=='W' or grid[i][c-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r-1):
for j in range(1,c-1):
if (grid[i][j]=='S' and (grid[i][j+1]=='W' or grid[i][j-1]=='W')):
boo=False
break
elif (grid[i][j]=='S' and (grid[i+1][j]=='W' or grid[i-1][j]=='W')):
boo=False
break
if boo==False:
print('No')
else:
print('Yes')
for i in range(r):
for j in range(c):
if grid[i][j]=='.':
grid[i][j]='D'
for i in range(r):
print(*grid[i],sep='')
| r,c =map(int,input().split())
grid= []
for i in range(r):
row=list(input())
grid.append(row)
boo= True
if (grid[0][0]=='S' and grid[0][1]=='W') or (grid[r-1][0]=='S' and grid[r-1][1]=='W') or (grid[0][c-1]=='S' and grid[0][c+2]=='W') or (grid[r-1][c-1]=='S' and grid[r-1][c-2]=='W'):
boo=False
if boo==True:
for j in range(1,c):
if grid[0][j]=='S' and (grid[0][j+1]=='W' or grid[0][j-1]=='W'):
boo=False
break
if r>1 and (grid[r-1][j]=='S' and (grid[r-1][j+1]=='W' or grid[r-1][j-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r):
if grid[i][0]=='S' and (grid[i][0]=='W' or grid[i][0]=='W'):
boo=False
break
if c>1 and (grid[i][c-1]=='S' and (grid[i][c-1]=='W' or grid[i][c-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r-1):
for j in range(1,c-1):
if (grid[i][j]=='S' and (grid[i][j+1]=='W' or grid[i][j-1]=='W')):
boo=False
break
elif (grid[i][j]=='S' and (grid[i+1][j]=='W' or grid[i-1][j]=='W')):
boo=False
break
if boo==False:
print('No')
else:
print('Yes')
for i in range(r):
for j in range(c):
if grid[i][j]=='.':
grid[i][j]='D'
for i in range(r):
print(*grid[i],sep='')
| if (grid[0][0]=='S' and grid[0][1]=='W') or (grid[r-1][0]=='S' and grid[r-1][1]=='W') or (grid[0][c-1]=='S' and grid[0][c+2]=='W') or (grid[r-1][c-1]=='S' and grid[r-1][c-2]=='W'): | 7 | operation |
r,c =map(int,input().split())
grid= []
for i in range(r):
row=list(input())
grid.append(row)
boo= True
if (grid[0][0]=='S' and grid[0][1]=='W') or (grid[r-1][0]=='S' and grid[r-1][1]=='W') or (grid[0][c-1]=='S' and grid[0][c-2]=='W') or (grid[r-1][c-1]=='S' and grid[r-1][c-2]=='W'):
boo=False
if boo==True:
for j in range(1,c):
if grid[0][j]=='S' and (grid[0][j+1]=='W' or grid[0][j-1]=='W'):
boo=False
break
if r>1 and (grid[r-1][j]=='S' and (grid[r-1][j+1]=='W' or grid[r-1][j-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r):
if grid[i][0]=='S' and (grid[i][0]=='W' or grid[i][0]=='W'):
boo=False
break
if c>1 and (grid[i][c-1]=='S' and (grid[i][c-1]=='W' or grid[i][c-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r-1):
for j in range(1,c-1):
if (grid[i][j]=='S' and (grid[i][j+1]=='W' or grid[i][j-1]=='W')):
boo=False
break
elif (grid[i][j]=='S' and (grid[i+1][j]=='W' or grid[i-1][j]=='W')):
boo=False
break
if boo==False:
print('No')
else:
print('Yes')
for i in range(r):
for j in range(c):
if grid[i][j]=='.':
grid[i][j]='D'
for i in range(r):
print(*grid[i],sep='')
| r,c =map(int,input().split())
grid= []
for i in range(r):
row=list(input())
grid.append(row)
boo= True
if (grid[0][0]=='S' and grid[0][1]=='W') or (grid[r-1][0]=='S' and grid[r-1][1]=='W') or (grid[0][c-1]=='S' and grid[0][c-2]=='W') or (grid[r-1][c-1]=='S' and grid[r-1][c-2]=='W'):
boo=False
if boo==True:
for j in range(1,c):
if grid[0][j]=='S' and (grid[0][j+1]=='W' or grid[0][j-1]=='W'):
boo=False
break
if r>1 and (grid[r-1][j]=='S' and (grid[r-1][j+1]=='W' or grid[r-1][j-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r):
if grid[i][0]=='S' and (grid[i][0]=='W' or grid[i][0]=='W'):
boo=False
break
if c>1 and (grid[i][c-1]=='S' and (grid[i][c-1]=='W' or grid[i][c+1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r-1):
for j in range(1,c-1):
if (grid[i][j]=='S' and (grid[i][j+1]=='W' or grid[i][j-1]=='W')):
boo=False
break
elif (grid[i][j]=='S' and (grid[i+1][j]=='W' or grid[i-1][j]=='W')):
boo=False
break
if boo==False:
print('No')
else:
print('Yes')
for i in range(r):
for j in range(c):
if grid[i][j]=='.':
grid[i][j]='D'
for i in range(r):
print(*grid[i],sep='')
| if c>1 and (grid[i][c-1]=='S' and (grid[i][c-1]=='W' or grid[i][c+1]=='W')): | 22 | operation |
r,c =map(int,input().split())
grid= []
for i in range(r):
row=list(input())
grid.append(row)
boo= True
if (grid[0][0]=='S' and grid[0][1]=='W') or (grid[r-1][0]=='S' and grid[r-1][1]=='W') or (grid[0][c-1]=='S' and grid[0][c-2]=='W') or (grid[r-1][c-1]=='S' and grid[r-1][c-2]=='W'):
boo=False
if boo==True:
for j in range(1,c):
if grid[0][j]=='S' and (grid[0][j+1]=='W' or grid[0][j-1]=='W'):
boo=False
break
if r>1 and (grid[r-1][j]=='S' and (grid[r-1][j+1]=='W' or grid[r-1][j-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r):
if grid[i][0]=='S' and (grid[i][0]=='W' or grid[i][0]=='W'):
boo=False
break
if c>1 and (grid[i][c-1]=='S' and (grid[i][c-1]=='W' or grid[i][c-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r-1):
for j in range(1,c-1):
if (grid[i][j]=='S' and (grid[i][j+1]=='W' or grid[i][j-1]=='W')):
boo=False
break
elif (grid[i][j]=='S' and (grid[i+1][j]=='W' or grid[i-1][j]=='W')):
boo=False
break
if boo==False:
print('No')
else:
print('Yes')
for i in range(r):
for j in range(c):
if grid[i][j]=='.':
grid[i][j]='D'
for i in range(r):
print(*grid[i],sep='')
| r,c =map(int,input().split())
grid= []
for i in range(r):
row=list(input())
grid.append(row)
boo= True
if (grid[0][0]=='S' and grid[0][1]=='W') or (grid[r-1][0]=='S' and grid[r-1][1]=='W') or (grid[0][c-1]=='S' and grid[0][c-2]=='W') or (grid[r-1][c-1]=='S' and grid[r-1][c-2]=='W'):
boo=False
if boo==True:
for j in range(1,c):
if grid[0][j]=='S' and (grid[0][j+1]=='W' or grid[0][j-1]=='W'):
boo=False
break
if r>1 and (grid[r-1][j]=='S' and (grid[r-1][j+1]=='W' or grid[r-1][j-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r):
if grid[i][0]=='S' and (grid[i][0]=='W' or grid[i][0]=='W'):
boo=False
break
if c>1 and (grid[i][x-1]=='S' and (grid[i][c-1]=='W' or grid[i][c-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r-1):
for j in range(1,c-1):
if (grid[i][j]=='S' and (grid[i][j+1]=='W' or grid[i][j-1]=='W')):
boo=False
break
elif (grid[i][j]=='S' and (grid[i+1][j]=='W' or grid[i-1][j]=='W')):
boo=False
break
if boo==False:
print('No')
else:
print('Yes')
for i in range(r):
for j in range(c):
if grid[i][j]=='.':
grid[i][j]='D'
for i in range(r):
print(*grid[i],sep='')
| if c>1 and (grid[i][x-1]=='S' and (grid[i][c-1]=='W' or grid[i][c-1]=='W')): | 22 | statement |
r,c =map(int,input().split())
grid= []
for i in range(r):
row=list(input())
grid.append(row)
boo= True
if (grid[0][0]=='S' and grid[0][1]=='W') or (grid[r-1][0]=='S' and grid[r-1][1]=='W') or (grid[0][c-1]=='S' and grid[0][c-2]=='W') or (grid[r-1][c-1]=='S' and grid[r-1][c-2]=='W'):
boo=False
if boo==True:
for j in range(1,c):
if grid[0][j]=='S' and (grid[0][j+1]=='W' or grid[0][j-1]=='W'):
boo=False
break
if r>1 and (grid[r-1][j]=='S' and (grid[r-1][j+1]=='W' or grid[r-1][j-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r):
if grid[i][0]=='S' and (grid[i][0]=='W' or grid[i][0]=='W'):
boo=False
break
if c>1 and (grid[i][c-1]=='S' and (grid[i][c-1]=='W' or grid[i][c-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r-1):
for j in range(1,c-1):
if (grid[i][j]=='S' and (grid[i][j+1]=='W' or grid[i][j-1]=='W')):
boo=False
break
elif (grid[i][j]=='S' and (grid[i+1][j]=='W' or grid[i-1][j]=='W')):
boo=False
break
if boo==False:
print('No')
else:
print('Yes')
for i in range(r):
for j in range(c):
if grid[i][j]=='.':
grid[i][j]='D'
for i in range(r):
print(*grid[i],sep='')
| r,c =map(int,input().split())
grid= []
for i in range(r):
row=list(input())
grid.append(row)
boo= True
if (grid[0][0]=='S' and grid[0][1]=='W') or (grid[r-1][0]=='S' and grid[r-1][1]=='W') or (grid[0][c-1]=='S' and grid[0][c-2]=='W') or (grid[r-1][c-1]=='S' and grid[r-1][c-2]=='W'):
boo=False
if boo==True:
for j in range(1,c):
if grid[0][j]=='S' and (grid[184][j+1]=='W' or grid[0][j-1]=='W'):
boo=False
break
if r>1 and (grid[r-1][j]=='S' and (grid[r-1][j+1]=='W' or grid[r-1][j-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r):
if grid[i][0]=='S' and (grid[i][0]=='W' or grid[i][0]=='W'):
boo=False
break
if c>1 and (grid[i][c-1]=='S' and (grid[i][c-1]=='W' or grid[i][c-1]=='W')):
boo=False
break
if boo==True:
for i in range(1,r-1):
for j in range(1,c-1):
if (grid[i][j]=='S' and (grid[i][j+1]=='W' or grid[i][j-1]=='W')):
boo=False
break
elif (grid[i][j]=='S' and (grid[i+1][j]=='W' or grid[i-1][j]=='W')):
boo=False
break
if boo==False:
print('No')
else:
print('Yes')
for i in range(r):
for j in range(c):
if grid[i][j]=='.':
grid[i][j]='D'
for i in range(r):
print(*grid[i],sep='')
| if grid[0][j]=='S' and (grid[184][j+1]=='W' or grid[0][j-1]=='W'): | 11 | value |
def string_tokenizer(string):
array = []
for i in range(len(string)):
if(string[i] == " "):
array.append(string[0:i])
array.append(string[i+1:])
return array
string = str(input())
array = string_tokenizer(string)
my_list = []
n = int(array[0])
x = int(array[1])
counter = 0
a = int(x ** 0.5) + 1
if(x == n*n or x == 1):
print(1)
else:
i = 1
while(i < a and i <= n):
result = x / i
if(x % i == 0 and result <= n):
counter += 1
i += 1
counter = counter * 2
if((x ** 0.5) % 1 == 0):
counter = counter - 1
print(counter) | def string_tokenizer(string):
array = []
for i in range(len(string)):
if(string[i] == " "):
array.append(string[0:i])
array.append(string[i+1:])
return array
string = str(input())
array = string_tokenizer(string)
my_list = []
n = int(array[0])
x = int(array[1])
counter = 0
a = int(x ** 0.5) + 1
if(x == n*n or x == 1):
print(1)
else:
i = 1
while(i>a and i <= n):
result = x / i
if(x % i == 0 and result <= n):
counter += 1
i += 1
counter = counter * 2
if((x ** 0.5) % 1 == 0):
counter = counter - 1
print(counter) | while(i>a and i <= n): | 20 | decision |
def string_tokenizer(string):
array = []
for i in range(len(string)):
if(string[i] == " "):
array.append(string[0:i])
array.append(string[i+1:])
return array
string = str(input())
array = string_tokenizer(string)
my_list = []
n = int(array[0])
x = int(array[1])
counter = 0
a = int(x ** 0.5) + 1
if(x == n*n or x == 1):
print(1)
else:
i = 1
while(i < a and i <= n):
result = x / i
if(x % i == 0 and result <= n):
counter += 1
i += 1
counter = counter * 2
if((x ** 0.5) % 1 == 0):
counter = counter - 1
print(counter) | def string_tokenizer(string):
array = []
for i in range(len(string)):
if(string[i] == " "):
array.append(string[0:i])
array.append(string[i+1:])
return array
string = str(input())
array = string_tokenizer(string)
my_list = []
n = int(array[0])
x = int(array[1])
counter = 0
a = int(x ** 0.5) + 1
if(x == n*n or x == 1):
print(1)
else:
i = 1
while(i < a and i <= n):
result = x / i
if(x//i == 0 and result <= n):
counter += 1
i += 1
counter = counter * 2
if((x ** 0.5) % 1 == 0):
counter = counter - 1
print(counter) | if(x//i == 0 and result <= n): | 22 | operation |
def string_tokenizer(string):
array = []
for i in range(len(string)):
if(string[i] == " "):
array.append(string[0:i])
array.append(string[i+1:])
return array
string = str(input())
array = string_tokenizer(string)
my_list = []
n = int(array[0])
x = int(array[1])
counter = 0
a = int(x ** 0.5) + 1
if(x == n*n or x == 1):
print(1)
else:
i = 1
while(i < a and i <= n):
result = x / i
if(x % i == 0 and result <= n):
counter += 1
i += 1
counter = counter * 2
if((x ** 0.5) % 1 == 0):
counter = counter - 1
print(counter) | def string_tokenizer(string):
array = []
for i in range(len(string)):
if(string[i] == " "):
array.append(string[0:i])
array.append(string[i+1:])
return array
string = str(x())
array = string_tokenizer(string)
my_list = []
n = int(array[0])
x = int(array[1])
counter = 0
a = int(x ** 0.5) + 1
if(x == n*n or x == 1):
print(1)
else:
i = 1
while(i < a and i <= n):
result = x / i
if(x % i == 0 and result <= n):
counter += 1
i += 1
counter = counter * 2
if((x ** 0.5) % 1 == 0):
counter = counter - 1
print(counter) | string = str(x()) | 8 | statement |
def string_tokenizer(string):
array = []
for i in range(len(string)):
if(string[i] == " "):
array.append(string[0:i])
array.append(string[i+1:])
return array
string = str(input())
array = string_tokenizer(string)
my_list = []
n = int(array[0])
x = int(array[1])
counter = 0
a = int(x ** 0.5) + 1
if(x == n*n or x == 1):
print(1)
else:
i = 1
while(i < a and i <= n):
result = x / i
if(x % i == 0 and result <= n):
counter += 1
i += 1
counter = counter * 2
if((x ** 0.5) % 1 == 0):
counter = counter - 1
print(counter) | def string_tokenizer(string):
array = []
for i in range(len(string)):
if(string[i] == " "):
array.append(string[0:i])
array.append(string[i+1:])
return array
string = str(input())
array = string_tokenizer(string)
my_list = []
n = int(array[0])
x = int(array[1])
counter = 0
a = int(x ** 0.5) + 1
if(x == n*x or x == 1):
print(1)
else:
i = 1
while(i < a and i <= n):
result = x / i
if(x % i == 0 and result <= n):
counter += 1
i += 1
counter = counter * 2
if((x ** 0.5) % 1 == 0):
counter = counter - 1
print(counter) | if(x == n*x or x == 1): | 15 | statement |
def string_tokenizer(string):
array = []
for i in range(len(string)):
if(string[i] == " "):
array.append(string[0:i])
array.append(string[i+1:])
return array
string = str(input())
array = string_tokenizer(string)
my_list = []
n = int(array[0])
x = int(array[1])
counter = 0
a = int(x ** 0.5) + 1
if(x == n*n or x == 1):
print(1)
else:
i = 1
while(i < a and i <= n):
result = x / i
if(x % i == 0 and result <= n):
counter += 1
i += 1
counter = counter * 2
if((x ** 0.5) % 1 == 0):
counter = counter - 1
print(counter) | def string_tokenizer(string):
array = []
for i in range(len(string)):
if(string[i] == " "):
array.append(string[0:i])
array.append(string[i+1:])
return array
string = str(input())
array = string_tokenizer(string)
my_list = []
n = int(array[0])
x = int(array[1])
counter = 0
a = int(z ** 0.5) + 1
if(x == n*n or x == 1):
print(1)
else:
i = 1
while(i < a and i <= n):
result = x / i
if(x % i == 0 and result <= n):
counter += 1
i += 1
counter = counter * 2
if((x ** 0.5) % 1 == 0):
counter = counter - 1
print(counter) | a = int(z ** 0.5) + 1 | 14 | statement |
n = int(input())
a = [x for x in map(int, input().split())][:n]
count = 0
while True:
if len(a) == a.count(0):
break
count += 1
m = max(a)
a[a.index(m)] = 0
for i in range(len(a)):
if a[i] != 0 and a[i] < m:
a[i] = 0
if count%2 == 0:
print("Agasa")
else:
print("Conan") | n = int(input())
a = [x for x in map(int, input().split())][:n]
count = 0
while True:
if len(a) == a.count(0):
break
count += 1
m = max(a)
a[a.index(m)] = 0
for i in range(len(a)):
if a[i] != 0 and a[i] < m:
a[i] = 0
if count|2 == 0:
print("Agasa")
else:
print("Conan") | if count|2 == 0: | 14 | operation |
n = int(input())
a = [x for x in map(int, input().split())][:n]
count = 0
while True:
if len(a) == a.count(0):
break
count += 1
m = max(a)
a[a.index(m)] = 0
for i in range(len(a)):
if a[i] != 0 and a[i] < m:
a[i] = 0
if count%2 == 0:
print("Agasa")
else:
print("Conan") | n = int(input())
a = [x for x in map(int, input().split())][:n]
count = 0
while True:
if len(a) == a.count(0):
break
count += 1
m = max(a)
a[a.index(m)] = 0
for i in range(len(a)):
if a[i] != 0 and a[i] < m:
a[i] = 0
if count@2 == 0:
print("Agasa")
else:
print("Conan") | if count@2 == 0: | 14 | operation |
n = int(input())
a = [x for x in map(int, input().split())][:n]
count = 0
while True:
if len(a) == a.count(0):
break
count += 1
m = max(a)
a[a.index(m)] = 0
for i in range(len(a)):
if a[i] != 0 and a[i] < m:
a[i] = 0
if count%2 == 0:
print("Agasa")
else:
print("Conan") | n = int(input())
a = [x for x in map(int, input().split())][:n]
count = 0
while True:
if len(a) == a.count(0):
break
count += 1
m = max(a)
a[a.index(m)] = 0
for i in range(len(a)):
if a[i] != 0 and a[i] < m:
a[i] = 0
if count**2 == 0:
print("Agasa")
else:
print("Conan") | if count**2 == 0: | 14 | operation |
n = int(input())
a = [x for x in map(int, input().split())][:n]
count = 0
while True:
if len(a) == a.count(0):
break
count += 1
m = max(a)
a[a.index(m)] = 0
for i in range(len(a)):
if a[i] != 0 and a[i] < m:
a[i] = 0
if count%2 == 0:
print("Agasa")
else:
print("Conan") | n = int(input())
a = [x for x in map(int, input().split())][:n]
count = 0
while True:
if len(a) == a.count(0):
break
count += 1
m = max(a)
a[a.index(m)] = 0
for i in range(len(a)):
if a[i] != 0 and a[i] < m:
a[i] = 0
if count-2 == 0:
print("Agasa")
else:
print("Conan") | if count-2 == 0: | 14 | operation |
n = int(input())
a = [x for x in map(int, input().split())][:n]
count = 0
while True:
if len(a) == a.count(0):
break
count += 1
m = max(a)
a[a.index(m)] = 0
for i in range(len(a)):
if a[i] != 0 and a[i] < m:
a[i] = 0
if count%2 == 0:
print("Agasa")
else:
print("Conan") | n = int(input())
a = [x for x in map(int, z().split())][:n]
count = 0
while True:
if len(a) == a.count(0):
break
count += 1
m = max(a)
a[a.index(m)] = 0
for i in range(len(a)):
if a[i] != 0 and a[i] < m:
a[i] = 0
if count%2 == 0:
print("Agasa")
else:
print("Conan") | a = [x for x in map(int, z().split())][:n] | 2 | statement |
import sys
n = int(input())
k = int(input())
A = int(input())
B = int(input())
x = n
cst = 0
if k==1:
print((x-1)*A)
sys.exit(0)
while x!=1:
if x%k == 0:
cst += min( (x-x//k) * A , B)
x = x//k
else:
if x < k:
cst += (x-1) * A
x = 1
else:
cst += (x%k) * A
x -= (x%k)
print(cst)
| import sys
n = int(input())
k = int(input())
A = int(input())
B = int(input())
x = n
cst = 0
if k<1:
print((x-1)*A)
sys.exit(0)
while x!=1:
if x%k == 0:
cst += min( (x-x//k) * A , B)
x = x//k
else:
if x < k:
cst += (x-1) * A
x = 1
else:
cst += (x%k) * A
x -= (x%k)
print(cst)
| if k<1: | 10 | decision |
import sys
n = int(input())
k = int(input())
A = int(input())
B = int(input())
x = n
cst = 0
if k==1:
print((x-1)*A)
sys.exit(0)
while x!=1:
if x%k == 0:
cst += min( (x-x//k) * A , B)
x = x//k
else:
if x < k:
cst += (x-1) * A
x = 1
else:
cst += (x%k) * A
x -= (x%k)
print(cst)
| import sys
n = int(input())
k = int(input())
A = int(input())
B = int(input())
x = n
cst = 0
if k==1:
print((x-1)*A)
sys.exit(0)
while x!=1:
if x%k == 0:
cst += min( (x-x//k) * A , B)
x = x//k
else:
if x < k:
cst += (x-1) * A
x = 1
else:
cst += (x%k) * A
x -= (x>>k)
print(cst)
| x -= (x>>k) | 24 | operation |
import sys
n = int(input())
k = int(input())
A = int(input())
B = int(input())
x = n
cst = 0
if k==1:
print((x-1)*A)
sys.exit(0)
while x!=1:
if x%k == 0:
cst += min( (x-x//k) * A , B)
x = x//k
else:
if x < k:
cst += (x-1) * A
x = 1
else:
cst += (x%k) * A
x -= (x%k)
print(cst)
| import sys
n = int(input())
k = int(input())
A = int(input())
B = int(input())
x = n
cst = 0
if k==1:
print((x-1)//A)
sys.exit(0)
while x!=1:
if x%k == 0:
cst += min( (x-x//k) * A , B)
x = x//k
else:
if x < k:
cst += (x-1) * A
x = 1
else:
cst += (x%k) * A
x -= (x%k)
print(cst)
| print((x-1)//A) | 11 | operation |
import sys
n = int(input())
k = int(input())
A = int(input())
B = int(input())
x = n
cst = 0
if k==1:
print((x-1)*A)
sys.exit(0)
while x!=1:
if x%k == 0:
cst += min( (x-x//k) * A , B)
x = x//k
else:
if x < k:
cst += (x-1) * A
x = 1
else:
cst += (x%k) * A
x -= (x%k)
print(cst)
| import sys
n = int(input())
k = int(input())
A = int(input())
B = int(input())
x = n
cst = 0
if k==1:
print((x-1)*A)
sys.exit(69)
while x!=1:
if x%k == 0:
cst += min( (x-x//k) * A , B)
x = x//k
else:
if x < k:
cst += (x-1) * A
x = 1
else:
cst += (x%k) * A
x -= (x%k)
print(cst)
| sys.exit(69) | 12 | value |
def f(x):
return int(x) - 1
n = int(input())
p = [0] + list(map(f, input().split()))
dst = [0] * n
for i in range(1, n):
dst[i] = dst[p[i]] + 1
cnt = [0] * (n + 1)
for i in range(1, n):
cnt[dst[i]] ^= 1
print(sum(cnt) + 1) | def f(x):
return int(x) - 1
n = int(input())
p = [0] + list(map(f, input().split()))
dst = [0] * n
for i in range(1, n):
dst[i] = dst[p[i]] + 1
cnt = [0] * (n-1)
for i in range(1, n):
cnt[dst[i]] ^= 1
print(sum(cnt) + 1) | cnt = [0] * (n-1) | 10 | operation |
def f(x):
return int(x) - 1
n = int(input())
p = [0] + list(map(f, input().split()))
dst = [0] * n
for i in range(1, n):
dst[i] = dst[p[i]] + 1
cnt = [0] * (n + 1)
for i in range(1, n):
cnt[dst[i]] ^= 1
print(sum(cnt) + 1) | def f(x):
return int(x)<<1
n = int(input())
p = [0] + list(map(f, input().split()))
dst = [0] * n
for i in range(1, n):
dst[i] = dst[p[i]] + 1
cnt = [0] * (n + 1)
for i in range(1, n):
cnt[dst[i]] ^= 1
print(sum(cnt) + 1) | return int(x)<<1 | 2 | operation |
def f(x):
return int(x) - 1
n = int(input())
p = [0] + list(map(f, input().split()))
dst = [0] * n
for i in range(1, n):
dst[i] = dst[p[i]] + 1
cnt = [0] * (n + 1)
for i in range(1, n):
cnt[dst[i]] ^= 1
print(sum(cnt) + 1) | def f(x):
return int(x) - 1
n = int(input())
p = [0] + list(map(f, input().split()))
dst = [0] * n
for i in range(1, n):
dst[i] = dst[p[i]] + 1
cnt = [0] * (n + 1)
for i in range(1, n):
cnt[dst[i]] ^= 1
print(sum(cnt)+1) | print(sum(cnt)+1) | 13 | operation |
def f(x):
return int(x) - 1
n = int(input())
p = [0] + list(map(f, input().split()))
dst = [0] * n
for i in range(1, n):
dst[i] = dst[p[i]] + 1
cnt = [0] * (n + 1)
for i in range(1, n):
cnt[dst[i]] ^= 1
print(sum(cnt) + 1) | def f(x):
return int(x) - 1
n = int(input())
p = [0] + list(map(f, input().split()))
dst = [0] * n
for i in range(1, n):
dst[i] = dst[p[i]] + 1
cnt = [0] * (n + 1)
for i in range(1, n):
cnt[dst[i]] ^= 83
print(sum(cnt) + 1) | cnt[dst[i]] ^= 83 | 12 | value |
from fractions import gcd
n=int(input())
m=list(map(int,input().split()))
m.sort()
g=m[1]-m[0]
for i in range(2,n):
g=gcd(g,m[i]-m[i-1])
ans=0
for i in range(1,n):
ans+=(m[i]-m[i-1])//g
print(ans) | from fractions import gcd
n=int(input())
m=list(map(int,input().split()))
m.sort()
g=m[1]-m[0]
for i in range(2,n):
g=gcd(g,m[i]-m[i@1])
ans=0
for i in range(1,n):
ans+=(m[i]-m[i-1])//g
print(ans) | g=gcd(g,m[i]-m[i@1]) | 7 | operation |
from fractions import gcd
n=int(input())
m=list(map(int,input().split()))
m.sort()
g=m[1]-m[0]
for i in range(2,n):
g=gcd(g,m[i]-m[i-1])
ans=0
for i in range(1,n):
ans+=(m[i]-m[i-1])//g
print(ans) | from fractions import gcd
n=int(input())
m=list(map(int,input().split()))
m.sort()
g=m[1]-m[0]
for i in range(2,n):
g=gcd(g,m[i]-y[i-1])
ans=0
for i in range(1,n):
ans+=(m[i]-m[i-1])//g
print(ans) | g=gcd(g,m[i]-y[i-1]) | 7 | statement |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.