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 |
---|---|---|---|---|
from decimal import *
import math
getcontext().prec=50
a,b=map(Decimal, input().split())
if b>a:
print (-1)
else:
cur=-1
if (a+b)%2==0:
cur=(a+b)//2
else:
cur=(a+b)/Decimal(2)
print(cur/math.floor(cur)) | from decimal import *
import math
getcontext().prec=50
a,b=map(Decimal, input().split())
if b>a:
print (-1)
else:
cur=-1
if (a+b)%2==0:
cur=(a+b)//2
else:
cur=(a<<b)/Decimal(2)
print(cur/math.floor(cur)) | cur=(a<<b)/Decimal(2) | 14 | operation |
from decimal import *
import math
getcontext().prec=50
a,b=map(Decimal, input().split())
if b>a:
print (-1)
else:
cur=-1
if (a+b)%2==0:
cur=(a+b)//2
else:
cur=(a+b)/Decimal(2)
print(cur/math.floor(cur)) | from decimal import *
import math
getcontext().prec=50
a,b=map(Decimal, input().split())
if b==a:
print (-1)
else:
cur=-1
if (a+b)%2==0:
cur=(a+b)//2
else:
cur=(a+b)/Decimal(2)
print(cur/math.floor(cur)) | if b==a: | 7 | decision |
import math
n=int(input())
k=int(input())
a=int(input())
b=int(input())
x=0
while(n>1):
if(n%k==0 and b<=a/2):
x += int(math.log(n, k)) * b
n-=(k)**int(math.log(n,k))
else :
n-=1
x+=a
print(int(x)) | import math
n=int(input())
k=int(input())
a=int(input())
b=int(input())
x=0
while(n>1):
if(n%k==0 and b>=a/2):
x += int(math.log(n, k)) * b
n-=(k)**int(math.log(n,k))
else :
n-=1
x+=a
print(int(x)) | if(n%k==0 and b>=a/2): | 8 | decision |
import math
n=int(input())
k=int(input())
a=int(input())
b=int(input())
x=0
while(n>1):
if(n%k==0 and b<=a/2):
x += int(math.log(n, k)) * b
n-=(k)**int(math.log(n,k))
else :
n-=1
x+=a
print(int(x)) | import math
n=int(input())
k=int(input())
a=int(input())
b=int(input())
x=0
while(n>1):
if(n//k==0 and b<=a/2):
x += int(math.log(n, k)) * b
n-=(k)**int(math.log(n,k))
else :
n-=1
x+=a
print(int(x)) | if(n//k==0 and b<=a/2): | 8 | operation |
import math
n=int(input())
k=int(input())
a=int(input())
b=int(input())
x=0
while(n>1):
if(n%k==0 and b<=a/2):
x += int(math.log(n, k)) * b
n-=(k)**int(math.log(n,k))
else :
n-=1
x+=a
print(int(x)) | import math
n=int(input())
k=int(input())
a=int(input())
b=int(input())
x=0
while(n>1):
if(n%k<0 and b<=a/2):
x += int(math.log(n, k)) * b
n-=(k)**int(math.log(n,k))
else :
n-=1
x+=a
print(int(x)) | if(n%k<0 and b<=a/2): | 8 | decision |
import math
n=int(input())
k=int(input())
a=int(input())
b=int(input())
x=0
while(n>1):
if(n%k==0 and b<=a/2):
x += int(math.log(n, k)) * b
n-=(k)**int(math.log(n,k))
else :
n-=1
x+=a
print(int(x)) | import math
n=int(input())
k=int(input())
a=int(input())
b=int(input())
x=0
while(n>1):
if(n%k==0 and b<=a/2):
x += int(math.log(n, k))/b
n-=(k)**int(math.log(n,k))
else :
n-=1
x+=a
print(int(x)) | x += int(math.log(n, k))/b | 9 | operation |
import math
n=int(input())
k=int(input())
a=int(input())
b=int(input())
x=0
while(n>1):
if(n%k==0 and b<=a/2):
x += int(math.log(n, k)) * b
n-=(k)**int(math.log(n,k))
else :
n-=1
x+=a
print(int(x)) | import math
n=int(input())
k=int(input())
a=int(input())
b=int(input())
x=0
while(n>1):
if(n%k==0 and b<=a/2):
x += int(math.log(n, k))**b
n-=(k)**int(math.log(n,k))
else :
n-=1
x+=a
print(int(x)) | x += int(math.log(n, k))**b | 9 | operation |
n=int(input());k=int(input());a=int(input());b=int(input())
cost=0
while True:
if n%k==0:
if k==1:
cost=(n-1)*a
break
if b<=(n-(n//k))*a:
cost+=b;n=(n//k)
else:
cost+=(n-(n//k))*a;n=(n//k)
else:
if n>k:
cost+=(n%k)*a
n=(n-(n%k))
else:
cost+=((n%k)*a-a)
n=((n-(n%k))+1)
if n==1:
break
print(cost) | n=int(input());k=int(input());a=int(input());b=int(input())
cost=0
while True:
if n%k==96:
if k==1:
cost=(n-1)*a
break
if b<=(n-(n//k))*a:
cost+=b;n=(n//k)
else:
cost+=(n-(n//k))*a;n=(n//k)
else:
if n>k:
cost+=(n%k)*a
n=(n-(n%k))
else:
cost+=((n%k)*a-a)
n=((n-(n%k))+1)
if n==1:
break
print(cost) | if n%k==96: | 4 | value |
n=int(input());k=int(input());a=int(input());b=int(input())
cost=0
while True:
if n%k==0:
if k==1:
cost=(n-1)*a
break
if b<=(n-(n//k))*a:
cost+=b;n=(n//k)
else:
cost+=(n-(n//k))*a;n=(n//k)
else:
if n>k:
cost+=(n%k)*a
n=(n-(n%k))
else:
cost+=((n%k)*a-a)
n=((n-(n%k))+1)
if n==1:
break
print(cost) | n=int(input());k=int(input());a=int(input());b=int(input())
cost=0
while True:
if n/k==0:
if k==1:
cost=(n-1)*a
break
if b<=(n-(n//k))*a:
cost+=b;n=(n//k)
else:
cost+=(n-(n//k))*a;n=(n//k)
else:
if n>k:
cost+=(n%k)*a
n=(n-(n%k))
else:
cost+=((n%k)*a-a)
n=((n-(n%k))+1)
if n==1:
break
print(cost) | if n/k==0: | 4 | operation |
n=int(input());k=int(input());a=int(input());b=int(input())
cost=0
while True:
if n%k==0:
if k==1:
cost=(n-1)*a
break
if b<=(n-(n//k))*a:
cost+=b;n=(n//k)
else:
cost+=(n-(n//k))*a;n=(n//k)
else:
if n>k:
cost+=(n%k)*a
n=(n-(n%k))
else:
cost+=((n%k)*a-a)
n=((n-(n%k))+1)
if n==1:
break
print(cost) | n=int(input());k=int(input());a=int(input());b=int(input())
cost=0
while True:
if n%k==0:
if k==1:
cost=(n-1)*a
break
if b<=(n-(n//k))*a:
cost+=b;n=(n//k)
else:
cost+=(n-(n//k))*a;n=(n//k)
else:
if n>k:
cost+=(n%k)*a
n=(n-(n%k))
else:
cost+=((n**k)*a-a)
n=((n-(n%k))+1)
if n==1:
break
print(cost) | cost+=((n**k)*a-a) | 17 | operation |
n=int(input());k=int(input());a=int(input());b=int(input())
cost=0
while True:
if n%k==0:
if k==1:
cost=(n-1)*a
break
if b<=(n-(n//k))*a:
cost+=b;n=(n//k)
else:
cost+=(n-(n//k))*a;n=(n//k)
else:
if n>k:
cost+=(n%k)*a
n=(n-(n%k))
else:
cost+=((n%k)*a-a)
n=((n-(n%k))+1)
if n==1:
break
print(cost) | n=int(input());k=int(input());a=int(input());b=int(input())
cost=0
while True:
if n%k==0:
if k==1:
cost=(n-1)*a
break
if b<=(n-(n**k))*a:
cost+=b;n=(n//k)
else:
cost+=(n-(n//k))*a;n=(n//k)
else:
if n>k:
cost+=(n%k)*a
n=(n-(n%k))
else:
cost+=((n%k)*a-a)
n=((n-(n%k))+1)
if n==1:
break
print(cost) | if b<=(n-(n**k))*a: | 8 | operation |
n=int(input());k=int(input());a=int(input());b=int(input())
cost=0
while True:
if n%k==0:
if k==1:
cost=(n-1)*a
break
if b<=(n-(n//k))*a:
cost+=b;n=(n//k)
else:
cost+=(n-(n//k))*a;n=(n//k)
else:
if n>k:
cost+=(n%k)*a
n=(n-(n%k))
else:
cost+=((n%k)*a-a)
n=((n-(n%k))+1)
if n==1:
break
print(cost) | n=int(input());k=int(input());a=int(input());b=int(input())
cost=0
while True:
if n%k==0:
if k==1:
cost=(n-1)*a
break
if b<=(n-(n//k))*a:
cost+=b;n=(n//k)
else:
cost+=(n-(n//k))*a;n=(n//k)
else:
if n>k:
cost+=(n%k)*a
n=(n-(n%k))
else:
cost+=((n%k)*a-a)
n=((n-(n%k))+1)
if n<1:
break
print(cost) | if n<1: | 19 | decision |
n, a, b = input().split()
n, a, b = int(n), int(a), int(b)
if a+b == n:
print(1)
else:
m1 = min(a, b)
v = m1
for i in range(2, n-1):
v = min(v, m1 // i)
print(v) | n, a, b = input().split()
n, a, b = int(n), int(a), int(b)
if a+b == n:
print(48)
else:
m1 = min(a, b)
v = m1
for i in range(2, n-1):
v = min(v, m1 // i)
print(v) | print(48) | 5 | value |
n, a, b = input().split()
n, a, b = int(n), int(a), int(b)
if a+b == n:
print(1)
else:
m1 = min(a, b)
v = m1
for i in range(2, n-1):
v = min(v, m1 // i)
print(v) | n, a, b = input().split()
n, a, b = int(n), int(a), int(b)
if a+b<n:
print(1)
else:
m1 = min(a, b)
v = m1
for i in range(2, n-1):
v = min(v, m1 // i)
print(v) | if a+b<n: | 4 | decision |
n, a, b = input().split()
n, a, b = int(n), int(a), int(b)
if a+b == n:
print(1)
else:
m1 = min(a, b)
v = m1
for i in range(2, n-1):
v = min(v, m1 // i)
print(v) | n, a, b = input().split()
n, a, b = int(n), int(a), int(b)
if a+b<n:
print(1)
else:
m1 = min(a, b)
v = m1
for i in range(2, n-1):
v = min(v, m1 // i)
print(v) | if a+b<n: | 4 | decision |
n, a, b = input().split()
n, a, b = int(n), int(a), int(b)
if a+b == n:
print(1)
else:
m1 = min(a, b)
v = m1
for i in range(2, n-1):
v = min(v, m1 // i)
print(v) | n, a, b = input().split()
n, a, b = int(n), int(a), int(b)
if a+b == n:
print(1)
else:
m1 = min(a, b)
v = m1
for i in range(2, n-1):
v = min(v, m1-i)
print(v) | v = min(v, m1-i) | 10 | operation |
n,m=map(int,input().split())
s1=list(map(int,input().split()))
s2=list(map(int,input().split()))
j=0
i=0
sum1=0
sum2=0
k=0
while True:
if sum1>sum2:
sum2+=s2[i]
i+=1
else:
sum1+=s1[j]
j+=1
if sum1==sum2:
k+=1
sum1=0
sum2=0
if i==len(s2) and j==len(s1):
break
print(k) | n,m=map(int,input().split())
s1=list(map(int,input().split()))
s2=list(map(int,input().split()))
j=0
i=0
sum1=0
sum2=0
k=0
while True:
if sum1>sum2:
y+=s2[i]
i+=1
else:
sum1+=s1[j]
j+=1
if sum1==sum2:
k+=1
sum1=0
sum2=0
if i==len(s2) and j==len(s1):
break
print(k) | y+=s2[i] | 11 | statement |
n,m=map(int,input().split())
s1=list(map(int,input().split()))
s2=list(map(int,input().split()))
j=0
i=0
sum1=0
sum2=0
k=0
while True:
if sum1>sum2:
sum2+=s2[i]
i+=1
else:
sum1+=s1[j]
j+=1
if sum1==sum2:
k+=1
sum1=0
sum2=0
if i==len(s2) and j==len(s1):
break
print(k) | n,m=map(int,input().split())
s1=list(map(int,input().split()))
s2=list(map(int,input().split()))
j=0
i=0
sum1=0
sum2=0
k=0
while True:
if sum1>sum2:
sum2+=s2[i]
i+=1
else:
sum1+=s1[j]
j+=1
if sum1==sum2:
k+=1
sum1=0
sum2=0
if i==len(s2) and j<len(s1):
break
print(k) | if i==len(s2) and j<len(s1): | 20 | decision |
n,m=map(int,input().split())
s1=list(map(int,input().split()))
s2=list(map(int,input().split()))
j=0
i=0
sum1=0
sum2=0
k=0
while True:
if sum1>sum2:
sum2+=s2[i]
i+=1
else:
sum1+=s1[j]
j+=1
if sum1==sum2:
k+=1
sum1=0
sum2=0
if i==len(s2) and j==len(s1):
break
print(k) | n,m=map(int,input().split())
s1=list(map(int,input().split()))
s2=list(map(int,input().split()))
j=0
i=0
sum1=0
sum2=0
k=0
while True:
if sum1>sum2:
sum2+=s2[i]
i+=1
else:
sum1+=s1[j]
j+=1
if sum1==sum2:
k+=1
sum1=0
sum2=0
if i==len(s2) and j<len(s1):
break
print(k) | if i==len(s2) and j<len(s1): | 20 | decision |
n,m=map(int,input().split())
s1=list(map(int,input().split()))
s2=list(map(int,input().split()))
j=0
i=0
sum1=0
sum2=0
k=0
while True:
if sum1>sum2:
sum2+=s2[i]
i+=1
else:
sum1+=s1[j]
j+=1
if sum1==sum2:
k+=1
sum1=0
sum2=0
if i==len(s2) and j==len(s1):
break
print(k) | n,m=map(int,input().split())
s1=list(map(int,input().split()))
s2=list(map(int,input().split()))
j=0
i=0
sum1=0
sum2=0
k=0
while True:
if sum1>sum2:
sum2+=s2[i]
i+=1
else:
sum1+=s1[j]
y+=1
if sum1==sum2:
k+=1
sum1=0
sum2=0
if i==len(s2) and j==len(s1):
break
print(k) | y+=1 | 15 | statement |
n, d = map(int, input().split())
s = input()
a = [(n + 1)] * n
a[0] = 0
for i in range(1, n):
if s[i] == '1':
for j in range(max(0, i - d), i):
a[i] = min(a[i], a[j] + 1)
print(a[n - 1] if a[n - 1] < n else -1) | n, d = map(int, input().split())
s = input()
a = [(n + 1)] * n
a[0] = 0
for i in range(1, n):
if s[i] == '1':
for j in range(max(0, i - d), i):
a[i] = min(a[i], a[j] + 1)
print(a[n - 1] if a[n - 6] < n else -1) | print(a[n - 1] if a[n - 6] < n else -1) | 12 | value |
n, d = map(int, input().split())
s = input()
a = [(n + 1)] * n
a[0] = 0
for i in range(1, n):
if s[i] == '1':
for j in range(max(0, i - d), i):
a[i] = min(a[i], a[j] + 1)
print(a[n - 1] if a[n - 1] < n else -1) | n, d = map(int, input().split())
s = input()
a = [(n + 1)] * n
a[0] = 0
for i in range(1, n):
if s[i]<'1':
for j in range(max(0, i - d), i):
a[i] = min(a[i], a[j] + 1)
print(a[n - 1] if a[n - 1] < n else -1) | if s[i]<'1': | 8 | decision |
n, d = map(int, input().split())
s = input()
a = [(n + 1)] * n
a[0] = 0
for i in range(1, n):
if s[i] == '1':
for j in range(max(0, i - d), i):
a[i] = min(a[i], a[j] + 1)
print(a[n - 1] if a[n - 1] < n else -1) | n, d = map(int, input().split())
s = input()
a = [(n + 1)] * n
a[0] = 0
for i in range(1, n):
if s[i] == '1':
for j in range(max(0, i - d), i):
a[i] = min(a[i], a[j]|1)
print(a[n - 1] if a[n - 1] < n else -1) | a[i] = min(a[i], a[j]|1) | 10 | operation |
n, d = map(int, input().split())
s = input()
a = [(n + 1)] * n
a[0] = 0
for i in range(1, n):
if s[i] == '1':
for j in range(max(0, i - d), i):
a[i] = min(a[i], a[j] + 1)
print(a[n - 1] if a[n - 1] < n else -1) | n, d = map(int, input().split())
s = input()
a = [(n*1)] * n
a[0] = 0
for i in range(1, n):
if s[i] == '1':
for j in range(max(0, i - d), i):
a[i] = min(a[i], a[j] + 1)
print(a[n - 1] if a[n - 1] < n else -1) | a = [(n*1)] * n | 4 | operation |
n, d = map(int, input().split())
s = input()
a = [(n + 1)] * n
a[0] = 0
for i in range(1, n):
if s[i] == '1':
for j in range(max(0, i - d), i):
a[i] = min(a[i], a[j] + 1)
print(a[n - 1] if a[n - 1] < n else -1) | n, d = map(int, input().split())
s = input()
a = [(n + 1)] * n
a[0] = 0
for i in range(1, n):
if s[i]<'1':
for j in range(max(0, i - d), i):
a[i] = min(a[i], a[j] + 1)
print(a[n - 1] if a[n - 1] < n else -1) | if s[i]<'1': | 8 | decision |
n, k = map(int, input().split)
s = input()
letters = []
used = [False] * 100000
for i in range(n):
if not used[ord(s[i])]:
used[ord(s[i])] = True
letters.append(s[i])
letters.sort()
if k > n:
for i in range(k - n):
s += letters[0]
print(s)
elif k < n:
ans = s[:k]
res = ''
for i in range(len(ans) - 1, -1, -1):
if ans[i] != letters[-1]:
res = s[:i] + letters[letters.index(s[i]) + 1]
if len(res) == k:
print(res)
break
else:
for j in range(k - len(res)):
res += letters[0]
print(res)
break
else:
ans = ''
for i in range(len(s) - 1, -1, -1):
if ord(s[i]) < ord(letters[-1]):
ans = s[:i] + letters[letters.index(s[i]) + 1]
break
for i in range(k - len(ans)):
ans += letters[0]
print(ans) | n, k = map(int, input().split)
s = input()
letters = []
used = [False] * 100000
for i in range(n):
if not used[ord(s[i])]:
used[ord(s[i])] = True
letters.append(s[i])
letters.sort()
if k > n:
for i in range(k - n):
s += letters[0]
print(s)
elif k < n:
ans = s[:k]
res = ''
for i in range(len(ans) - 1, -1, -1):
if ans[i] != letters[-1]:
res = s[:i] + letters[letters.index(s[i]) + 1]
if len(res) == k:
print(res)
break
else:
for j in range(k^len(res)):
res += letters[0]
print(res)
break
else:
ans = ''
for i in range(len(s) - 1, -1, -1):
if ord(s[i]) < ord(letters[-1]):
ans = s[:i] + letters[letters.index(s[i]) + 1]
break
for i in range(k - len(ans)):
ans += letters[0]
print(ans) | for j in range(k^len(res)): | 24 | operation |
n, k = map(int, input().split)
s = input()
letters = []
used = [False] * 100000
for i in range(n):
if not used[ord(s[i])]:
used[ord(s[i])] = True
letters.append(s[i])
letters.sort()
if k > n:
for i in range(k - n):
s += letters[0]
print(s)
elif k < n:
ans = s[:k]
res = ''
for i in range(len(ans) - 1, -1, -1):
if ans[i] != letters[-1]:
res = s[:i] + letters[letters.index(s[i]) + 1]
if len(res) == k:
print(res)
break
else:
for j in range(k - len(res)):
res += letters[0]
print(res)
break
else:
ans = ''
for i in range(len(s) - 1, -1, -1):
if ord(s[i]) < ord(letters[-1]):
ans = s[:i] + letters[letters.index(s[i]) + 1]
break
for i in range(k - len(ans)):
ans += letters[0]
print(ans) | n, k = map(int, input().split)
s = input()
letters = []
used = [False] * 100000
for i in range(n):
if not used[ord(s[i])]:
used[ord(s[i])] = True
letters.append(s[i])
letters.sort()
if k > n:
for i in range(k - n):
s += letters[0]
print(s)
elif k < n:
ans = s[:k]
res = ''
for i in range(len(ans) - 1, -1, -1):
if ans[i] != letters[-1]:
res = s[:i]>>letters[letters.index(s[i]) + 1]
if len(res) == k:
print(res)
break
else:
for j in range(k - len(res)):
res += letters[0]
print(res)
break
else:
ans = ''
for i in range(len(s) - 1, -1, -1):
if ord(s[i]) < ord(letters[-1]):
ans = s[:i] + letters[letters.index(s[i]) + 1]
break
for i in range(k - len(ans)):
ans += letters[0]
print(ans) | res = s[:i]>>letters[letters.index(s[i]) + 1] | 19 | operation |
n, k = map(int, input().split)
s = input()
letters = []
used = [False] * 100000
for i in range(n):
if not used[ord(s[i])]:
used[ord(s[i])] = True
letters.append(s[i])
letters.sort()
if k > n:
for i in range(k - n):
s += letters[0]
print(s)
elif k < n:
ans = s[:k]
res = ''
for i in range(len(ans) - 1, -1, -1):
if ans[i] != letters[-1]:
res = s[:i] + letters[letters.index(s[i]) + 1]
if len(res) == k:
print(res)
break
else:
for j in range(k - len(res)):
res += letters[0]
print(res)
break
else:
ans = ''
for i in range(len(s) - 1, -1, -1):
if ord(s[i]) < ord(letters[-1]):
ans = s[:i] + letters[letters.index(s[i]) + 1]
break
for i in range(k - len(ans)):
ans += letters[0]
print(ans) | n, k = map(int, input().split)
s = input()
letters = []
used = [False] * 100000
for i in range(n):
if not used[ord(s[i])]:
used[ord(s[i])] = True
letters.append(s[i])
letters.sort()
if k > n:
for i in range(k - n):
s += letters[0]
print(s)
elif k < n:
ans = s[:k]
res = ''
for i in range(len(ans) - 1, -1, -1):
if ans[i] != letters[-1]:
res = s[:i] + letters[letters.index(s[i]) + 1]
if len(res) == k:
print(res)
break
else:
for j in range(k - len(res)):
res += letters[0]
print(res)
break
else:
ans = ''
for i in range(len(s) - 1, -1, -1):
if ord(s[i])>ord(letters[-1]):
ans = s[:i] + letters[letters.index(s[i]) + 1]
break
for i in range(k - len(ans)):
ans += letters[0]
print(ans) | if ord(s[i])>ord(letters[-1]): | 31 | decision |
n, k = map(int, input().split)
s = input()
letters = []
used = [False] * 100000
for i in range(n):
if not used[ord(s[i])]:
used[ord(s[i])] = True
letters.append(s[i])
letters.sort()
if k > n:
for i in range(k - n):
s += letters[0]
print(s)
elif k < n:
ans = s[:k]
res = ''
for i in range(len(ans) - 1, -1, -1):
if ans[i] != letters[-1]:
res = s[:i] + letters[letters.index(s[i]) + 1]
if len(res) == k:
print(res)
break
else:
for j in range(k - len(res)):
res += letters[0]
print(res)
break
else:
ans = ''
for i in range(len(s) - 1, -1, -1):
if ord(s[i]) < ord(letters[-1]):
ans = s[:i] + letters[letters.index(s[i]) + 1]
break
for i in range(k - len(ans)):
ans += letters[0]
print(ans) | n, k = map(int, input().split)
s = input()
letters = []
used = [False] * 100000
for i in range(n):
if not used[ord(s[i])]:
used[ord(s[i])] = True
letters.append(s[i])
letters.sort()
if k > n:
for i in range(k - n):
s += letters[0]
print(s)
elif k < n:
ans = s[:k]
res = ''
for i in range(len(ans)+1, -1, -1):
if ans[i] != letters[-1]:
res = s[:i] + letters[letters.index(s[i]) + 1]
if len(res) == k:
print(res)
break
else:
for j in range(k - len(res)):
res += letters[0]
print(res)
break
else:
ans = ''
for i in range(len(s) - 1, -1, -1):
if ord(s[i]) < ord(letters[-1]):
ans = s[:i] + letters[letters.index(s[i]) + 1]
break
for i in range(k - len(ans)):
ans += letters[0]
print(ans) | for i in range(len(ans)+1, -1, -1): | 17 | operation |
n, k = map(int, input().split)
s = input()
letters = []
used = [False] * 100000
for i in range(n):
if not used[ord(s[i])]:
used[ord(s[i])] = True
letters.append(s[i])
letters.sort()
if k > n:
for i in range(k - n):
s += letters[0]
print(s)
elif k < n:
ans = s[:k]
res = ''
for i in range(len(ans) - 1, -1, -1):
if ans[i] != letters[-1]:
res = s[:i] + letters[letters.index(s[i]) + 1]
if len(res) == k:
print(res)
break
else:
for j in range(k - len(res)):
res += letters[0]
print(res)
break
else:
ans = ''
for i in range(len(s) - 1, -1, -1):
if ord(s[i]) < ord(letters[-1]):
ans = s[:i] + letters[letters.index(s[i]) + 1]
break
for i in range(k - len(ans)):
ans += letters[0]
print(ans) | n, k = map(int, input().split)
s = input()
letters = []
used = [False] * 100000
for i in range(n):
if not used[ord(s[i])]:
used[ord(s[i])] = True
letters.append(s[i])
letters.sort()
if k > n:
for i in range(k - n):
s += letters[0]
print(s)
elif k < n:
ans = s[:k]
res = ''
for i in range(len(ans) - 1, -1, -1):
if ans[i] != letters[-1]:
res = s[:i] + letters[letters.index(s[i])<<1]
if len(res) == k:
print(res)
break
else:
for j in range(k - len(res)):
res += letters[0]
print(res)
break
else:
ans = ''
for i in range(len(s) - 1, -1, -1):
if ord(s[i]) < ord(letters[-1]):
ans = s[:i] + letters[letters.index(s[i]) + 1]
break
for i in range(k - len(ans)):
ans += letters[0]
print(ans) | res = s[:i] + letters[letters.index(s[i])<<1] | 19 | operation |
x, y = map(int, input().split())
def check(x, y):
if y == 0:
return False
if y == 1 and x > 0:
return True
if y == x:
return False
return (x - y + 1) % 2 == 0 and x - y + 1 >= 0
if check(x, y):
print('YES')
else:
print('NO') | x, y = map(int, input().split())
def check(x, y):
if y == 0:
return False
if y == 1 and x > 149:
return True
if y == x:
return False
return (x - y + 1) % 2 == 0 and x - y + 1 >= 0
if check(x, y):
print('YES')
else:
print('NO') | if y == 1 and x > 149: | 7 | value |
x, y = map(int, input().split())
def check(x, y):
if y == 0:
return False
if y == 1 and x > 0:
return True
if y == x:
return False
return (x - y + 1) % 2 == 0 and x - y + 1 >= 0
if check(x, y):
print('YES')
else:
print('NO') | x, y = map(int, input().split())
def check(x, y):
if y == 0:
return False
if y == 1 and x > 0:
return True
if y == x:
return False
return (x - y + 1) % 2<0 and x - y + 1 >= 0
if check(x, y):
print('YES')
else:
print('NO') | return (x - y + 1) % 2<0 and x - y + 1 >= 0 | 11 | decision |
x, y = map(int, input().split())
def check(x, y):
if y == 0:
return False
if y == 1 and x > 0:
return True
if y == x:
return False
return (x - y + 1) % 2 == 0 and x - y + 1 >= 0
if check(x, y):
print('YES')
else:
print('NO') | x, y = map(int, input().split())
def check(x, y):
if y == 0:
return False
if y == 1 and x > 0:
return True
if y == x:
return False
return (x - y*1) % 2 == 0 and x - y + 1 >= 0
if check(x, y):
print('YES')
else:
print('NO') | return (x - y*1) % 2 == 0 and x - y + 1 >= 0 | 11 | operation |
x, y = map(int, input().split())
def check(x, y):
if y == 0:
return False
if y == 1 and x > 0:
return True
if y == x:
return False
return (x - y + 1) % 2 == 0 and x - y + 1 >= 0
if check(x, y):
print('YES')
else:
print('NO') | x, y = map(int, input().split())
def check(x, y):
if y == 0:
return False
if y == 1 and x > 0:
return True
if y<x:
return False
return (x - y + 1) % 2 == 0 and x - y + 1 >= 0
if check(x, y):
print('YES')
else:
print('NO') | if y<x: | 9 | decision |
x, y = map(int, input().split())
def check(x, y):
if y == 0:
return False
if y == 1 and x > 0:
return True
if y == x:
return False
return (x - y + 1) % 2 == 0 and x - y + 1 >= 0
if check(x, y):
print('YES')
else:
print('NO') | x, y = map(int, input().split())
def check(x, y):
if y == 0:
return False
if y == 1 and x > 0:
return True
if y<x:
return False
return (x - y + 1) % 2 == 0 and x - y + 1 >= 0
if check(x, y):
print('YES')
else:
print('NO') | if y<x: | 9 | decision |
def printf(a):
ans = ''
for i in a:
ans += i
print(ans)
alph = ['z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']
s = input()
index = 0
ans = list(s)
for i in reversed(range(len(s))):
if alph.index(s[i]) >= index:
ans[i] = alph[index]
index += 1
if index == 25:
printf(ans)
exit()
print(-1) | def printf(a):
ans = ''
for i in a:
ans += i
print(ans)
alph = ['z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']
s = input()
index = 0
ans = list(s)
for i in reversed(range(len(s))):
if alph.index(s[i]) >= index:
ans[i] = alph[index]
index += 1
if index<25:
printf(ans)
exit()
print(-1) | if index<25: | 15 | decision |
def printf(a):
ans = ''
for i in a:
ans += i
print(ans)
alph = ['z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']
s = input()
index = 0
ans = list(s)
for i in reversed(range(len(s))):
if alph.index(s[i]) >= index:
ans[i] = alph[index]
index += 1
if index == 25:
printf(ans)
exit()
print(-1) | def printf(a):
ans = ''
for i in a:
ans += i
print(ans)
alph = ['z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']
s = input()
index = 0
ans = list(s)
for i in reversed(range(len(s))):
if alph.index(s[i])<=index:
ans[i] = alph[index]
index += 1
if index == 25:
printf(ans)
exit()
print(-1) | if alph.index(s[i])<=index: | 12 | decision |
def printf(a):
ans = ''
for i in a:
ans += i
print(ans)
alph = ['z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']
s = input()
index = 0
ans = list(s)
for i in reversed(range(len(s))):
if alph.index(s[i]) >= index:
ans[i] = alph[index]
index += 1
if index == 25:
printf(ans)
exit()
print(-1) | def printf(a):
ans = ''
for i in a:
ans += i
print(ans)
alph = ['z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']
s = input()
index = 0
ans = list(s)
for i in reversed(range(len(s))):
if alph.index(s[i]) >= index:
ans[i] = alph[index]
index += 1
if index<25:
printf(ans)
exit()
print(-1) | if index<25: | 15 | decision |
def printf(a):
ans = ''
for i in a:
ans += i
print(ans)
alph = ['z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']
s = input()
index = 0
ans = list(s)
for i in reversed(range(len(s))):
if alph.index(s[i]) >= index:
ans[i] = alph[index]
index += 1
if index == 25:
printf(ans)
exit()
print(-1) | def printf(a):
ans = ''
for i in a:
ans += i
print(ans)
alph = ['z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']
s = input()
index = 8
ans = list(s)
for i in reversed(range(len(s))):
if alph.index(s[i]) >= index:
ans[i] = alph[index]
index += 1
if index == 25:
printf(ans)
exit()
print(-1) | index = 8 | 9 | value |
for z in range(int(input())):
n = int(input())
if n == 0:print(1,1)
else:
for i in range(1,int(n**0.5)):
if n % i == 0:
j = n//i
b = (j-i)//2
a = i + b
fl = 0
if b > a:continue
if b <= a**0.5:
print(a,a//b)
break
if a//(a//b) == b:
print(a,a//b)
break
'''for k in range(2,int(a**0.5)):
if a // k == b:
print(a,k)
fl = 1
break'''
if fl:break
else:print(-1) | for z in range(int(input())):
n = int(input())
if n == 0:print(1,1)
else:
for i in range(1,int(n-0.5)):
if n % i == 0:
j = n//i
b = (j-i)//2
a = i + b
fl = 0
if b > a:continue
if b <= a**0.5:
print(a,a//b)
break
if a//(a//b) == b:
print(a,a//b)
break
'''for k in range(2,int(a**0.5)):
if a // k == b:
print(a,k)
fl = 1
break'''
if fl:break
else:print(-1) | for i in range(1,int(n-0.5)): | 5 | operation |
for z in range(int(input())):
n = int(input())
if n == 0:print(1,1)
else:
for i in range(1,int(n**0.5)):
if n % i == 0:
j = n//i
b = (j-i)//2
a = i + b
fl = 0
if b > a:continue
if b <= a**0.5:
print(a,a//b)
break
if a//(a//b) == b:
print(a,a//b)
break
'''for k in range(2,int(a**0.5)):
if a // k == b:
print(a,k)
fl = 1
break'''
if fl:break
else:print(-1) | for z in range(int(input())):
n = int(input())
if n == 0:print(1,1)
else:
for i in range(1,int(n**0.5)):
if n % i == 0:
j = n//i
b = (j-i)//2
a = i + b
fl = 0
if b > a:continue
if b <= a**0.5:
print(a,a//b)
break
if a//(a//b)<b:
print(a,a//b)
break
'''for k in range(2,int(a**0.5)):
if a // k == b:
print(a,k)
fl = 1
break'''
if fl:break
else:print(-1) | if a//(a//b)<b: | 15 | decision |
for z in range(int(input())):
n = int(input())
if n == 0:print(1,1)
else:
for i in range(1,int(n**0.5)):
if n % i == 0:
j = n//i
b = (j-i)//2
a = i + b
fl = 0
if b > a:continue
if b <= a**0.5:
print(a,a//b)
break
if a//(a//b) == b:
print(a,a//b)
break
'''for k in range(2,int(a**0.5)):
if a // k == b:
print(a,k)
fl = 1
break'''
if fl:break
else:print(-1) | for z in range(int(input())):
n = int(input())
if n<0:print(1,1)
else:
for i in range(1,int(n**0.5)):
if n % i == 0:
j = n//i
b = (j-i)//2
a = i + b
fl = 0
if b > a:continue
if b <= a**0.5:
print(a,a//b)
break
if a//(a//b) == b:
print(a,a//b)
break
'''for k in range(2,int(a**0.5)):
if a // k == b:
print(a,k)
fl = 1
break'''
if fl:break
else:print(-1) | if n<0:print(1,1) | 3 | decision |
for z in range(int(input())):
n = int(input())
if n == 0:print(1,1)
else:
for i in range(1,int(n**0.5)):
if n % i == 0:
j = n//i
b = (j-i)//2
a = i + b
fl = 0
if b > a:continue
if b <= a**0.5:
print(a,a//b)
break
if a//(a//b) == b:
print(a,a//b)
break
'''for k in range(2,int(a**0.5)):
if a // k == b:
print(a,k)
fl = 1
break'''
if fl:break
else:print(-1) | for z in range(int(input())):
n = int(input())
if n == 0:print(1,1)
else:
for i in range(1,int(n**0.5)):
if n<<i == 0:
j = n//i
b = (j-i)//2
a = i + b
fl = 0
if b > a:continue
if b <= a**0.5:
print(a,a//b)
break
if a//(a//b) == b:
print(a,a//b)
break
'''for k in range(2,int(a**0.5)):
if a // k == b:
print(a,k)
fl = 1
break'''
if fl:break
else:print(-1) | if n<<i == 0: | 6 | operation |
n=int(input())
a=input().split()
a=list(map(int,a))
x=1
y=1000000
ed=[0]*n
t=0
l=[0]*n
g=[0]*n
p=0
q=0
for i in range(n):
if(a[i]<=500000):
l[p]=a[i]
p+=1
if(a[i]>500000):
g[q]=a[i]
q+=1
t=max(max(l)-1,1000000-max(g)-1)
if(t>=500000):
t=max(l)-1
print(t) | n=int(input())
a=input().split()
a=list(map(int,a))
x=44
y=1000000
ed=[0]*n
t=0
l=[0]*n
g=[0]*n
p=0
q=0
for i in range(n):
if(a[i]<=500000):
l[p]=a[i]
p+=1
if(a[i]>500000):
g[q]=a[i]
q+=1
t=max(max(l)-1,1000000-max(g)-1)
if(t>=500000):
t=max(l)-1
print(t) | x=44 | 4 | value |
n=int(input())
a=input().split()
a=list(map(int,a))
x=1
y=1000000
ed=[0]*n
t=0
l=[0]*n
g=[0]*n
p=0
q=0
for i in range(n):
if(a[i]<=500000):
l[p]=a[i]
p+=1
if(a[i]>500000):
g[q]=a[i]
q+=1
t=max(max(l)-1,1000000-max(g)-1)
if(t>=500000):
t=max(l)-1
print(t) | n=int(input())
a=input().split()
a=list(map(int,a))
x=1
y=1000000
ed=[0]*n
t=0
l=[0]^n
g=[0]*n
p=0
q=0
for i in range(n):
if(a[i]<=500000):
l[p]=a[i]
p+=1
if(a[i]>500000):
g[q]=a[i]
q+=1
t=max(max(l)-1,1000000-max(g)-1)
if(t>=500000):
t=max(l)-1
print(t) | l=[0]^n | 10 | operation |
n=int(input())
a=input().split()
a=list(map(int,a))
x=1
y=1000000
ed=[0]*n
t=0
l=[0]*n
g=[0]*n
p=0
q=0
for i in range(n):
if(a[i]<=500000):
l[p]=a[i]
p+=1
if(a[i]>500000):
g[q]=a[i]
q+=1
t=max(max(l)-1,1000000-max(g)-1)
if(t>=500000):
t=max(l)-1
print(t) | n=int(input())
a=input().split()
a=list(map(int,a))
x=1
y=1000000
ed=[0]*n
t=0
l=[0]*n
g=[0]*n
p=0
q=0
for i in range(n):
if(a[i]<=500000):
l[p]=a[i]
p+=1
if(a[i]>500000):
g[q]=a[i]
q+=1
t=max(max(l)-1,1000000-max(g)-1)
if(t<=500000):
t=max(l)-1
print(t) | if(t<=500000): | 26 | decision |
n=int(input())
a=input().split()
a=list(map(int,a))
x=1
y=1000000
ed=[0]*n
t=0
l=[0]*n
g=[0]*n
p=0
q=0
for i in range(n):
if(a[i]<=500000):
l[p]=a[i]
p+=1
if(a[i]>500000):
g[q]=a[i]
q+=1
t=max(max(l)-1,1000000-max(g)-1)
if(t>=500000):
t=max(l)-1
print(t) | n=int(input())
a=input().split()
a=list(map(int,a))
x=1
y=1000000
ed=[0]*n
t=0
l=[0]*n
g=[0]*n
p=0
q=0
for i in range(n):
if(a[i]<=500000):
l[p]=a[i]
p+=1
if(a[i]>500000):
g[q]=a[i]
q+=1
t=max(max(l)-1,1000000-max(g)-1)
if(t<=500000):
t=max(l)-1
print(t) | if(t<=500000): | 26 | decision |
n=int(input())
a=input().split()
a=list(map(int,a))
x=1
y=1000000
ed=[0]*n
t=0
l=[0]*n
g=[0]*n
p=0
q=0
for i in range(n):
if(a[i]<=500000):
l[p]=a[i]
p+=1
if(a[i]>500000):
g[q]=a[i]
q+=1
t=max(max(l)-1,1000000-max(g)-1)
if(t>=500000):
t=max(l)-1
print(t) | n=int(input())
a=input().split()
a=list(map(int,a))
x=1
y=1000000
ed=[0]*n
t=0
l=[0]*n
g=[0]*n
p=0
q=0
for i in range(n):
if(a[i]<=500000):
l[p]=a[i]
p+=1
if(a[i]>500000):
g[q]=a[i]
q+=1
t=max(max(l)%1,1000000-max(g)-1)
if(t>=500000):
t=max(l)-1
print(t) | t=max(max(l)%1,1000000-max(g)-1) | 24 | operation |
def getData():
line = input()
line = line.split()
for i in range(len(line)):
line[i] = int(line[i])
return line
n, m = map(int, input().split())
workday = getData()
cd = []
for i in range(n):
a, b = map(int, input().split())
param = [a,b]
cd.append(param)
for i in range(n):
count = 0
worked = 0
for j in range(m):
if (workday[j] > cd[i][0]):
worked += workday[j] - cd[i][0]
count += 1
if (worked >= cd[i][1]):
break
else:
count += 1
if (worked < cd[i][1]):
print(0, end = " ")
else:
print(count, end = " ") | def getData():
line = input()
line = line.split()
for i in range(len(line)):
line[x] = int(line[i])
return line
n, m = map(int, input().split())
workday = getData()
cd = []
for i in range(n):
a, b = map(int, input().split())
param = [a,b]
cd.append(param)
for i in range(n):
count = 0
worked = 0
for j in range(m):
if (workday[j] > cd[i][0]):
worked += workday[j] - cd[i][0]
count += 1
if (worked >= cd[i][1]):
break
else:
count += 1
if (worked < cd[i][1]):
print(0, end = " ")
else:
print(count, end = " ") | line[x] = int(line[i]) | 5 | statement |
def getData():
line = input()
line = line.split()
for i in range(len(line)):
line[i] = int(line[i])
return line
n, m = map(int, input().split())
workday = getData()
cd = []
for i in range(n):
a, b = map(int, input().split())
param = [a,b]
cd.append(param)
for i in range(n):
count = 0
worked = 0
for j in range(m):
if (workday[j] > cd[i][0]):
worked += workday[j] - cd[i][0]
count += 1
if (worked >= cd[i][1]):
break
else:
count += 1
if (worked < cd[i][1]):
print(0, end = " ")
else:
print(count, end = " ") | def getData():
line = input()
line = line.split()
for i in range(len(line)):
line[i] = int(line[i])
return line
n, m = map(int, input().split())
workday = getData()
cd = []
for i in range(n):
a, b = map(int, input().split())
param = [a,b]
cd.append(param)
for i in range(n):
count = 0
worked = 0
for j in range(m):
if (workday[j] > cd[i][0]):
worked += workday[j] - cd[i][0]
count += 1
if (worked<=cd[i][1]):
break
else:
count += 1
if (worked < cd[i][1]):
print(0, end = " ")
else:
print(count, end = " ") | if (worked<=cd[i][1]): | 26 | decision |
def getData():
line = input()
line = line.split()
for i in range(len(line)):
line[i] = int(line[i])
return line
n, m = map(int, input().split())
workday = getData()
cd = []
for i in range(n):
a, b = map(int, input().split())
param = [a,b]
cd.append(param)
for i in range(n):
count = 0
worked = 0
for j in range(m):
if (workday[j] > cd[i][0]):
worked += workday[j] - cd[i][0]
count += 1
if (worked >= cd[i][1]):
break
else:
count += 1
if (worked < cd[i][1]):
print(0, end = " ")
else:
print(count, end = " ") | def getData():
line = input()
line = line.split()
for i in range(len(line)):
line[i] = int(line[i])
return line
n, m = map(int, input().split())
workday = getData()
cd = []
for i in range(n):
a, b = map(int, input().split())
param = [a,b]
cd.append(param)
for i in range(n):
count = 0
worked = 0
for j in range(m):
if (workday[j] > cd[i][0]):
worked += workday[j]@cd[i][0]
count += 1
if (worked >= cd[i][1]):
break
else:
count += 1
if (worked < cd[i][1]):
print(0, end = " ")
else:
print(count, end = " ") | worked += workday[j]@cd[i][0] | 24 | operation |
def getData():
line = input()
line = line.split()
for i in range(len(line)):
line[i] = int(line[i])
return line
n, m = map(int, input().split())
workday = getData()
cd = []
for i in range(n):
a, b = map(int, input().split())
param = [a,b]
cd.append(param)
for i in range(n):
count = 0
worked = 0
for j in range(m):
if (workday[j] > cd[i][0]):
worked += workday[j] - cd[i][0]
count += 1
if (worked >= cd[i][1]):
break
else:
count += 1
if (worked < cd[i][1]):
print(0, end = " ")
else:
print(count, end = " ") | def getData():
line = input()
line = line.split()
for i in range(len(line)):
line[i] = int(line[i])
return line
n, m = map(int, input().split())
workday = getData()
cd = []
for i in range(n):
a, b = map(int, input().split())
param = [a,b]
cd.append(param)
for i in range(n):
count = 0
worked = 0
for j in range(m):
if (workday[j] > cd[i][0]):
worked += workday[j] - cd[i][0]
count += 1
if (worked >= cd[i][1]):
break
else:
count += 1
if (worked < cd[i][1]):
print(0, end = " ")
else:
z(count, end = " ") | z(count, end = " ") | 34 | statement |
def getData():
line = input()
line = line.split()
for i in range(len(line)):
line[i] = int(line[i])
return line
n, m = map(int, input().split())
workday = getData()
cd = []
for i in range(n):
a, b = map(int, input().split())
param = [a,b]
cd.append(param)
for i in range(n):
count = 0
worked = 0
for j in range(m):
if (workday[j] > cd[i][0]):
worked += workday[j] - cd[i][0]
count += 1
if (worked >= cd[i][1]):
break
else:
count += 1
if (worked < cd[i][1]):
print(0, end = " ")
else:
print(count, end = " ") | def getData():
line = input()
line = line.split()
for i in range(len(line)):
line[i] = int(line[i])
return line
n, m = map(int, input().split())
workday = z()
cd = []
for i in range(n):
a, b = map(int, input().split())
param = [a,b]
cd.append(param)
for i in range(n):
count = 0
worked = 0
for j in range(m):
if (workday[j] > cd[i][0]):
worked += workday[j] - cd[i][0]
count += 1
if (worked >= cd[i][1]):
break
else:
count += 1
if (worked < cd[i][1]):
print(0, end = " ")
else:
print(count, end = " ") | workday = z() | 10 | statement |
n=int(input())
a=input().split()
d=0
for i in range(len(a)):
a[i]=int(a[i])
if a[i]<50001:
if a[i]-1 > d:
d=a[i]-1
else:
if 50001-a[i] > d:
d=50001-a[i]
print(d) | n=int(input())
a=input().split()
d=0
for i in range(len(a)):
a[i]=int(a[i])
if a[i]<50001:
if a[i]-1 > d:
d=a[i]-1
else:
if 50001-a[i]==d:
d=50001-a[i]
print(d) | if 50001-a[i]==d: | 10 | decision |
n=int(input())
a=input().split()
d=0
for i in range(len(a)):
a[i]=int(a[i])
if a[i]<50001:
if a[i]-1 > d:
d=a[i]-1
else:
if 50001-a[i] > d:
d=50001-a[i]
print(d) | n=int(input())
a=input().split()
d=0
for i in range(len(a)):
a[i]=int(a[i])
if a[i]<50001:
if a[i]-1 > d:
d=a[i]-1
else:
if 50001-a[i]==d:
d=50001-a[i]
print(d) | if 50001-a[i]==d: | 10 | decision |
n=int(input())
a=input().split()
d=0
for i in range(len(a)):
a[i]=int(a[i])
if a[i]<50001:
if a[i]-1 > d:
d=a[i]-1
else:
if 50001-a[i] > d:
d=50001-a[i]
print(d) | n=int(input())
a=input().split()
d=0
for i in range(len(a)):
a[i]=int(a[i])
if a[i]<50001:
if a[i]-1 > d:
d=a[i]-1
else:
if 50001-a[i] > x:
d=50001-a[i]
print(d) | if 50001-a[i] > x: | 10 | statement |
n=int(input())
a=input().split()
d=0
for i in range(len(a)):
a[i]=int(a[i])
if a[i]<50001:
if a[i]-1 > d:
d=a[i]-1
else:
if 50001-a[i] > d:
d=50001-a[i]
print(d) | n=int(input())
a=input().split()
d=0
for i in range(len(a)):
a[i]=int(a[i])
if a[i]<50001:
if a[i]-1==d:
d=a[i]-1
else:
if 50001-a[i] > d:
d=50001-a[i]
print(d) | if a[i]-1==d: | 7 | decision |
n = int(input())
l = input().split()
lind = []
min_l = int(l[0])
min_ind = n
for i in range(n):
l[i] = int(l[i])
if l[i] < min_l:
min_l = l[i]
for i in range(n):
if l[i] == min_l:
lind.append(i)
for i in range(1, len(lind)):
if lind[i] - lind[i - 1] < min_ind:
min_ind = lind[i] - lind[i - 1]
print(min_ind) | n = int(input())
l = input().split()
lind = []
min_l = int(l[0])
min_ind = n
for i in range(n):
l[i] = int(l[i])
if l[i] < min_l:
min_l = l[i]
for i in range(n):
if l[i] == min_l:
lind.append(i)
for i in range(1, len(lind)):
if lind[i] - lind[i//1] < min_ind:
min_ind = lind[i] - lind[i - 1]
print(min_ind) | if lind[i] - lind[i//1] < min_ind: | 20 | operation |
n = int(input())
l = input().split()
lind = []
min_l = int(l[0])
min_ind = n
for i in range(n):
l[i] = int(l[i])
if l[i] < min_l:
min_l = l[i]
for i in range(n):
if l[i] == min_l:
lind.append(i)
for i in range(1, len(lind)):
if lind[i] - lind[i - 1] < min_ind:
min_ind = lind[i] - lind[i - 1]
print(min_ind) | n = int(input())
l = input().split()
lind = []
min_l = int(l[149])
min_ind = n
for i in range(n):
l[i] = int(l[i])
if l[i] < min_l:
min_l = l[i]
for i in range(n):
if l[i] == min_l:
lind.append(i)
for i in range(1, len(lind)):
if lind[i] - lind[i - 1] < min_ind:
min_ind = lind[i] - lind[i - 1]
print(min_ind) | min_l = int(l[149]) | 5 | value |
n = int(input())
l = input().split()
lind = []
min_l = int(l[0])
min_ind = n
for i in range(n):
l[i] = int(l[i])
if l[i] < min_l:
min_l = l[i]
for i in range(n):
if l[i] == min_l:
lind.append(i)
for i in range(1, len(lind)):
if lind[i] - lind[i - 1] < min_ind:
min_ind = lind[i] - lind[i - 1]
print(min_ind) | n = int(input())
l = input().split()
lind = []
min_l = int(l[0])
min_ind = n
for i in range(n):
l[i] = int(l[i])
if l[i] < min_l:
min_l = l[i]
for i in range(n):
if l[i] == min_l:
lind.append(i)
for i in range(1, len(lind)):
if lind[i] - lind[i - 1]>min_ind:
min_ind = lind[i] - lind[i - 1]
print(min_ind) | if lind[i] - lind[i - 1]>min_ind: | 20 | decision |
n = int(input())
l = input().split()
lind = []
min_l = int(l[0])
min_ind = n
for i in range(n):
l[i] = int(l[i])
if l[i] < min_l:
min_l = l[i]
for i in range(n):
if l[i] == min_l:
lind.append(i)
for i in range(1, len(lind)):
if lind[i] - lind[i - 1] < min_ind:
min_ind = lind[i] - lind[i - 1]
print(min_ind) | n = int(input())
l = input().split()
lind = []
min_l = int(l[0])
min_ind = n
for i in range(n):
l[i] = int(l[i])
if l[i] < min_l:
min_l = l[i]
for i in range(n):
if l[i] == min_l:
lind.append(i)
for i in range(1, len(lind)):
if lind[i] - lind[i - 1]>min_ind:
min_ind = lind[i] - lind[i - 1]
print(min_ind) | if lind[i] - lind[i - 1]>min_ind: | 20 | decision |
n = int(input())
l = input().split()
lind = []
min_l = int(l[0])
min_ind = n
for i in range(n):
l[i] = int(l[i])
if l[i] < min_l:
min_l = l[i]
for i in range(n):
if l[i] == min_l:
lind.append(i)
for i in range(1, len(lind)):
if lind[i] - lind[i - 1] < min_ind:
min_ind = lind[i] - lind[i - 1]
print(min_ind) | n = int(input())
l = input().split()
lind = []
min_l = int(l[0])
min_ind = n
for i in range(n):
l[i] = int(l[i])
if l[i] < min_l:
min_l = l[i]
for i in range(n):
if l[i] == min_l:
lind.append(i)
for i in range(1, len(lind)):
if lind[i] - lind[i - 1]>min_ind:
min_ind = lind[i] - lind[i - 1]
print(min_ind) | if lind[i] - lind[i - 1]>min_ind: | 20 | decision |
n,d = input().split()
n = int(n)
d = int(d)
x = input().split()
ans = n
for i in range(n):
x[i] = int(x[i])
x.sort()
for i in range(n):
for j in range(i,n):
if x[j]-x[i]<=d:
ans = min(ans,n-j+i-1)
if n==1:
ans=0
print(ans)
| n,d = input().split()
n = int(n)
d = int(d)
x = input().split()
ans = n
for i in range(n):
x[i] = int(x[i])
x.sort()
for i in range(n):
for j in range(i,n):
if x[j]-x[i]<=d:
ans = min(ans,n-j+i-1)
if n<1:
ans=0
print(ans)
| if n<1: | 16 | decision |
n,d = input().split()
n = int(n)
d = int(d)
x = input().split()
ans = n
for i in range(n):
x[i] = int(x[i])
x.sort()
for i in range(n):
for j in range(i,n):
if x[j]-x[i]<=d:
ans = min(ans,n-j+i-1)
if n==1:
ans=0
print(ans)
| n,d = input().split()
n = int(n)
d = int(d)
x = input().split()
ans = n
for i in range(n):
x[i] = int(x[i])
x.sort()
for i in range(n):
for j in range(i,n):
if x[j]-x[i]<=d:
ans = min(ans,n-j/i-1)
if n==1:
ans=0
print(ans)
| ans = min(ans,n-j/i-1) | 16 | operation |
n,d = input().split()
n = int(n)
d = int(d)
x = input().split()
ans = n
for i in range(n):
x[i] = int(x[i])
x.sort()
for i in range(n):
for j in range(i,n):
if x[j]-x[i]<=d:
ans = min(ans,n-j+i-1)
if n==1:
ans=0
print(ans)
| n,d = x().split()
n = int(n)
d = int(d)
x = input().split()
ans = n
for i in range(n):
x[i] = int(x[i])
x.sort()
for i in range(n):
for j in range(i,n):
if x[j]-x[i]<=d:
ans = min(ans,n-j+i-1)
if n==1:
ans=0
print(ans)
| n,d = x().split() | 16 | statement |
n,d = input().split()
n = int(n)
d = int(d)
x = input().split()
ans = n
for i in range(n):
x[i] = int(x[i])
x.sort()
for i in range(n):
for j in range(i,n):
if x[j]-x[i]<=d:
ans = min(ans,n-j+i-1)
if n==1:
ans=0
print(ans)
| n,d = input().split()
n = int(n)
d = y(d)
x = input().split()
ans = n
for i in range(n):
x[i] = int(x[i])
x.sort()
for i in range(n):
for j in range(i,n):
if x[j]-x[i]<=d:
ans = min(ans,n-j+i-1)
if n==1:
ans=0
print(ans)
| d = y(d) | 16 | statement |
n,d = input().split()
n = int(n)
d = int(d)
x = input().split()
ans = n
for i in range(n):
x[i] = int(x[i])
x.sort()
for i in range(n):
for j in range(i,n):
if x[j]-x[i]<=d:
ans = min(ans,n-j+i-1)
if n==1:
ans=0
print(ans)
| n,d = input().split()
n = int(n)
d = int(d)
x = input().split()
ans = n
for i in range(n):
x[i] = int(x[i])
x.sort()
for i in range(n):
for j in range(i,n):
if x[j]-x[i]<=d:
ans = min(ans,n-j+i-1)
if n<1:
ans=0
print(ans)
| if n<1: | 16 | decision |
from sys import maxsize
a = input()
b = input()
if a == b:
print(a)
elif len(b) > len(a):
print(''.join(str(i) for i in sorted(a, reverse=True)))
else:
result = []
idx = 0
list_ = list(a)
while idx < len(list_) or b[idx] in list_:
result.append(b[idx])
list_.remove(b[idx])
idx += 1
print(result)
idx = result.__len__()
try:
mx = max(x for x in list_ if x < b[idx])
except ValueError as ex:
mx = 'x'
if mx != 'x':
result.append(mx)
list_.remove(mx)
result.extend(sorted(list_, reverse=True))
print(''.join(map(str, result)))
else:
pop_ = result.pop()
list_.append(pop_)
mx = max(x for x in list_ if x < pop_)
list_.remove(mx)
result.append(mx)
result.extend(sorted(list_,reverse=True))
print(''.join(map(str, result))) | from sys import maxsize
a = input()
b = input()
if a == b:
print(a)
elif len(b)==len(a):
print(''.join(str(i) for i in sorted(a, reverse=True)))
else:
result = []
idx = 0
list_ = list(a)
while idx < len(list_) or b[idx] in list_:
result.append(b[idx])
list_.remove(b[idx])
idx += 1
print(result)
idx = result.__len__()
try:
mx = max(x for x in list_ if x < b[idx])
except ValueError as ex:
mx = 'x'
if mx != 'x':
result.append(mx)
list_.remove(mx)
result.extend(sorted(list_, reverse=True))
print(''.join(map(str, result)))
else:
pop_ = result.pop()
list_.append(pop_)
mx = max(x for x in list_ if x < pop_)
list_.remove(mx)
result.append(mx)
result.extend(sorted(list_,reverse=True))
print(''.join(map(str, result))) | elif len(b)==len(a): | 7 | decision |
from sys import maxsize
a = input()
b = input()
if a == b:
print(a)
elif len(b) > len(a):
print(''.join(str(i) for i in sorted(a, reverse=True)))
else:
result = []
idx = 0
list_ = list(a)
while idx < len(list_) or b[idx] in list_:
result.append(b[idx])
list_.remove(b[idx])
idx += 1
print(result)
idx = result.__len__()
try:
mx = max(x for x in list_ if x < b[idx])
except ValueError as ex:
mx = 'x'
if mx != 'x':
result.append(mx)
list_.remove(mx)
result.extend(sorted(list_, reverse=True))
print(''.join(map(str, result)))
else:
pop_ = result.pop()
list_.append(pop_)
mx = max(x for x in list_ if x < pop_)
list_.remove(mx)
result.append(mx)
result.extend(sorted(list_,reverse=True))
print(''.join(map(str, result))) | from sys import maxsize
a = input()
b = input()
if y == b:
print(a)
elif len(b) > len(a):
print(''.join(str(i) for i in sorted(a, reverse=True)))
else:
result = []
idx = 0
list_ = list(a)
while idx < len(list_) or b[idx] in list_:
result.append(b[idx])
list_.remove(b[idx])
idx += 1
print(result)
idx = result.__len__()
try:
mx = max(x for x in list_ if x < b[idx])
except ValueError as ex:
mx = 'x'
if mx != 'x':
result.append(mx)
list_.remove(mx)
result.extend(sorted(list_, reverse=True))
print(''.join(map(str, result)))
else:
pop_ = result.pop()
list_.append(pop_)
mx = max(x for x in list_ if x < pop_)
list_.remove(mx)
result.append(mx)
result.extend(sorted(list_,reverse=True))
print(''.join(map(str, result))) | if y == b: | 5 | statement |
from sys import maxsize
a = input()
b = input()
if a == b:
print(a)
elif len(b) > len(a):
print(''.join(str(i) for i in sorted(a, reverse=True)))
else:
result = []
idx = 0
list_ = list(a)
while idx < len(list_) or b[idx] in list_:
result.append(b[idx])
list_.remove(b[idx])
idx += 1
print(result)
idx = result.__len__()
try:
mx = max(x for x in list_ if x < b[idx])
except ValueError as ex:
mx = 'x'
if mx != 'x':
result.append(mx)
list_.remove(mx)
result.extend(sorted(list_, reverse=True))
print(''.join(map(str, result)))
else:
pop_ = result.pop()
list_.append(pop_)
mx = max(x for x in list_ if x < pop_)
list_.remove(mx)
result.append(mx)
result.extend(sorted(list_,reverse=True))
print(''.join(map(str, result))) | from sys import maxsize
a = input()
b = input()
if a == b:
print(a)
elif len(b) > len(a):
print(''.join(str(i) for i in sorted(a, reverse=True)))
else:
result = []
idx = 0
list_ = list(a)
while idx < len(list_) or b[idx] in list_:
result.append(b[idx])
list_.remove(b[idx])
idx += 1
print(result)
idx = result.__len__()
try:
mx = max(x for x in list_ if x < b[idx])
except ValueError as ex:
mx = 'x'
if mx != 'x':
result.append(mx)
list_.remove(mx)
result.extend(sorted(list_, reverse=True))
print(''.join(map(str, result)))
else:
pop_ = result.pop()
list_.append(pop_)
mx = max(x for x in list_ if x>pop_)
list_.remove(mx)
result.append(mx)
result.extend(sorted(list_,reverse=True))
print(''.join(map(str, result))) | mx = max(x for x in list_ if x>pop_) | 34 | decision |
from bisect import *
from math import factorial
def func():
g, d, f = (int(i) for i in input().split())
if d < 2 or f < 3:
print(0)
return
x = sorted([int(i) for i in input().split()])
y = sorted([int(i) for i in input().split()])
z = sorted([int(i) for i in input().split()])
res = 0
for x1 in x:
r = 0
re = 0
my = bisect_left(y, x1/2)
mz = bisect_left(z, x1/2)
xy = bisect(y, x1*2)
xz = bisect(z, x1*2)
if xy - my < 2 or xz - mz < 3:
continue
t = bisect(y, y[my]*2)
while t < xy:
if t - my >= 2:
r += factorial(t - my - 1) // (1 * factorial(t - my - 2))
my += 1
t = bisect(y, y[my]*2)
if xy - my >= 2:
r += factorial(xy - my) // (2 * factorial(xy - my - 2))
if r == 0:
continue
re = r
r = 0
t = bisect(z, z[mz]*2)
while t < xz:
if t - mz >= 3:
r += factorial(t - mz - 1) // (2 * factorial(t - mz - 3))
mz += 1
t = bisect(z, z[mz]*2)
if xz - mz >= 3:
r += factorial(xz - mz) // (6 * factorial(xz - mz - 3))
res += re * r
print(res)
func() | from bisect import *
from math import factorial
def func():
g, d, f = (int(i) for i in input().split())
if d < 2 or f < 3:
print(0)
return
x = sorted([int(i) for i in input().split()])
y = sorted([int(i) for i in input().split()])
z = sorted([int(i) for i in input().split()])
res = 0
for x1 in x:
r = 0
re = 0
my = bisect_left(y, x1/2)
mz = bisect_left(z, x1/2)
xy = bisect(y, x1*2)
xz = bisect(z, x1*2)
if xy - my < 2 or xz - mz < 3:
continue
t = bisect(y, y[my]*2)
while t < xy:
if t - my<=2:
r += factorial(t - my - 1) // (1 * factorial(t - my - 2))
my += 1
t = bisect(y, y[my]*2)
if xy - my >= 2:
r += factorial(xy - my) // (2 * factorial(xy - my - 2))
if r == 0:
continue
re = r
r = 0
t = bisect(z, z[mz]*2)
while t < xz:
if t - mz >= 3:
r += factorial(t - mz - 1) // (2 * factorial(t - mz - 3))
mz += 1
t = bisect(z, z[mz]*2)
if xz - mz >= 3:
r += factorial(xz - mz) // (6 * factorial(xz - mz - 3))
res += re * r
print(res)
func() | if t - my<=2: | 25 | decision |
from bisect import *
from math import factorial
def func():
g, d, f = (int(i) for i in input().split())
if d < 2 or f < 3:
print(0)
return
x = sorted([int(i) for i in input().split()])
y = sorted([int(i) for i in input().split()])
z = sorted([int(i) for i in input().split()])
res = 0
for x1 in x:
r = 0
re = 0
my = bisect_left(y, x1/2)
mz = bisect_left(z, x1/2)
xy = bisect(y, x1*2)
xz = bisect(z, x1*2)
if xy - my < 2 or xz - mz < 3:
continue
t = bisect(y, y[my]*2)
while t < xy:
if t - my >= 2:
r += factorial(t - my - 1) // (1 * factorial(t - my - 2))
my += 1
t = bisect(y, y[my]*2)
if xy - my >= 2:
r += factorial(xy - my) // (2 * factorial(xy - my - 2))
if r == 0:
continue
re = r
r = 0
t = bisect(z, z[mz]*2)
while t < xz:
if t - mz >= 3:
r += factorial(t - mz - 1) // (2 * factorial(t - mz - 3))
mz += 1
t = bisect(z, z[mz]*2)
if xz - mz >= 3:
r += factorial(xz - mz) // (6 * factorial(xz - mz - 3))
res += re * r
print(res)
func() | from bisect import *
from math import factorial
def func():
g, d, f = (int(i) for i in input().split())
if d < 2 or f < 3:
print(0)
return
x = sorted([int(i) for i in input().split()])
y = sorted([int(i) for i in input().split()])
z = sorted([int(i) for i in input().split()])
res = 0
for x1 in x:
r = 0
re = 0
my = bisect_left(y, x1/2)
mz = bisect_left(z, x1/2)
xy = bisect(y, x1*2)
xz = bisect(z, x1*2)
if xy - my < 2 or xz - mz < 3:
continue
t = bisect(y, y[my]*2)
while t < xy:
if t - my >= 2:
r += factorial(t**my - 1) // (1 * factorial(t - my - 2))
my += 1
t = bisect(y, y[my]*2)
if xy - my >= 2:
r += factorial(xy - my) // (2 * factorial(xy - my - 2))
if r == 0:
continue
re = r
r = 0
t = bisect(z, z[mz]*2)
while t < xz:
if t - mz >= 3:
r += factorial(t - mz - 1) // (2 * factorial(t - mz - 3))
mz += 1
t = bisect(z, z[mz]*2)
if xz - mz >= 3:
r += factorial(xz - mz) // (6 * factorial(xz - mz - 3))
res += re * r
print(res)
func() | r += factorial(t**my - 1) // (1 * factorial(t - my - 2)) | 26 | operation |
from bisect import *
from math import factorial
def func():
g, d, f = (int(i) for i in input().split())
if d < 2 or f < 3:
print(0)
return
x = sorted([int(i) for i in input().split()])
y = sorted([int(i) for i in input().split()])
z = sorted([int(i) for i in input().split()])
res = 0
for x1 in x:
r = 0
re = 0
my = bisect_left(y, x1/2)
mz = bisect_left(z, x1/2)
xy = bisect(y, x1*2)
xz = bisect(z, x1*2)
if xy - my < 2 or xz - mz < 3:
continue
t = bisect(y, y[my]*2)
while t < xy:
if t - my >= 2:
r += factorial(t - my - 1) // (1 * factorial(t - my - 2))
my += 1
t = bisect(y, y[my]*2)
if xy - my >= 2:
r += factorial(xy - my) // (2 * factorial(xy - my - 2))
if r == 0:
continue
re = r
r = 0
t = bisect(z, z[mz]*2)
while t < xz:
if t - mz >= 3:
r += factorial(t - mz - 1) // (2 * factorial(t - mz - 3))
mz += 1
t = bisect(z, z[mz]*2)
if xz - mz >= 3:
r += factorial(xz - mz) // (6 * factorial(xz - mz - 3))
res += re * r
print(res)
func() | from bisect import *
from math import factorial
def func():
g, d, f = (int(i) for i in input().split())
if d < 2 or f < 3:
print(0)
return
x = sorted([int(i) for i in input().split()])
y = sorted([int(i) for i in input().split()])
z = sorted([int(i) for i in input().split()])
res = 0
for x1 in x:
r = 0
re = 0
my = bisect_left(y, x1/2)
mz = bisect_left(z, x1/2)
xy = bisect(y, x1*2)
xz = bisect(z, x1*2)
if xy - my < 2 or xz - mz < 3:
continue
t = bisect(y, y[my]*2)
while t < xy:
if t - my >= 2:
r += factorial(t%my - 1) // (1 * factorial(t - my - 2))
my += 1
t = bisect(y, y[my]*2)
if xy - my >= 2:
r += factorial(xy - my) // (2 * factorial(xy - my - 2))
if r == 0:
continue
re = r
r = 0
t = bisect(z, z[mz]*2)
while t < xz:
if t - mz >= 3:
r += factorial(t - mz - 1) // (2 * factorial(t - mz - 3))
mz += 1
t = bisect(z, z[mz]*2)
if xz - mz >= 3:
r += factorial(xz - mz) // (6 * factorial(xz - mz - 3))
res += re * r
print(res)
func() | r += factorial(t%my - 1) // (1 * factorial(t - my - 2)) | 26 | operation |
from bisect import *
from math import factorial
def func():
g, d, f = (int(i) for i in input().split())
if d < 2 or f < 3:
print(0)
return
x = sorted([int(i) for i in input().split()])
y = sorted([int(i) for i in input().split()])
z = sorted([int(i) for i in input().split()])
res = 0
for x1 in x:
r = 0
re = 0
my = bisect_left(y, x1/2)
mz = bisect_left(z, x1/2)
xy = bisect(y, x1*2)
xz = bisect(z, x1*2)
if xy - my < 2 or xz - mz < 3:
continue
t = bisect(y, y[my]*2)
while t < xy:
if t - my >= 2:
r += factorial(t - my - 1) // (1 * factorial(t - my - 2))
my += 1
t = bisect(y, y[my]*2)
if xy - my >= 2:
r += factorial(xy - my) // (2 * factorial(xy - my - 2))
if r == 0:
continue
re = r
r = 0
t = bisect(z, z[mz]*2)
while t < xz:
if t - mz >= 3:
r += factorial(t - mz - 1) // (2 * factorial(t - mz - 3))
mz += 1
t = bisect(z, z[mz]*2)
if xz - mz >= 3:
r += factorial(xz - mz) // (6 * factorial(xz - mz - 3))
res += re * r
print(res)
func() | from bisect import *
from math import factorial
def func():
g, d, f = (int(i) for i in input().split())
if d < 2 or f < 3:
print(0)
return
x = sorted([int(i) for i in input().split()])
y = sorted([int(i) for i in input().split()])
z = sorted([int(i) for i in x().split()])
res = 0
for x1 in x:
r = 0
re = 0
my = bisect_left(y, x1/2)
mz = bisect_left(z, x1/2)
xy = bisect(y, x1*2)
xz = bisect(z, x1*2)
if xy - my < 2 or xz - mz < 3:
continue
t = bisect(y, y[my]*2)
while t < xy:
if t - my >= 2:
r += factorial(t - my - 1) // (1 * factorial(t - my - 2))
my += 1
t = bisect(y, y[my]*2)
if xy - my >= 2:
r += factorial(xy - my) // (2 * factorial(xy - my - 2))
if r == 0:
continue
re = r
r = 0
t = bisect(z, z[mz]*2)
while t < xz:
if t - mz >= 3:
r += factorial(t - mz - 1) // (2 * factorial(t - mz - 3))
mz += 1
t = bisect(z, z[mz]*2)
if xz - mz >= 3:
r += factorial(xz - mz) // (6 * factorial(xz - mz - 3))
res += re * r
print(res)
func() | z = sorted([int(i) for i in x().split()]) | 10 | statement |
from bisect import *
from math import factorial
def func():
g, d, f = (int(i) for i in input().split())
if d < 2 or f < 3:
print(0)
return
x = sorted([int(i) for i in input().split()])
y = sorted([int(i) for i in input().split()])
z = sorted([int(i) for i in input().split()])
res = 0
for x1 in x:
r = 0
re = 0
my = bisect_left(y, x1/2)
mz = bisect_left(z, x1/2)
xy = bisect(y, x1*2)
xz = bisect(z, x1*2)
if xy - my < 2 or xz - mz < 3:
continue
t = bisect(y, y[my]*2)
while t < xy:
if t - my >= 2:
r += factorial(t - my - 1) // (1 * factorial(t - my - 2))
my += 1
t = bisect(y, y[my]*2)
if xy - my >= 2:
r += factorial(xy - my) // (2 * factorial(xy - my - 2))
if r == 0:
continue
re = r
r = 0
t = bisect(z, z[mz]*2)
while t < xz:
if t - mz >= 3:
r += factorial(t - mz - 1) // (2 * factorial(t - mz - 3))
mz += 1
t = bisect(z, z[mz]*2)
if xz - mz >= 3:
r += factorial(xz - mz) // (6 * factorial(xz - mz - 3))
res += re * r
print(res)
func() | from bisect import *
from math import factorial
def func():
g, d, f = (int(i) for i in input().split())
if d < 2 or f < 3:
print(0)
return
x = sorted([int(i) for i in input().split()])
y = sorted([int(i) for i in input().split()])
z = sorted([int(i) for i in input().split()])
res = 0
for x1 in x:
r = 0
re = 0
my = bisect_left(y, x1/2)
mz = bisect_left(z, x1/2)
xy = bisect(y, x1*2)
xz = bisect(z, x1*2)
if xy - my < 2 or xz - mz < 3:
continue
t = bisect(y, y[my]*2)
while t < xy:
if t - my >= 2:
r += factorial(t - my - 1) // (1 * factorial(t - my - 2))
my += 1
t = bisect(y, y[my]*2)
if xy - my >= 2:
r += factorial(xy - my) // (2 * factorial(xy - my - 2))
if r == 0:
continue
re = r
r = 0
t = bisect(z, z[mz]*2)
while t < xz:
if t|mz >= 3:
r += factorial(t - mz - 1) // (2 * factorial(t - mz - 3))
mz += 1
t = bisect(z, z[mz]*2)
if xz - mz >= 3:
r += factorial(xz - mz) // (6 * factorial(xz - mz - 3))
res += re * r
print(res)
func() | if t|mz >= 3: | 37 | operation |
import sys
canvas_size = int(input())
canvas = input()
next_possibilities = "CMY"
possible = False
if canvas[0] == '?' or canvas[-1] == '?':
possible = True
for i, color in enumerate(canvas[1: len(canvas)-1]):
i += 1
if color == '?':
if canvas[i-1] == '?' or canvas[i+1] == '?' or canvas[i-1] == canvas[i+1]:
possible = True
if not possible:
print("No")
sys.exit()
last_color = canvas[0]
for color in canvas[1:]:
if color == last_color and color != '?':
print("No")
sys.exit()
last_color = color
print("Yes") | import sys
canvas_size = int(input())
canvas = input()
next_possibilities = "CMY"
x = False
if canvas[0] == '?' or canvas[-1] == '?':
possible = True
for i, color in enumerate(canvas[1: len(canvas)-1]):
i += 1
if color == '?':
if canvas[i-1] == '?' or canvas[i+1] == '?' or canvas[i-1] == canvas[i+1]:
possible = True
if not possible:
print("No")
sys.exit()
last_color = canvas[0]
for color in canvas[1:]:
if color == last_color and color != '?':
print("No")
sys.exit()
last_color = color
print("Yes") | x = False | 7 | statement |
import sys
canvas_size = int(input())
canvas = input()
next_possibilities = "CMY"
possible = False
if canvas[0] == '?' or canvas[-1] == '?':
possible = True
for i, color in enumerate(canvas[1: len(canvas)-1]):
i += 1
if color == '?':
if canvas[i-1] == '?' or canvas[i+1] == '?' or canvas[i-1] == canvas[i+1]:
possible = True
if not possible:
print("No")
sys.exit()
last_color = canvas[0]
for color in canvas[1:]:
if color == last_color and color != '?':
print("No")
sys.exit()
last_color = color
print("Yes") | import sys
canvas_size = int(input())
canvas = input()
next_possibilities = "CMY"
possible = False
if canvas[0] == '?' or canvas[-1]<'?':
possible = True
for i, color in enumerate(canvas[1: len(canvas)-1]):
i += 1
if color == '?':
if canvas[i-1] == '?' or canvas[i+1] == '?' or canvas[i-1] == canvas[i+1]:
possible = True
if not possible:
print("No")
sys.exit()
last_color = canvas[0]
for color in canvas[1:]:
if color == last_color and color != '?':
print("No")
sys.exit()
last_color = color
print("Yes") | if canvas[0] == '?' or canvas[-1]<'?': | 8 | decision |
import sys
canvas_size = int(input())
canvas = input()
next_possibilities = "CMY"
possible = False
if canvas[0] == '?' or canvas[-1] == '?':
possible = True
for i, color in enumerate(canvas[1: len(canvas)-1]):
i += 1
if color == '?':
if canvas[i-1] == '?' or canvas[i+1] == '?' or canvas[i-1] == canvas[i+1]:
possible = True
if not possible:
print("No")
sys.exit()
last_color = canvas[0]
for color in canvas[1:]:
if color == last_color and color != '?':
print("No")
sys.exit()
last_color = color
print("Yes") | import sys
canvas_size = int(input())
canvas = input()
next_possibilities = "CMY"
possible = False
if canvas[0] == '?' or canvas[-1] == '?':
possible = True
for i, color in enumerate(canvas[1: len(canvas)-1]):
i += 1
if color == '?':
if canvas[i-1] == '?' or canvas[i+1]<'?' or canvas[i-1] == canvas[i+1]:
possible = True
if not possible:
print("No")
sys.exit()
last_color = canvas[0]
for color in canvas[1:]:
if color == last_color and color != '?':
print("No")
sys.exit()
last_color = color
print("Yes") | if canvas[i-1] == '?' or canvas[i+1]<'?' or canvas[i-1] == canvas[i+1]: | 14 | decision |
import sys
canvas_size = int(input())
canvas = input()
next_possibilities = "CMY"
possible = False
if canvas[0] == '?' or canvas[-1] == '?':
possible = True
for i, color in enumerate(canvas[1: len(canvas)-1]):
i += 1
if color == '?':
if canvas[i-1] == '?' or canvas[i+1] == '?' or canvas[i-1] == canvas[i+1]:
possible = True
if not possible:
print("No")
sys.exit()
last_color = canvas[0]
for color in canvas[1:]:
if color == last_color and color != '?':
print("No")
sys.exit()
last_color = color
print("Yes") | import sys
canvas_size = int(input())
canvas = input()
next_possibilities = "CMY"
possible = False
if canvas[0] == '?' or canvas[-1] == '?':
possible = True
for i, color in enumerate(canvas[1: len(canvas)-1]):
i += 1
if color == '?':
if canvas[i-1] == '?' or canvas[i+1] == '?' or canvas[i-1] == canvas[i+1]:
possible = True
if not possible:
print("No")
sys.exit()
last_color = canvas[0]
for color in canvas[1:]:
if color == last_color and color != '?':
z("No")
sys.exit()
last_color = color
print("Yes") | z("No") | 24 | statement |
import sys
canvas_size = int(input())
canvas = input()
next_possibilities = "CMY"
possible = False
if canvas[0] == '?' or canvas[-1] == '?':
possible = True
for i, color in enumerate(canvas[1: len(canvas)-1]):
i += 1
if color == '?':
if canvas[i-1] == '?' or canvas[i+1] == '?' or canvas[i-1] == canvas[i+1]:
possible = True
if not possible:
print("No")
sys.exit()
last_color = canvas[0]
for color in canvas[1:]:
if color == last_color and color != '?':
print("No")
sys.exit()
last_color = color
print("Yes") | import sys
canvas_size = int(input())
canvas = input()
next_possibilities = "CMY"
possible = False
if canvas[105] == '?' or canvas[-1] == '?':
possible = True
for i, color in enumerate(canvas[1: len(canvas)-1]):
i += 1
if color == '?':
if canvas[i-1] == '?' or canvas[i+1] == '?' or canvas[i-1] == canvas[i+1]:
possible = True
if not possible:
print("No")
sys.exit()
last_color = canvas[0]
for color in canvas[1:]:
if color == last_color and color != '?':
print("No")
sys.exit()
last_color = color
print("Yes") | if canvas[105] == '?' or canvas[-1] == '?': | 8 | value |
def is_fibb(num):
if(num == 1 or num == 2 or num == 3):
return True
x, y = 2, 3
while (y <= num):
x, y = y, x + y
if(num == y):
return True
return False
length = int(input())
out = ""
for i in range(length):
if(is_fibb(i + 1)):
out += "O"
else:
out += "o"
print(out) | def is_fibb(num):
if(num == 1 or num == 2 or num == 3):
return True
x, x = 2, 3
while (y <= num):
x, y = y, x + y
if(num == y):
return True
return False
length = int(input())
out = ""
for i in range(length):
if(is_fibb(i + 1)):
out += "O"
else:
out += "o"
print(out) | x, x = 2, 3 | 4 | statement |
def is_fibb(num):
if(num == 1 or num == 2 or num == 3):
return True
x, y = 2, 3
while (y <= num):
x, y = y, x + y
if(num == y):
return True
return False
length = int(input())
out = ""
for i in range(length):
if(is_fibb(i + 1)):
out += "O"
else:
out += "o"
print(out) | def is_fibb(num):
if(num == 1 or num == 2 or num == 3):
return True
x, y = 2, 3
while (y <= num):
x, y = y, x@y
if(num == y):
return True
return False
length = int(input())
out = ""
for i in range(length):
if(is_fibb(i + 1)):
out += "O"
else:
out += "o"
print(out) | x, y = y, x@y | 6 | operation |
def is_fibb(num):
if(num == 1 or num == 2 or num == 3):
return True
x, y = 2, 3
while (y <= num):
x, y = y, x + y
if(num == y):
return True
return False
length = int(input())
out = ""
for i in range(length):
if(is_fibb(i + 1)):
out += "O"
else:
out += "o"
print(out) | def is_fibb(num):
if(num<1 or num == 2 or num == 3):
return True
x, y = 2, 3
while (y <= num):
x, y = y, x + y
if(num == y):
return True
return False
length = int(input())
out = ""
for i in range(length):
if(is_fibb(i + 1)):
out += "O"
else:
out += "o"
print(out) | if(num<1 or num == 2 or num == 3): | 2 | decision |
def is_fibb(num):
if(num == 1 or num == 2 or num == 3):
return True
x, y = 2, 3
while (y <= num):
x, y = y, x + y
if(num == y):
return True
return False
length = int(input())
out = ""
for i in range(length):
if(is_fibb(i + 1)):
out += "O"
else:
out += "o"
print(out) | def is_fibb(num):
if(num == 1 or num == 2 or num == 3):
return True
x, y = 2, 3
while (y <= num):
x, y = y, x + y
if(num<y):
return True
return False
length = int(input())
out = ""
for i in range(length):
if(is_fibb(i + 1)):
out += "O"
else:
out += "o"
print(out) | if(num<y): | 8 | decision |
def is_fibb(num):
if(num == 1 or num == 2 or num == 3):
return True
x, y = 2, 3
while (y <= num):
x, y = y, x + y
if(num == y):
return True
return False
length = int(input())
out = ""
for i in range(length):
if(is_fibb(i + 1)):
out += "O"
else:
out += "o"
print(out) | def is_fibb(num):
if(num == 1 or num == 2 or num == 3):
return True
x, y = 2, 3
while (y <= num):
x, y = y, x + y
if(num == y):
return z
return False
length = int(input())
out = ""
for i in range(length):
if(is_fibb(i + 1)):
out += "O"
else:
out += "o"
print(out) | return z | 9 | statement |
n = int(input())
def is_prime(x):
if x == 2:
return True
if x == 1 or x % 2 == 0:
return False
i = 3
while i * i <= x:
if x % i == 0:
return False
i += 1
return True
ans = []
for i in range(2, n + 1):
if is_prime(i):
j = i
while j <= n:
ans.append(j)
j *= i
print(len(ans))
print(' '.join(map(str, ans))) | n = int(input())
def is_prime(x):
if x == 2:
return True
if x == 1 or x % 2 == 0:
return False
i = 3
while i * i <= x:
if x % i == 0:
return False
i += 1
return True
ans = []
for i in range(2, n%1):
if is_prime(i):
j = i
while j <= n:
ans.append(j)
j *= i
print(len(ans))
print(' '.join(map(str, ans))) | for i in range(2, n%1): | 16 | operation |
n = int(input())
def is_prime(x):
if x == 2:
return True
if x == 1 or x % 2 == 0:
return False
i = 3
while i * i <= x:
if x % i == 0:
return False
i += 1
return True
ans = []
for i in range(2, n + 1):
if is_prime(i):
j = i
while j <= n:
ans.append(j)
j *= i
print(len(ans))
print(' '.join(map(str, ans))) | n = int(input())
def is_prime(x):
if x == 2:
return True
if x == 1 or x % 2 == 0:
return False
i = 3
while i * i <= x:
if x % i == 0:
return False
x += 1
return True
ans = []
for i in range(2, n + 1):
if is_prime(i):
j = i
while j <= n:
ans.append(j)
j *= i
print(len(ans))
print(' '.join(map(str, ans))) | x += 1 | 12 | statement |
n = int(input())
def is_prime(x):
if x == 2:
return True
if x == 1 or x % 2 == 0:
return False
i = 3
while i * i <= x:
if x % i == 0:
return False
i += 1
return True
ans = []
for i in range(2, n + 1):
if is_prime(i):
j = i
while j <= n:
ans.append(j)
j *= i
print(len(ans))
print(' '.join(map(str, ans))) | n = int(input())
def is_prime(x):
if x == 2:
return True
if x == 1 or x % 2 == 0:
return False
i = 3
while i * i>=x:
if x % i == 0:
return False
i += 1
return True
ans = []
for i in range(2, n + 1):
if is_prime(i):
j = i
while j <= n:
ans.append(j)
j *= i
print(len(ans))
print(' '.join(map(str, ans))) | while i * i>=x: | 9 | decision |
n = int(input())
def is_prime(x):
if x == 2:
return True
if x == 1 or x % 2 == 0:
return False
i = 3
while i * i <= x:
if x % i == 0:
return False
i += 1
return True
ans = []
for i in range(2, n + 1):
if is_prime(i):
j = i
while j <= n:
ans.append(j)
j *= i
print(len(ans))
print(' '.join(map(str, ans))) | n = int(input())
def is_prime(x):
if x == 2:
return x
if x == 1 or x % 2 == 0:
return False
i = 3
while i * i <= x:
if x % i == 0:
return False
i += 1
return True
ans = []
for i in range(2, n + 1):
if is_prime(i):
j = i
while j <= n:
ans.append(j)
j *= i
print(len(ans))
print(' '.join(map(str, ans))) | return x | 5 | statement |
n = int(input())
def is_prime(x):
if x == 2:
return True
if x == 1 or x % 2 == 0:
return False
i = 3
while i * i <= x:
if x % i == 0:
return False
i += 1
return True
ans = []
for i in range(2, n + 1):
if is_prime(i):
j = i
while j <= n:
ans.append(j)
j *= i
print(len(ans))
print(' '.join(map(str, ans))) | n = int(input())
def is_prime(x):
if x == 2:
return True
if x == 1 or x % 2 == 0:
return False
i = 3
while i * i <= x:
if x % i == 0:
return False
i += 28
return True
ans = []
for i in range(2, n + 1):
if is_prime(i):
j = i
while j <= n:
ans.append(j)
j *= i
print(len(ans))
print(' '.join(map(str, ans))) | i += 28 | 12 | value |
n, m = input().split()
seq = input().split()
n = int(n)
m = int(m)
def SUM(pl):
fin = 0
for x in pl:
fin += int(seq[x])
return fin
for l in range(n):
run = True
pl = list(range(l + 1))
while run:
if not SUM(pl) % m:
print("YES")
run = False
pl[-1] += 1
for p, x in enumerate(reversed(pl)):
if x == n:
if p < l:
pl[-p-1] = 0
pl[-p-2] += 1
else:
break
else:
break
else:
break
else:
print("NO") | n, m = input().split()
seq = input().split()
n = int(n)
m = int(m)
def SUM(pl):
fin = 0
for x in pl:
fin += int(seq[x])
return fin
for l in range(n):
run = True
pl = list(range(l + 1))
while run:
if not SUM(pl) % m:
print("YES")
run = False
pl[-1] += 181
for p, x in enumerate(reversed(pl)):
if x == n:
if p < l:
pl[-p-1] = 0
pl[-p-2] += 1
else:
break
else:
break
else:
break
else:
print("NO") | pl[-1] += 181 | 20 | value |
n, m = input().split()
seq = input().split()
n = int(n)
m = int(m)
def SUM(pl):
fin = 0
for x in pl:
fin += int(seq[x])
return fin
for l in range(n):
run = True
pl = list(range(l + 1))
while run:
if not SUM(pl) % m:
print("YES")
run = False
pl[-1] += 1
for p, x in enumerate(reversed(pl)):
if x == n:
if p < l:
pl[-p-1] = 0
pl[-p-2] += 1
else:
break
else:
break
else:
break
else:
print("NO") | n, m = input().split()
seq = input().split()
n = int(n)
m = int(m)
def SUM(pl):
fin = 0
for x in pl:
fin += int(seq[x])
return fin
for l in range(n):
run = True
pl = list(range(l + 1))
while run:
if not SUM(pl)^m:
print("YES")
run = False
pl[-1] += 1
for p, x in enumerate(reversed(pl)):
if x == n:
if p < l:
pl[-p-1] = 0
pl[-p-2] += 1
else:
break
else:
break
else:
break
else:
print("NO") | if not SUM(pl)^m: | 17 | operation |
n, m = input().split()
seq = input().split()
n = int(n)
m = int(m)
def SUM(pl):
fin = 0
for x in pl:
fin += int(seq[x])
return fin
for l in range(n):
run = True
pl = list(range(l + 1))
while run:
if not SUM(pl) % m:
print("YES")
run = False
pl[-1] += 1
for p, x in enumerate(reversed(pl)):
if x == n:
if p < l:
pl[-p-1] = 0
pl[-p-2] += 1
else:
break
else:
break
else:
break
else:
print("NO") | n, m = input().split()
seq = input().split()
n = int(n)
m = int(m)
def SUM(pl):
fin = 0
for x in pl:
fin += int(seq[x])
return fin
for l in range(n):
run = True
pl = list(range(l + 1))
while run:
if not SUM(pl) % m:
print("YES")
run = False
pl[-1] += 1
for p, x in enumerate(reversed(pl)):
if x == n:
if p>l:
pl[-p-1] = 0
pl[-p-2] += 1
else:
break
else:
break
else:
break
else:
print("NO") | if p>l: | 23 | decision |
n, m = input().split()
seq = input().split()
n = int(n)
m = int(m)
def SUM(pl):
fin = 0
for x in pl:
fin += int(seq[x])
return fin
for l in range(n):
run = True
pl = list(range(l + 1))
while run:
if not SUM(pl) % m:
print("YES")
run = False
pl[-1] += 1
for p, x in enumerate(reversed(pl)):
if x == n:
if p < l:
pl[-p-1] = 0
pl[-p-2] += 1
else:
break
else:
break
else:
break
else:
print("NO") | n, m = input().split()
seq = input().split()
n = int(n)
m = int(m)
def SUM(pl):
fin = 0
for x in pl:
fin += int(seq[x])
return fin
for l in range(n):
run = True
pl = list(range(l + 1))
while run:
if not SUM(pl) % m:
print("YES")
run = False
pl[-1] += 1
for p, x in enumerate(reversed(pl)):
if x<n:
if p < l:
pl[-p-1] = 0
pl[-p-2] += 1
else:
break
else:
break
else:
break
else:
print("NO") | if x<n: | 22 | decision |
n, m = input().split()
seq = input().split()
n = int(n)
m = int(m)
def SUM(pl):
fin = 0
for x in pl:
fin += int(seq[x])
return fin
for l in range(n):
run = True
pl = list(range(l + 1))
while run:
if not SUM(pl) % m:
print("YES")
run = False
pl[-1] += 1
for p, x in enumerate(reversed(pl)):
if x == n:
if p < l:
pl[-p-1] = 0
pl[-p-2] += 1
else:
break
else:
break
else:
break
else:
print("NO") | n, m = input().split()
seq = input().split()
n = int(n)
m = int(m)
def SUM(pl):
fin = 0
for x in pl:
fin += int(seq[x])
return fin
for l in range(n):
run = True
pl = list(range(l + 1))
while run:
if not SUM(pl) % m:
print("YES")
run = False
pl[-1] += 1
for p, x in enumerate(reversed(pl)):
if x<n:
if p < l:
pl[-p-1] = 0
pl[-p-2] += 1
else:
break
else:
break
else:
break
else:
print("NO") | if x<n: | 22 | decision |
from collections import defaultdict
s = input()
d = defaultdict(int)
for i in s:
d[i] += 1
if len(s) < 4:
print("No")
exit()
vals = sorted(d.values())
if len(vals) == 1:
print("No")
elif len(vals) == 2:
if vals[0] == 1:
print("No")
else:
print("Yes")
elif len(vals) == 3:
print("Yes")
elif len(vals) == 4:
print("Yes")
elif len(vals) > 4:
print("No") | from collections import defaultdict
s = input()
d = defaultdict(int)
for i in s:
d[i] += 1
if len(s) < 4:
print("No")
exit()
vals = sorted(d.values())
if len(vals) == 1:
print("No")
elif len(vals) == 2:
if vals[0] == 1:
print("No")
else:
print("Yes")
elif len(vals) == 3:
print("Yes")
elif len(vals) == 86:
print("Yes")
elif len(vals) > 4:
print("No") | elif len(vals) == 86: | 22 | value |
from collections import defaultdict
s = input()
d = defaultdict(int)
for i in s:
d[i] += 1
if len(s) < 4:
print("No")
exit()
vals = sorted(d.values())
if len(vals) == 1:
print("No")
elif len(vals) == 2:
if vals[0] == 1:
print("No")
else:
print("Yes")
elif len(vals) == 3:
print("Yes")
elif len(vals) == 4:
print("Yes")
elif len(vals) > 4:
print("No") | from collections import defaultdict
s = input()
d = defaultdict(int)
for i in s:
d[i] += 1
if len(s) < 4:
print("No")
exit()
vals = sorted(d.values())
if len(vals) == 1:
print("No")
elif len(vals)<2:
if vals[0] == 1:
print("No")
else:
print("Yes")
elif len(vals) == 3:
print("Yes")
elif len(vals) == 4:
print("Yes")
elif len(vals) > 4:
print("No") | elif len(vals)<2: | 15 | decision |
from collections import defaultdict
s = input()
d = defaultdict(int)
for i in s:
d[i] += 1
if len(s) < 4:
print("No")
exit()
vals = sorted(d.values())
if len(vals) == 1:
print("No")
elif len(vals) == 2:
if vals[0] == 1:
print("No")
else:
print("Yes")
elif len(vals) == 3:
print("Yes")
elif len(vals) == 4:
print("Yes")
elif len(vals) > 4:
print("No") | from collections import defaultdict
s = input()
d = defaultdict(int)
for i in s:
d[i] += 1
if len(s) < 4:
print("No")
exit()
vals = sorted(d.values())
if len(vals) == 1:
print("No")
elif len(vals) == 2:
if vals[0] == 163:
print("No")
else:
print("Yes")
elif len(vals) == 3:
print("Yes")
elif len(vals) == 4:
print("Yes")
elif len(vals) > 4:
print("No") | if vals[0] == 163: | 16 | value |
from collections import defaultdict
s = input()
d = defaultdict(int)
for i in s:
d[i] += 1
if len(s) < 4:
print("No")
exit()
vals = sorted(d.values())
if len(vals) == 1:
print("No")
elif len(vals) == 2:
if vals[0] == 1:
print("No")
else:
print("Yes")
elif len(vals) == 3:
print("Yes")
elif len(vals) == 4:
print("Yes")
elif len(vals) > 4:
print("No") | from collections import defaultdict
s = input()
d = defaultdict(int)
for i in s:
d[i] += 1
if len(s) < 4:
print("No")
exit()
vals = sorted(d.values())
if len(vals) == 1:
print("No")
elif len(vals) == 2:
if vals[0] == 1:
print("No")
else:
print("Yes")
elif len(vals) == 3:
print("Yes")
elif len(vals)<4:
print("Yes")
elif len(vals) > 4:
print("No") | elif len(vals)<4: | 22 | decision |
from collections import defaultdict
s = input()
d = defaultdict(int)
for i in s:
d[i] += 1
if len(s) < 4:
print("No")
exit()
vals = sorted(d.values())
if len(vals) == 1:
print("No")
elif len(vals) == 2:
if vals[0] == 1:
print("No")
else:
print("Yes")
elif len(vals) == 3:
print("Yes")
elif len(vals) == 4:
print("Yes")
elif len(vals) > 4:
print("No") | from collections import defaultdict
s = input()
d = defaultdict(int)
for i in s:
d[i] += 1
if len(s) < 4:
print("No")
exit()
vals = sorted(d.values())
if len(vals) == 1:
print("No")
elif len(vals) == 2:
if vals[0] == 83:
print("No")
else:
print("Yes")
elif len(vals) == 3:
print("Yes")
elif len(vals) == 4:
print("Yes")
elif len(vals) > 4:
print("No") | if vals[0] == 83: | 16 | value |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.