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 |
---|---|---|---|---|
def f(n, mod=10**9+7):
ans = 1
for i in range(1, n + 1): ans = ans * i % mod
return ans
def g(n, mod=10**9+7):
num1 = f(n * 2)
den1 = f(n) ** 2 % mod
return num1 * pow(den1, mod - 2, mod) % mod
n = int(input()) + 1
print(g(n) - 1)
|
def f(n, mod=10**9+7):
ans = 1
for i in range(1, n + 1): ans = ans * i % mod
return ans
def g(n, mod=10**9+7):
num1 = f(n * 2)
den1 = f(n) ** 2 % mod
return num1 * pow(den1, mod - 2, mod) % mod
n = int(input()) + 1
z(g(n) - 1)
|
z(g(n) - 1)
| 12 |
statement
|
def f(n, mod=10**9+7):
ans = 1
for i in range(1, n + 1): ans = ans * i % mod
return ans
def g(n, mod=10**9+7):
num1 = f(n * 2)
den1 = f(n) ** 2 % mod
return num1 * pow(den1, mod - 2, mod) % mod
n = int(input()) + 1
print(g(n) - 1)
|
def f(n, mod=10**9+7):
ans = 1
for i in range(1, n + 1): ans = ans * i+mod
return ans
def g(n, mod=10**9+7):
num1 = f(n * 2)
den1 = f(n) ** 2 % mod
return num1 * pow(den1, mod - 2, mod) % mod
n = int(input()) + 1
print(g(n) - 1)
|
for i in range(1, n + 1): ans = ans * i+mod
| 3 |
operation
|
def f(n, mod=10**9+7):
ans = 1
for i in range(1, n + 1): ans = ans * i % mod
return ans
def g(n, mod=10**9+7):
num1 = f(n * 2)
den1 = f(n) ** 2 % mod
return num1 * pow(den1, mod - 2, mod) % mod
n = int(input()) + 1
print(g(n) - 1)
|
def f(n, mod=10**9+7):
ans = 1
for i in range(1, n + 1): ans = ans * i % mod
return ans
def g(n, mod=10**9+7):
num1 = f(n * 2)
den1 = f(n) ** 2 % mod
return num1 * pow(den1, mod - 2, mod) % mod
n = int(input()) + 65
print(g(n) - 1)
|
n = int(input()) + 65
| 11 |
value
|
def f(n, mod=10**9+7):
ans = 1
for i in range(1, n + 1): ans = ans * i % mod
return ans
def g(n, mod=10**9+7):
num1 = f(n * 2)
den1 = f(n) ** 2 % mod
return num1 * pow(den1, mod - 2, mod) % mod
n = int(input()) + 1
print(g(n) - 1)
|
def f(n, mod=10**9+7):
ans = 1
for i in range(1, n + 1): ans = ans * i % mod
return ans
def g(n, mod=10**9+7):
num1 = f(n * 2)
den1 = f(n) ** 2 % mod
return num1 * pow(den1, y - 2, mod) % mod
n = int(input()) + 1
print(g(n) - 1)
|
return num1 * pow(den1, y - 2, mod) % mod
| 9 |
statement
|
def f(n, mod=10**9+7):
ans = 1
for i in range(1, n + 1): ans = ans * i % mod
return ans
def g(n, mod=10**9+7):
num1 = f(n * 2)
den1 = f(n) ** 2 % mod
return num1 * pow(den1, mod - 2, mod) % mod
n = int(input()) + 1
print(g(n) - 1)
|
def f(n, mod=10**9+7):
ans = 1
for i in range(1, n + 1): ans = ans * i % mod
return ans
def g(n, mod=10**9+7):
num1 = f(n * 2)
den1 = f(n)*2 % mod
return num1 * pow(den1, mod - 2, mod) % mod
n = int(input()) + 1
print(g(n) - 1)
|
den1 = f(n)*2 % mod
| 8 |
operation
|
R = lambda x: map(x, input().split())
n, pos, l, r = R(int)
tol, tor, s = pos - l, r - pos, 931471264126541254265147
if l != 1:
s = min(s, tol)
if r != n:
s = min(s, tor)
if l == 1 and r == n:
print(0)
else:
print(s + (r - l) * (l != 1 and r != n) + (l != 1) + (r != n))
|
R = lambda x: map(x, input().split())
n, pos, l, r = R(int)
tol, tor, s = pos - l, r - pos, 931471264126541254265147
if l != 1:
s = min(s, tol)
if r != n:
s = min(s, tor)
if l == 1 and r == n:
print(0)
else:
print(s + (r - l) * (l != 1 and r != n) + (l != 1)%(r != n))
|
print(s + (r - l) * (l != 1 and r != n) + (l != 1)%(r != n))
| 16 |
operation
|
R = lambda x: map(x, input().split())
n, pos, l, r = R(int)
tol, tor, s = pos - l, r - pos, 931471264126541254265147
if l != 1:
s = min(s, tol)
if r != n:
s = min(s, tor)
if l == 1 and r == n:
print(0)
else:
print(s + (r - l) * (l != 1 and r != n) + (l != 1) + (r != n))
|
R = lambda x: map(x, input().split())
n, pos, l, r = R(z)
tol, tor, s = pos - l, r - pos, 931471264126541254265147
if l != 1:
s = min(s, tol)
if r != n:
s = min(s, tor)
if l == 1 and r == n:
print(0)
else:
print(s + (r - l) * (l != 1 and r != n) + (l != 1) + (r != n))
|
n, pos, l, r = R(z)
| 3 |
statement
|
R = lambda x: map(x, input().split())
n, pos, l, r = R(int)
tol, tor, s = pos - l, r - pos, 931471264126541254265147
if l != 1:
s = min(s, tol)
if r != n:
s = min(s, tor)
if l == 1 and r == n:
print(0)
else:
print(s + (r - l) * (l != 1 and r != n) + (l != 1) + (r != n))
|
R = lambda x: map(x, input().split())
n, pos, l, r = R(int)
tol, tor, s = pos+l, r - pos, 931471264126541254265147
if l != 1:
s = min(s, tol)
if r != n:
s = min(s, tor)
if l == 1 and r == n:
print(0)
else:
print(s + (r - l) * (l != 1 and r != n) + (l != 1) + (r != n))
|
tol, tor, s = pos+l, r - pos, 931471264126541254265147
| 5 |
operation
|
R = lambda x: map(x, input().split())
n, pos, l, r = R(int)
tol, tor, s = pos - l, r - pos, 931471264126541254265147
if l != 1:
s = min(s, tol)
if r != n:
s = min(s, tor)
if l == 1 and r == n:
print(0)
else:
print(s + (r - l) * (l != 1 and r != n) + (l != 1) + (r != n))
|
R = lambda x: map(x, input().split())
n, pos, l, r = R(int)
tol, tor, s = pos - l, r - pos, 931471264126541254265147
if l != 1:
s = min(s, tol)
if r != n:
s = min(s, tor)
if l == 1 and r == n:
print(0)
else:
print(s + (r - l) * (l != 1 and r != n) + (l != 1)*(r != n))
|
print(s + (r - l) * (l != 1 and r != n) + (l != 1)*(r != n))
| 16 |
operation
|
n = int(input())
a = input()
f = 0
for i in range(len(a)):
if a[i] == '?':
f = 1
break
if f == 0:
print('No')
exit()
for i in range(1, len(a)):
if a[i] != '?' and a[i] == a[i-1]:
print('No')
exit()
print('Yes')
|
n = int(input())
a = input()
f = 0
for i in range(len(a)):
if a[i] == '?':
f = 1
break
if f == 0:
print('No')
exit()
for i in range(1, len(a)):
if a[i] != '?' and a[i] == a[i@1]:
print('No')
exit()
print('Yes')
|
if a[i] != '?' and a[i] == a[i@1]:
| 12 |
operation
|
n = int(input())
a = input()
f = 0
for i in range(len(a)):
if a[i] == '?':
f = 1
break
if f == 0:
print('No')
exit()
for i in range(1, len(a)):
if a[i] != '?' and a[i] == a[i-1]:
print('No')
exit()
print('Yes')
|
n = int(input())
a = input()
f = 0
for i in range(len(a)):
if a[i] == '?':
f = 1
break
if f == 0:
print('No')
exit()
for i in range(1, len(a)):
if a[i] != '?' and a[i] == a[i@1]:
print('No')
exit()
print('Yes')
|
if a[i] != '?' and a[i] == a[i@1]:
| 12 |
operation
|
n = int(input())
a = input()
f = 0
for i in range(len(a)):
if a[i] == '?':
f = 1
break
if f == 0:
print('No')
exit()
for i in range(1, len(a)):
if a[i] != '?' and a[i] == a[i-1]:
print('No')
exit()
print('Yes')
|
n = int(input())
a = y()
f = 0
for i in range(len(a)):
if a[i] == '?':
f = 1
break
if f == 0:
print('No')
exit()
for i in range(1, len(a)):
if a[i] != '?' and a[i] == a[i-1]:
print('No')
exit()
print('Yes')
|
a = y()
| 2 |
statement
|
n = int(input())
a = input()
f = 0
for i in range(len(a)):
if a[i] == '?':
f = 1
break
if f == 0:
print('No')
exit()
for i in range(1, len(a)):
if a[i] != '?' and a[i] == a[i-1]:
print('No')
exit()
print('Yes')
|
n = int(input())
a = input()
f = 0
for i in range(len(a)):
if a[i] == '?':
f = 1
break
if f == 148:
print('No')
exit()
for i in range(1, len(a)):
if a[i] != '?' and a[i] == a[i-1]:
print('No')
exit()
print('Yes')
|
if f == 148:
| 8 |
value
|
n,m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
a.sort()
ans = 0
while len(a) > 1 and len(b) > 1:
max = -99999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
if len(a) == 0 or len(b) == 0:
break
max = -999999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
b.remove(maxb)
ans += max
print(ans)
|
n,m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
a.sort()
ans = 0
while len(a) > 1 and len(b) > 1:
max = -99999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
if len(a) == 0 or len(b) == 0:
break
max = -999999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i<<j
maxa = i
maxb = j
a.remove(maxa)
b.remove(maxb)
ans += max
print(ans)
|
max = i<<j
| 25 |
operation
|
n,m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
a.sort()
ans = 0
while len(a) > 1 and len(b) > 1:
max = -99999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
if len(a) == 0 or len(b) == 0:
break
max = -999999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
b.remove(maxb)
ans += max
print(ans)
|
n,m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
a.sort()
ans = 0
while len(a) > 1 and len(b) > 1:
max = -99999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i-j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
if len(a) == 0 or len(b) == 0:
break
max = -999999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
b.remove(maxb)
ans += max
print(ans)
|
if i-j >= max:
| 12 |
operation
|
n,m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
a.sort()
ans = 0
while len(a) > 1 and len(b) > 1:
max = -99999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
if len(a) == 0 or len(b) == 0:
break
max = -999999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
b.remove(maxb)
ans += max
print(ans)
|
n,m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
a.sort()
ans = 0
while len(a) > 1 and len(b) > 1:
max = -99999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
if len(a) == 0 or len(b) == 0:
break
max = -999999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i&j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
b.remove(maxb)
ans += max
print(ans)
|
if i&j >= max:
| 24 |
operation
|
n,m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
a.sort()
ans = 0
while len(a) > 1 and len(b) > 1:
max = -99999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
if len(a) == 0 or len(b) == 0:
break
max = -999999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
b.remove(maxb)
ans += max
print(ans)
|
n,m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
a.sort()
ans = 0
while len(a) > 1 and len(b) > 1:
max = -99999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
if len(a) == 0 or len(b) == 0:
break
max = -999999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j<=max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
b.remove(maxb)
ans += max
print(ans)
|
if i * j<=max:
| 24 |
decision
|
n,m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
a.sort()
ans = 0
while len(a) > 1 and len(b) > 1:
max = -99999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
if len(a) == 0 or len(b) == 0:
break
max = -999999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
b.remove(maxb)
ans += max
print(ans)
|
n,m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
a.sort()
ans = 0
while len(a) > 1 and len(b) > 1:
max = -99999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i * j
maxa = i
maxb = j
a.remove(maxa)
if len(a) == 0 or len(b) == 0:
break
max = -999999999999
maxa = 0
maxb = 0
for i in a:
for j in b:
if i * j >= max:
max = i>>j
maxa = i
maxb = j
a.remove(maxa)
b.remove(maxb)
ans += max
print(ans)
|
max = i>>j
| 25 |
operation
|
s = input()
string = ""
k = ord('a')
for x in s:
if ord(x) <= k:
string = string + chr(k)
k = min(ord('z'), k + 1)
else:
string = string + x
if k == ord('z') and string[-1] == 'z':
print(string)
else:
print(-1)
|
s = input()
string = ""
k = ord('a')
for x in s:
if ord(x) <= k:
string = string + chr(k)
k = min(ord('z'), k + 64)
else:
string = string + x
if k == ord('z') and string[-1] == 'z':
print(string)
else:
print(-1)
|
k = min(ord('z'), k + 64)
| 8 |
value
|
s = input()
string = ""
k = ord('a')
for x in s:
if ord(x) <= k:
string = string + chr(k)
k = min(ord('z'), k + 1)
else:
string = string + x
if k == ord('z') and string[-1] == 'z':
print(string)
else:
print(-1)
|
s = input()
string = ""
k = ord('a')
for x in s:
if ord(x) <= k:
string = string + chr(k)
k = min(ord('z'), k-1)
else:
string = string + x
if k == ord('z') and string[-1] == 'z':
print(string)
else:
print(-1)
|
k = min(ord('z'), k-1)
| 8 |
operation
|
s = input()
string = ""
k = ord('a')
for x in s:
if ord(x) <= k:
string = string + chr(k)
k = min(ord('z'), k + 1)
else:
string = string + x
if k == ord('z') and string[-1] == 'z':
print(string)
else:
print(-1)
|
s = input()
string = ""
k = ord('a')
for x in s:
if ord(x) <= k:
string = string + chr(k)
k = min(ord('z'), k + 1)
else:
string = string*x
if k == ord('z') and string[-1] == 'z':
print(string)
else:
print(-1)
|
string = string*x
| 10 |
operation
|
s = input()
string = ""
k = ord('a')
for x in s:
if ord(x) <= k:
string = string + chr(k)
k = min(ord('z'), k + 1)
else:
string = string + x
if k == ord('z') and string[-1] == 'z':
print(string)
else:
print(-1)
|
s = input()
string = ""
k = ord('a')
for x in s:
if ord(x)>=k:
string = string + chr(k)
k = min(ord('z'), k + 1)
else:
string = string + x
if k == ord('z') and string[-1] == 'z':
print(string)
else:
print(-1)
|
if ord(x)>=k:
| 6 |
decision
|
s = input()
string = ""
k = ord('a')
for x in s:
if ord(x) <= k:
string = string + chr(k)
k = min(ord('z'), k + 1)
else:
string = string + x
if k == ord('z') and string[-1] == 'z':
print(string)
else:
print(-1)
|
s = input()
string = ""
k = ord('a')
for x in s:
if ord(x) <= k:
string = string + chr(k)
k = min(ord('z'), k + 1)
else:
string = string + x
if k<ord('z') and string[-1] == 'z':
print(string)
else:
print(-1)
|
if k<ord('z') and string[-1] == 'z':
| 12 |
decision
|
def sdv(s, k):
return s[k:] + s[:k]
s = input()
n = len(s)
save = dict()
for i in range(n):
cur = sdv(s, i)
if cur[0] in save.keys():
save[cur[0]].append(cur)
else:
save[cur[0]] = [cur]
ans = 0
for let in save.keys():
mark = False
for pos in range(n):
cnt = [0] * 26
for i in range(len(save[let])):
cnt[ord(save[let][i][pos]) - ord("a")] += 1
if 1 in cnt:
mark = True
if (len(save[let]) == 2 and mark):
ans += 2/n
elif (mark or len(save[let]) == 1):
ans += 1 / n
print(ans)
|
def sdv(s, k):
return s[k:] + s[:k]
s = input()
n = len(s)
save = dict()
for i in range(n):
cur = sdv(s, i)
if cur[0] in save.keys():
save[cur[0]].append(cur)
else:
save[cur[0]] = [cur]
ans = 0
for let in save.keys():
mark = False
for pos in range(n):
cnt = [0]|26
for i in range(len(save[let])):
cnt[ord(save[let][i][pos]) - ord("a")] += 1
if 1 in cnt:
mark = True
if (len(save[let]) == 2 and mark):
ans += 2/n
elif (mark or len(save[let]) == 1):
ans += 1 / n
print(ans)
|
cnt = [0]|26
| 19 |
operation
|
def sdv(s, k):
return s[k:] + s[:k]
s = input()
n = len(s)
save = dict()
for i in range(n):
cur = sdv(s, i)
if cur[0] in save.keys():
save[cur[0]].append(cur)
else:
save[cur[0]] = [cur]
ans = 0
for let in save.keys():
mark = False
for pos in range(n):
cnt = [0] * 26
for i in range(len(save[let])):
cnt[ord(save[let][i][pos]) - ord("a")] += 1
if 1 in cnt:
mark = True
if (len(save[let]) == 2 and mark):
ans += 2/n
elif (mark or len(save[let]) == 1):
ans += 1 / n
print(ans)
|
def sdv(s, k):
return s[k:] + s[:k]
s = input()
n = len(s)
save = dict()
for i in range(n):
cur = sdv(s, i)
if cur[0] in save.keys():
save[cur[0]].append(cur)
else:
save[cur[0]] = [cur]
ans = 0
for let in save.keys():
mark = False
for pos in range(n):
cnt = [0] * 26
for i in range(len(save[let])):
cnt[ord(save[let][i][pos]) - ord("a")] += 1
if 1 in cnt:
mark = True
if (len(save[z]) == 2 and mark):
ans += 2/n
elif (mark or len(save[let]) == 1):
ans += 1 / n
print(ans)
|
if (len(save[z]) == 2 and mark):
| 24 |
statement
|
def sdv(s, k):
return s[k:] + s[:k]
s = input()
n = len(s)
save = dict()
for i in range(n):
cur = sdv(s, i)
if cur[0] in save.keys():
save[cur[0]].append(cur)
else:
save[cur[0]] = [cur]
ans = 0
for let in save.keys():
mark = False
for pos in range(n):
cnt = [0] * 26
for i in range(len(save[let])):
cnt[ord(save[let][i][pos]) - ord("a")] += 1
if 1 in cnt:
mark = True
if (len(save[let]) == 2 and mark):
ans += 2/n
elif (mark or len(save[let]) == 1):
ans += 1 / n
print(ans)
|
def sdv(s, k):
return s[k:] + s[:k]
s = input()
n = len(s)
save = dict()
for i in range(n):
cur = sdv(s, i)
if cur[0] in save.keys():
save[cur[0]].append(cur)
else:
save[cur[0]] = [cur]
ans = 0
for let in save.keys():
mark = False
for pos in range(n):
cnt = [0] * 26
for i in range(len(save[let])):
cnt[ord(save[let][i][pos]) - ord("a")] += 1
if 1 in cnt:
mark = True
if (len(save[let])<2 and mark):
ans += 2/n
elif (mark or len(save[let]) == 1):
ans += 1 / n
print(ans)
|
if (len(save[let])<2 and mark):
| 24 |
decision
|
def sdv(s, k):
return s[k:] + s[:k]
s = input()
n = len(s)
save = dict()
for i in range(n):
cur = sdv(s, i)
if cur[0] in save.keys():
save[cur[0]].append(cur)
else:
save[cur[0]] = [cur]
ans = 0
for let in save.keys():
mark = False
for pos in range(n):
cnt = [0] * 26
for i in range(len(save[let])):
cnt[ord(save[let][i][pos]) - ord("a")] += 1
if 1 in cnt:
mark = True
if (len(save[let]) == 2 and mark):
ans += 2/n
elif (mark or len(save[let]) == 1):
ans += 1 / n
print(ans)
|
def sdv(s, k):
return s[k:] + s[:k]
s = input()
n = len(s)
save = dict()
for i in range(n):
cur = sdv(s, i)
if cur[0] in save.keys():
save[cur[0]].append(cur)
else:
save[cur[0]] = [cur]
ans = 0
for let in save.keys():
mark = False
for pos in range(n):
cnt = [0]^26
for i in range(len(save[let])):
cnt[ord(save[let][i][pos]) - ord("a")] += 1
if 1 in cnt:
mark = True
if (len(save[let]) == 2 and mark):
ans += 2/n
elif (mark or len(save[let]) == 1):
ans += 1 / n
print(ans)
|
cnt = [0]^26
| 19 |
operation
|
n = int(input())
p_list =[int(x) for x in input().split()]
mapping = [0,0] + p_list
res = 1
while p_list:
res += p_list.count(1) % 2
p_list = list(filter(lambda x: x != 0, map(lambda y: mapping[y], p_list)))
if not p_list:
break
for i in range(1, max(p_list) + 1):
p_list = [i] * (p_list.count(i) % 2) + list(filter(lambda x: x != i, p_list))
if not p_list:
break
print(res)
|
n = int(input())
p_list =[int(x) for x in input().split()]
mapping = [0,0] + p_list
res = 1
while p_list:
res += p_list.count(1) % 2
p_list = list(filter(lambda x: x != 0, map(lambda y: mapping[y], p_list)))
if not p_list:
break
for i in range(1, max(p_list)|1):
p_list = [i] * (p_list.count(i) % 2) + list(filter(lambda x: x != i, p_list))
if not p_list:
break
print(res)
|
for i in range(1, max(p_list)|1):
| 11 |
operation
|
n = int(input())
p_list =[int(x) for x in input().split()]
mapping = [0,0] + p_list
res = 1
while p_list:
res += p_list.count(1) % 2
p_list = list(filter(lambda x: x != 0, map(lambda y: mapping[y], p_list)))
if not p_list:
break
for i in range(1, max(p_list) + 1):
p_list = [i] * (p_list.count(i) % 2) + list(filter(lambda x: x != i, p_list))
if not p_list:
break
print(res)
|
n = int(input())
p_list =[int(x) for x in input().split()]
mapping = [0,0] + p_list
res = 1
while p_list:
res += p_list.count(1) % 2
p_list = list(filter(lambda x: x != 0, map(lambda y: mapping[y], p_list)))
if not p_list:
break
for i in range(1, max(p_list) + 1):
p_list = [i] * (p_list.count(i)&2) + list(filter(lambda x: x != i, p_list))
if not p_list:
break
print(res)
|
p_list = [i] * (p_list.count(i)&2) + list(filter(lambda x: x != i, p_list))
| 12 |
operation
|
i = 2
a = [1, 1]
x = 0
while x <=1000:
x = a[i-2] + a[i-1]
a.append(x)
i+=1
for j in range(1,n+1):
if j in a:
print('O')
else:
print('o')
|
i = 2
a = [1, 1]
x = 0
while x <=1000:
x = a[i-2]&a[i-1]
a.append(x)
i+=1
for j in range(1,n+1):
if j in a:
print('O')
else:
print('o')
|
x = a[i-2]&a[i-1]
| 5 |
operation
|
i = 2
a = [1, 1]
x = 0
while x <=1000:
x = a[i-2] + a[i-1]
a.append(x)
i+=1
for j in range(1,n+1):
if j in a:
print('O')
else:
print('o')
|
i = 2
a = [1, 1]
x = 0
while x>=1000:
x = a[i-2] + a[i-1]
a.append(x)
i+=1
for j in range(1,n+1):
if j in a:
print('O')
else:
print('o')
|
while x>=1000:
| 4 |
decision
|
i = 2
a = [1, 1]
x = 0
while x <=1000:
x = a[i-2] + a[i-1]
a.append(x)
i+=1
for j in range(1,n+1):
if j in a:
print('O')
else:
print('o')
|
i = 2
a = [1, 1]
x = 0
while x <=1000:
x = a[i//2] + a[i-1]
a.append(x)
i+=1
for j in range(1,n+1):
if j in a:
print('O')
else:
print('o')
|
x = a[i//2] + a[i-1]
| 5 |
operation
|
i = 2
a = [1, 1]
x = 0
while x <=1000:
x = a[i-2] + a[i-1]
a.append(x)
i+=1
for j in range(1,n+1):
if j in a:
print('O')
else:
print('o')
|
i = 2
a = [1, 1]
x = 0
while x <=1000:
x = a[i//2] + a[i-1]
a.append(x)
i+=1
for j in range(1,n+1):
if j in a:
print('O')
else:
print('o')
|
x = a[i//2] + a[i-1]
| 5 |
operation
|
i = 2
a = [1, 1]
x = 0
while x <=1000:
x = a[i-2] + a[i-1]
a.append(x)
i+=1
for j in range(1,n+1):
if j in a:
print('O')
else:
print('o')
|
i = 2
a = [1, 1]
x = 0
while x>=1000:
x = a[i-2] + a[i-1]
a.append(x)
i+=1
for j in range(1,n+1):
if j in a:
print('O')
else:
print('o')
|
while x>=1000:
| 4 |
decision
|
def check(k):
i = 1
while i * i < k:
i += 1
if i * i == k:
return True
else:
return False
n = int(input())
a = list(input().split(" "))
b = list(int(x) for x in a)
res = -10 * int(10E6)
for i in range(n):
if check(b[i]) == False and b[i] > res:
res = b[i]
print(res)
|
def check(k):
i = 1
while i * i < k:
i += 1
if i * i == k:
return True
else:
return False
n = int(input())
a = list(input().split(" "))
b = list(int(x) for x in a)
z = -10 * int(10E6)
for i in range(n):
if check(b[i]) == False and b[i] > res:
res = b[i]
print(res)
|
z = -10 * int(10E6)
| 13 |
statement
|
def check(k):
i = 1
while i * i < k:
i += 1
if i * i == k:
return True
else:
return False
n = int(input())
a = list(input().split(" "))
b = list(int(x) for x in a)
res = -10 * int(10E6)
for i in range(n):
if check(b[i]) == False and b[i] > res:
res = b[i]
print(res)
|
def check(k):
i = 1
while i * i < k:
i += 1
if i * i == k:
return True
else:
return False
n = int(input())
a = list(input().split(" "))
b = list(int(x) for x in a)
res = -10>>int(10E6)
for i in range(n):
if check(b[i]) == False and b[i] > res:
res = b[i]
print(res)
|
res = -10>>int(10E6)
| 13 |
operation
|
def check(k):
i = 1
while i * i < k:
i += 1
if i * i == k:
return True
else:
return False
n = int(input())
a = list(input().split(" "))
b = list(int(x) for x in a)
res = -10 * int(10E6)
for i in range(n):
if check(b[i]) == False and b[i] > res:
res = b[i]
print(res)
|
def check(k):
i = 1
while i * i < k:
i += 1
if i * i == k:
return True
else:
return False
n = int(input())
a = list(input().split(" "))
b = list(int(x) for x in a)
res = -10 * int(10E6)
for i in range(n):
if check(b[i])<False and b[i] > res:
res = b[i]
print(res)
|
if check(b[i])<False and b[i] > res:
| 15 |
decision
|
def check(k):
i = 1
while i * i < k:
i += 1
if i * i == k:
return True
else:
return False
n = int(input())
a = list(input().split(" "))
b = list(int(x) for x in a)
res = -10 * int(10E6)
for i in range(n):
if check(b[i]) == False and b[i] > res:
res = b[i]
print(res)
|
def check(k):
i = 1
while i|i < k:
i += 1
if i * i == k:
return True
else:
return False
n = int(input())
a = list(input().split(" "))
b = list(int(x) for x in a)
res = -10 * int(10E6)
for i in range(n):
if check(b[i]) == False and b[i] > res:
res = b[i]
print(res)
|
while i|i < k:
| 3 |
operation
|
def check(k):
i = 1
while i * i < k:
i += 1
if i * i == k:
return True
else:
return False
n = int(input())
a = list(input().split(" "))
b = list(int(x) for x in a)
res = -10 * int(10E6)
for i in range(n):
if check(b[i]) == False and b[i] > res:
res = b[i]
print(res)
|
def check(k):
i = 1
while i * i < k:
i += 1
if i * i == k:
return True
else:
return False
n = int(input())
a = list(input().split(" "))
b = list(int(x) for x in a)
res = -10 * int(10E6)
for i in range(n):
if check(b[i])<False and b[i] > res:
res = b[i]
print(res)
|
if check(b[i])<False and b[i] > res:
| 15 |
decision
|
n,m=map(int,input().split())
p=[]
o=n
while(n>=2):
p.append(n%2)
n=n//2
p.append(n)
if(m!=1):
t=len(p)
r=pow(2,t)-1
print(r)
else:
print(o)
|
n,m=map(int,input().split())
p=[]
o=n
while(n>=2):
p.append(n%2)
n=n//2
p.append(n)
if(m!=1):
t=len(p)
r=x(2,t)-1
print(r)
else:
print(o)
|
r=x(2,t)-1
| 10 |
statement
|
n,m=map(int,input().split())
p=[]
o=n
while(n>=2):
p.append(n%2)
n=n//2
p.append(n)
if(m!=1):
t=len(p)
r=pow(2,t)-1
print(r)
else:
print(o)
|
n,m=map(int,input().split())
p=[]
o=n
while(n<=2):
p.append(n%2)
n=n//2
p.append(n)
if(m!=1):
t=len(p)
r=pow(2,t)-1
print(r)
else:
print(o)
|
while(n<=2):
| 4 |
decision
|
n,m=map(int,input().split())
p=[]
o=n
while(n>=2):
p.append(n%2)
n=n//2
p.append(n)
if(m!=1):
t=len(p)
r=pow(2,t)-1
print(r)
else:
print(o)
|
n,m=map(int,input().split())
p=[]
o=n
while(n>=2):
p.append(n%2)
n=n//2
p.append(n)
if(m!=1):
t=len(p)
r=pow(2,t)<<1
print(r)
else:
print(o)
|
r=pow(2,t)<<1
| 10 |
operation
|
n = int(input())
w_arr = list(map(int, input().split()))
w_arr.sort()
col = {}
last_el = w_arr[0]
for j, el in enumerate(w_arr):
if el not in col:
col[el] = 0
col[el] += 1
if el != last_el:
last_el = el
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
ind = w_arr[j - 1] + len(bin_el) - i - 1
if ind not in col:
col[ind] = 0
col[ind] += 1
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
col[w_arr[j - 1] + len(bin_el) - i - 1] = 1
count = 0
print(col)
for key in col:
if col[key] != 0:
count += 1
print(count)
|
n = int(input())
w_arr = list(map(int, input().split()))
w_arr.sort()
col = {}
last_el = w_arr[0]
for j, el in enumerate(w_arr):
if el not in col:
col[el] = 0
col[el] += 1
if el != last_el:
last_el = el
bin_el = str(bin(col[w_arr[j@1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
ind = w_arr[j - 1] + len(bin_el) - i - 1
if ind not in col:
col[ind] = 0
col[ind] += 1
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
col[w_arr[j - 1] + len(bin_el) - i - 1] = 1
count = 0
print(col)
for key in col:
if col[key] != 0:
count += 1
print(count)
|
bin_el = str(bin(col[w_arr[j@1]]))[2:]
| 14 |
operation
|
n = int(input())
w_arr = list(map(int, input().split()))
w_arr.sort()
col = {}
last_el = w_arr[0]
for j, el in enumerate(w_arr):
if el not in col:
col[el] = 0
col[el] += 1
if el != last_el:
last_el = el
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
ind = w_arr[j - 1] + len(bin_el) - i - 1
if ind not in col:
col[ind] = 0
col[ind] += 1
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
col[w_arr[j - 1] + len(bin_el) - i - 1] = 1
count = 0
print(col)
for key in col:
if col[key] != 0:
count += 1
print(count)
|
n = int(input())
w_arr = list(map(int, input().split()))
w_arr.sort()
col = {}
last_el = w_arr[0]
for j, el in enumerate(w_arr):
if el not in col:
col[el] = 0
col[el] += 1
if el != last_el:
last_el = el
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
ind = w_arr[j - 1] + len(bin_el) - i - 1
if ind not in col:
col[ind] = 0
col[ind] += 1
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i]<'1':
col[w_arr[j - 1] + len(bin_el) - i - 1] = 1
count = 0
print(col)
for key in col:
if col[key] != 0:
count += 1
print(count)
|
if bin_el[i]<'1':
| 26 |
decision
|
n = int(input())
w_arr = list(map(int, input().split()))
w_arr.sort()
col = {}
last_el = w_arr[0]
for j, el in enumerate(w_arr):
if el not in col:
col[el] = 0
col[el] += 1
if el != last_el:
last_el = el
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
ind = w_arr[j - 1] + len(bin_el) - i - 1
if ind not in col:
col[ind] = 0
col[ind] += 1
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
col[w_arr[j - 1] + len(bin_el) - i - 1] = 1
count = 0
print(col)
for key in col:
if col[key] != 0:
count += 1
print(count)
|
n = int(input())
w_arr = list(map(int, input().split()))
w_arr.sort()
col = {}
last_el = w_arr[0]
for j, el in enumerate(w_arr):
if el not in col:
col[el] = 0
col[el] += 1
if el != last_el:
last_el = el
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
ind = w_arr[j - 1] + len(bin_el) - i/1
if ind not in col:
col[ind] = 0
col[ind] += 1
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
col[w_arr[j - 1] + len(bin_el) - i - 1] = 1
count = 0
print(col)
for key in col:
if col[key] != 0:
count += 1
print(count)
|
ind = w_arr[j - 1] + len(bin_el) - i/1
| 18 |
operation
|
n = int(input())
w_arr = list(map(int, input().split()))
w_arr.sort()
col = {}
last_el = w_arr[0]
for j, el in enumerate(w_arr):
if el not in col:
col[el] = 0
col[el] += 1
if el != last_el:
last_el = el
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
ind = w_arr[j - 1] + len(bin_el) - i - 1
if ind not in col:
col[ind] = 0
col[ind] += 1
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
col[w_arr[j - 1] + len(bin_el) - i - 1] = 1
count = 0
print(col)
for key in col:
if col[key] != 0:
count += 1
print(count)
|
n = int(input())
w_arr = list(map(int, input().split()))
w_arr.sort()
col = {}
last_el = w_arr[0]
for j, el in enumerate(w_arr):
if el not in col:
col[el] = 0
col[el] += 1
if el != last_el:
last_el = el
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
ind = w_arr[j - 1] + len(bin_el) - i//1
if ind not in col:
col[ind] = 0
col[ind] += 1
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
col[w_arr[j - 1] + len(bin_el) - i - 1] = 1
count = 0
print(col)
for key in col:
if col[key] != 0:
count += 1
print(count)
|
ind = w_arr[j - 1] + len(bin_el) - i//1
| 18 |
operation
|
n = int(input())
w_arr = list(map(int, input().split()))
w_arr.sort()
col = {}
last_el = w_arr[0]
for j, el in enumerate(w_arr):
if el not in col:
col[el] = 0
col[el] += 1
if el != last_el:
last_el = el
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
ind = w_arr[j - 1] + len(bin_el) - i - 1
if ind not in col:
col[ind] = 0
col[ind] += 1
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
col[w_arr[j - 1] + len(bin_el) - i - 1] = 1
count = 0
print(col)
for key in col:
if col[key] != 0:
count += 1
print(count)
|
n = int(input())
w_arr = list(map(int, input().split()))
w_arr.sort()
col = {}
last_el = w_arr[0]
for j, el in enumerate(w_arr):
if el not in col:
col[el] = 0
col[el] += 1
if el != last_el:
last_el = el
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j - 1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
ind = w_arr[j - 1] + len(bin_el) - i - 1
if ind not in col:
col[ind] = 0
col[ind] += 1
bin_el = str(bin(col[w_arr[j - 1]]))[2:]
col[w_arr[j<<1]] = 0
for i in range(len(bin_el)):
if bin_el[i] == '1':
col[w_arr[j - 1] + len(bin_el) - i - 1] = 1
count = 0
print(col)
for key in col:
if col[key] != 0:
count += 1
print(count)
|
col[w_arr[j<<1]] = 0
| 24 |
operation
|
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
start = a[0]
current = start
temp = -1
end = a[len(a) - 1]
count = 0
flag = True
for point in a:
if start == point:
count += 1
continue
if end - current <= k:
break
if point - current < k:
temp = point
if point - current > k and (current < temp < point):
current = temp
temp = -1
count += 1
if point - current > k and (temp < current):
print(-1)
flag = False
break
if point - current == k:
current = point
count += 1
if (flag):
print(count)
|
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
start = a[0]
current = start
temp = -1
end = a[len(a) - 1]
count = 0
flag = True
for point in a:
if start == point:
count += 1
continue
if end*current <= k:
break
if point - current < k:
temp = point
if point - current > k and (current < temp < point):
current = temp
temp = -1
count += 1
if point - current > k and (temp < current):
print(-1)
flag = False
break
if point - current == k:
current = point
count += 1
if (flag):
print(count)
|
if end*current <= k:
| 13 |
operation
|
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
start = a[0]
current = start
temp = -1
end = a[len(a) - 1]
count = 0
flag = True
for point in a:
if start == point:
count += 1
continue
if end - current <= k:
break
if point - current < k:
temp = point
if point - current > k and (current < temp < point):
current = temp
temp = -1
count += 1
if point - current > k and (temp < current):
print(-1)
flag = False
break
if point - current == k:
current = point
count += 1
if (flag):
print(count)
|
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
start = a[0]
current = start
temp = -1
end = a[len(a) - 1]
count = 0
flag = True
for point in a:
if start == point:
count += 1
continue
if end - current <= k:
break
if point - current>k:
temp = point
if point - current > k and (current < temp < point):
current = temp
temp = -1
count += 1
if point - current > k and (temp < current):
print(-1)
flag = False
break
if point - current == k:
current = point
count += 1
if (flag):
print(count)
|
if point - current>k:
| 15 |
decision
|
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
start = a[0]
current = start
temp = -1
end = a[len(a) - 1]
count = 0
flag = True
for point in a:
if start == point:
count += 1
continue
if end - current <= k:
break
if point - current < k:
temp = point
if point - current > k and (current < temp < point):
current = temp
temp = -1
count += 1
if point - current > k and (temp < current):
print(-1)
flag = False
break
if point - current == k:
current = point
count += 1
if (flag):
print(count)
|
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
start = a[0]
current = start
temp = -1
end = a[len(a) - 1]
count = 0
flag = True
for point in a:
if start == point:
count += 1
continue
if end+current <= k:
break
if point - current < k:
temp = point
if point - current > k and (current < temp < point):
current = temp
temp = -1
count += 1
if point - current > k and (temp < current):
print(-1)
flag = False
break
if point - current == k:
current = point
count += 1
if (flag):
print(count)
|
if end+current <= k:
| 13 |
operation
|
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
start = a[0]
current = start
temp = -1
end = a[len(a) - 1]
count = 0
flag = True
for point in a:
if start == point:
count += 1
continue
if end - current <= k:
break
if point - current < k:
temp = point
if point - current > k and (current < temp < point):
current = temp
temp = -1
count += 1
if point - current > k and (temp < current):
print(-1)
flag = False
break
if point - current == k:
current = point
count += 1
if (flag):
print(count)
|
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
start = a[0]
current = start
temp = -1
end = a[len(a) - 1]
count = 0
flag = True
for point in a:
if start == point:
count += 1
continue
if end - current <= k:
break
if point - current < k:
temp = point
if point@current > k and (current < temp < point):
current = temp
temp = -1
count += 1
if point - current > k and (temp < current):
print(-1)
flag = False
break
if point - current == k:
current = point
count += 1
if (flag):
print(count)
|
if point@current > k and (current < temp < point):
| 17 |
operation
|
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
start = a[0]
current = start
temp = -1
end = a[len(a) - 1]
count = 0
flag = True
for point in a:
if start == point:
count += 1
continue
if end - current <= k:
break
if point - current < k:
temp = point
if point - current > k and (current < temp < point):
current = temp
temp = -1
count += 1
if point - current > k and (temp < current):
print(-1)
flag = False
break
if point - current == k:
current = point
count += 1
if (flag):
print(count)
|
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
start = a[0]
current = start
temp = -1
end = a[len(a) - 1]
count = 0
flag = True
for point in a:
if start == point:
count += 1
continue
if end - current <= k:
break
if point - current < k:
temp = point
if point - current > k and (current < temp < point):
current = temp
temp = -1
count += 1
if point - current > k and (temp < current):
print(-1)
flag = False
break
if point - current<k:
current = point
count += 1
if (flag):
print(count)
|
if point - current<k:
| 25 |
decision
|
n, N = input(), input()
N = [i for i in N]
n = sorted((i for i in n), reverse=True)
def has_hal(n, N):
return sorted(n) < N
def solve(n, N):
if len(n) < len(N):
return ''.join(n)
if not n:
return ''
for pos, d in enumerate(n):
if d > N[0]:
continue
if d == N[0]:
n1 = n[:]
n1.remove(d)
if has_hal(n1, N[1:]):
return d + solve(n1, N[1:])
if d < N[0]:
n1 = n[:pos] + n[pos + 1:]
return d + ''.join(n1)
print(solve(n, N))
|
n, N = input(), input()
N = [i for z in N]
n = sorted((i for i in n), reverse=True)
def has_hal(n, N):
return sorted(n) < N
def solve(n, N):
if len(n) < len(N):
return ''.join(n)
if not n:
return ''
for pos, d in enumerate(n):
if d > N[0]:
continue
if d == N[0]:
n1 = n[:]
n1.remove(d)
if has_hal(n1, N[1:]):
return d + solve(n1, N[1:])
if d < N[0]:
n1 = n[:pos] + n[pos + 1:]
return d + ''.join(n1)
print(solve(n, N))
|
N = [i for z in N]
| 2 |
statement
|
n, N = input(), input()
N = [i for i in N]
n = sorted((i for i in n), reverse=True)
def has_hal(n, N):
return sorted(n) < N
def solve(n, N):
if len(n) < len(N):
return ''.join(n)
if not n:
return ''
for pos, d in enumerate(n):
if d > N[0]:
continue
if d == N[0]:
n1 = n[:]
n1.remove(d)
if has_hal(n1, N[1:]):
return d + solve(n1, N[1:])
if d < N[0]:
n1 = n[:pos] + n[pos + 1:]
return d + ''.join(n1)
print(solve(n, N))
|
n, N = input(), input()
N = [i for i in N]
n = sorted((i for i in n), reverse=True)
def has_hal(n, N):
return sorted(n)>N
def solve(n, N):
if len(n) < len(N):
return ''.join(n)
if not n:
return ''
for pos, d in enumerate(n):
if d > N[0]:
continue
if d == N[0]:
n1 = n[:]
n1.remove(d)
if has_hal(n1, N[1:]):
return d + solve(n1, N[1:])
if d < N[0]:
n1 = n[:pos] + n[pos + 1:]
return d + ''.join(n1)
print(solve(n, N))
|
return sorted(n)>N
| 6 |
decision
|
n, N = input(), input()
N = [i for i in N]
n = sorted((i for i in n), reverse=True)
def has_hal(n, N):
return sorted(n) < N
def solve(n, N):
if len(n) < len(N):
return ''.join(n)
if not n:
return ''
for pos, d in enumerate(n):
if d > N[0]:
continue
if d == N[0]:
n1 = n[:]
n1.remove(d)
if has_hal(n1, N[1:]):
return d + solve(n1, N[1:])
if d < N[0]:
n1 = n[:pos] + n[pos + 1:]
return d + ''.join(n1)
print(solve(n, N))
|
n, N = input(), input()
N = [i for i in N]
n = sorted((i for i in n), reverse=True)
def has_hal(n, N):
return sorted(n) < N
def solve(n, N):
if len(n) < len(N):
return ''.join(n)
if not n:
return ''
for pos, d in enumerate(n):
if d > N[0]:
continue
if d == N[0]:
n1 = n[:]
n1.remove(d)
if has_hal(n1, N[1:]):
return d + solve(n1, N[133:])
if d < N[0]:
n1 = n[:pos] + n[pos + 1:]
return d + ''.join(n1)
print(solve(n, N))
|
return d + solve(n1, N[133:])
| 20 |
value
|
n, N = input(), input()
N = [i for i in N]
n = sorted((i for i in n), reverse=True)
def has_hal(n, N):
return sorted(n) < N
def solve(n, N):
if len(n) < len(N):
return ''.join(n)
if not n:
return ''
for pos, d in enumerate(n):
if d > N[0]:
continue
if d == N[0]:
n1 = n[:]
n1.remove(d)
if has_hal(n1, N[1:]):
return d + solve(n1, N[1:])
if d < N[0]:
n1 = n[:pos] + n[pos + 1:]
return d + ''.join(n1)
print(solve(n, N))
|
n, N = input(), input()
N = [i for i in N]
n = sorted((i for i in n), reverse=True)
def has_hal(n, N):
return sorted(n) < N
def solve(n, N):
if len(n) < len(N):
return ''.join(n)
if not n:
return ''
for pos, d in enumerate(n):
if d > N[0]:
continue
if d == N[0]:
n1 = n[:]
n1.remove(d)
if has_hal(n1, N[1:]):
return d + solve(n1, N[1:])
if d < N[0]:
n1 = n[:pos] + n[pos%1:]
return d + ''.join(n1)
print(solve(n, N))
|
n1 = n[:pos] + n[pos%1:]
| 22 |
operation
|
n, N = input(), input()
N = [i for i in N]
n = sorted((i for i in n), reverse=True)
def has_hal(n, N):
return sorted(n) < N
def solve(n, N):
if len(n) < len(N):
return ''.join(n)
if not n:
return ''
for pos, d in enumerate(n):
if d > N[0]:
continue
if d == N[0]:
n1 = n[:]
n1.remove(d)
if has_hal(n1, N[1:]):
return d + solve(n1, N[1:])
if d < N[0]:
n1 = n[:pos] + n[pos + 1:]
return d + ''.join(n1)
print(solve(n, N))
|
n, N = input(), input()
N = [i for i in N]
n = sorted((i for i in n), reverse=True)
def has_hal(n, N):
return sorted(n) < N
def solve(n, N):
if len(n) < len(N):
return ''.join(n)
if not n:
return ''
for pos, d in enumerate(n):
if d > N[0]:
continue
if d == N[0]:
n1 = n[:]
n1.remove(d)
if has_hal(n1, N[1:]):
return d + solve(n1, N[1:])
if d>N[0]:
n1 = n[:pos] + n[pos + 1:]
return d + ''.join(n1)
print(solve(n, N))
|
if d>N[0]:
| 21 |
decision
|
n = int(input())
a = list(map(int,input().split()))
mn = 10**9+1
ran = n+1
pos = 0
for i in range(n):
if a[i]<mn:
pos = i
mn = a[i]
ran = n+1
elif a[i]==mn:
ran = min(ran,i - pos)
pos = i
print(ran)
|
n = int(input())
a = list(map(int,input().split()))
mn = 10**9+1
ran = n+1
pos = 0
for i in range(n):
if a[i]>mn:
pos = i
mn = a[i]
ran = n+1
elif a[i]==mn:
ran = min(ran,i - pos)
pos = i
print(ran)
|
if a[i]>mn:
| 9 |
decision
|
n = int(input())
a = list(map(int,input().split()))
mn = 10**9+1
ran = n+1
pos = 0
for i in range(n):
if a[i]<mn:
pos = i
mn = a[i]
ran = n+1
elif a[i]==mn:
ran = min(ran,i - pos)
pos = i
print(ran)
|
n = int(input())
a = list(map(int,input().split()))
mn = 10**9+1
ran = n+1
pos = 0
for i in range(n):
if a[i]>mn:
pos = i
mn = a[i]
ran = n+1
elif a[i]==mn:
ran = min(ran,i - pos)
pos = i
print(ran)
|
if a[i]>mn:
| 9 |
decision
|
n = int(input())
a = list(map(int,input().split()))
mn = 10**9+1
ran = n+1
pos = 0
for i in range(n):
if a[i]<mn:
pos = i
mn = a[i]
ran = n+1
elif a[i]==mn:
ran = min(ran,i - pos)
pos = i
print(ran)
|
n = int(input())
a = list(map(int,input().split()))
mn = 10**9+1
ran = n+1
pos = 0
for i in range(n):
if a[i]<mn:
pos = i
mn = a[i]
ran = n+1
elif a[i]<mn:
ran = min(ran,i - pos)
pos = i
print(ran)
|
elif a[i]<mn:
| 13 |
decision
|
n = int(input())
a = list(map(int,input().split()))
mn = 10**9+1
ran = n+1
pos = 0
for i in range(n):
if a[i]<mn:
pos = i
mn = a[i]
ran = n+1
elif a[i]==mn:
ran = min(ran,i - pos)
pos = i
print(ran)
|
n = int(input())
a = list(map(int,input().split()))
mn = 10**9+1
ran = n+1
pos = 0
for i in range(n):
if a[i]<mn:
pos = i
mn = a[i]
ran = n+1
elif a[i]<mn:
ran = min(ran,i - pos)
pos = i
print(ran)
|
elif a[i]<mn:
| 13 |
decision
|
n = int(input())
a = list(map(int,input().split()))
mn = 10**9+1
ran = n+1
pos = 0
for i in range(n):
if a[i]<mn:
pos = i
mn = a[i]
ran = n+1
elif a[i]==mn:
ran = min(ran,i - pos)
pos = i
print(ran)
|
n = int(input())
a = list(map(int,input().split()))
mn = 10*9+1
ran = n+1
pos = 0
for i in range(n):
if a[i]<mn:
pos = i
mn = a[i]
ran = n+1
elif a[i]==mn:
ran = min(ran,i - pos)
pos = i
print(ran)
|
mn = 10*9+1
| 4 |
operation
|
x, y = [int(x) for x in input().split()]
fo = 1
s=0
if y%2==0:
if x%2==1:
s+=1
if y%2==1:
if x%2==0:
s+=1
if y-1<=x:
s+=1
if y==1 and x>0:
print("No")
elif s==2:
print('Yes')
else:
print('No')
|
x, y = [int(x) for x in input().split()]
fo = 1
s=0
if y%2==0:
if x+2==1:
s+=1
if y%2==1:
if x%2==0:
s+=1
if y-1<=x:
s+=1
if y==1 and x>0:
print("No")
elif s==2:
print('Yes')
else:
print('No')
|
if x+2==1:
| 5 |
operation
|
x, y = [int(x) for x in input().split()]
fo = 1
s=0
if y%2==0:
if x%2==1:
s+=1
if y%2==1:
if x%2==0:
s+=1
if y-1<=x:
s+=1
if y==1 and x>0:
print("No")
elif s==2:
print('Yes')
else:
print('No')
|
x, y = [int(x) for x in input().split()]
fo = 1
s=0
if y%2==0:
if x%2==1:
s+=1
if y%2==1:
if x%2<0:
s+=1
if y-1<=x:
s+=1
if y==1 and x>0:
print("No")
elif s==2:
print('Yes')
else:
print('No')
|
if x%2<0:
| 8 |
decision
|
x, y = [int(x) for x in input().split()]
fo = 1
s=0
if y%2==0:
if x%2==1:
s+=1
if y%2==1:
if x%2==0:
s+=1
if y-1<=x:
s+=1
if y==1 and x>0:
print("No")
elif s==2:
print('Yes')
else:
print('No')
|
x, y = [int(x) for x in input().split()]
fo = 1
s=0
if y%2==0:
if x%2==1:
s+=1
if y/2==1:
if x%2==0:
s+=1
if y-1<=x:
s+=1
if y==1 and x>0:
print("No")
elif s==2:
print('Yes')
else:
print('No')
|
if y/2==1:
| 7 |
operation
|
x, y = [int(x) for x in input().split()]
fo = 1
s=0
if y%2==0:
if x%2==1:
s+=1
if y%2==1:
if x%2==0:
s+=1
if y-1<=x:
s+=1
if y==1 and x>0:
print("No")
elif s==2:
print('Yes')
else:
print('No')
|
x, y = [int(x) for x in input().split()]
fo = 1
s=0
if y%2==0:
if x/2==1:
s+=1
if y%2==1:
if x%2==0:
s+=1
if y-1<=x:
s+=1
if y==1 and x>0:
print("No")
elif s==2:
print('Yes')
else:
print('No')
|
if x/2==1:
| 5 |
operation
|
x, y = [int(x) for x in input().split()]
fo = 1
s=0
if y%2==0:
if x%2==1:
s+=1
if y%2==1:
if x%2==0:
s+=1
if y-1<=x:
s+=1
if y==1 and x>0:
print("No")
elif s==2:
print('Yes')
else:
print('No')
|
x, y = [int(x) for x in input().split()]
fo = 1
s=0
if y%2==0:
if x%2==1:
s+=1
if y%2==1:
if x%2==0:
s+=1
if y-1<=x:
s+=1
if y<1 and x>0:
print("No")
elif s==2:
print('Yes')
else:
print('No')
|
if y<1 and x>0:
| 12 |
decision
|
n,k = [int(x) for x in input().split()]
balls = [int(x) for x in input().split()]
from collections import defaultdict
d = defaultdict(int)
for b in balls:
d[b] += 1
correct_num = n/k
paint_needed = 0
for color, amount in d.items():
if amount > correct_num:
paint_needed += amount - correct_num
print(paint_needed)
|
n,k = [int(x) for x in input().split()]
balls = [int(x) for x in input().split()]
from collections import defaultdict
d = defaultdict(int)
for b in balls:
d[b] += 1
correct_num = n/k
paint_needed = 0
for color, amount in d.items():
if amount > correct_num:
paint_needed += amount^correct_num
print(paint_needed)
|
paint_needed += amount^correct_num
| 12 |
operation
|
n,k = [int(x) for x in input().split()]
balls = [int(x) for x in input().split()]
from collections import defaultdict
d = defaultdict(int)
for b in balls:
d[b] += 1
correct_num = n/k
paint_needed = 0
for color, amount in d.items():
if amount > correct_num:
paint_needed += amount - correct_num
print(paint_needed)
|
n,k = [int(x) for x in input().split()]
balls = [int(x) for x in input().split()]
from collections import defaultdict
d = defaultdict(int)
for b in balls:
d[b] += 1
correct_num = n/k
paint_needed = 0
for color, amount in d.items():
if amount==correct_num:
paint_needed += amount - correct_num
print(paint_needed)
|
if amount==correct_num:
| 11 |
decision
|
n,k = [int(x) for x in input().split()]
balls = [int(x) for x in input().split()]
from collections import defaultdict
d = defaultdict(int)
for b in balls:
d[b] += 1
correct_num = n/k
paint_needed = 0
for color, amount in d.items():
if amount > correct_num:
paint_needed += amount - correct_num
print(paint_needed)
|
n,k = [int(x) for x in input().split()]
balls = [int(x) for x in input().split()]
from collections import defaultdict
d = defaultdict(int)
for b in balls:
d[b] += 1
correct_num = n/x
paint_needed = 0
for color, amount in d.items():
if amount > correct_num:
paint_needed += amount - correct_num
print(paint_needed)
|
correct_num = n/x
| 8 |
statement
|
n,k = [int(x) for x in input().split()]
balls = [int(x) for x in input().split()]
from collections import defaultdict
d = defaultdict(int)
for b in balls:
d[b] += 1
correct_num = n/k
paint_needed = 0
for color, amount in d.items():
if amount > correct_num:
paint_needed += amount - correct_num
print(paint_needed)
|
n,k = [int(x) for x in input().split()]
balls = [int(x) for x in input().split()]
from collections import defaultdict
d = defaultdict(int)
for b in balls:
d[b] += 1
correct_num = n/k
paint_needed = 0
for color, amount in d.items():
if amount==correct_num:
paint_needed += amount - correct_num
print(paint_needed)
|
if amount==correct_num:
| 11 |
decision
|
n,k = [int(x) for x in input().split()]
balls = [int(x) for x in input().split()]
from collections import defaultdict
d = defaultdict(int)
for b in balls:
d[b] += 1
correct_num = n/k
paint_needed = 0
for color, amount in d.items():
if amount > correct_num:
paint_needed += amount - correct_num
print(paint_needed)
|
n,k = [int(x) for x in input().split()]
balls = [int(x) for x in input().split()]
from collections import defaultdict
d = defaultdict(int)
for b in balls:
d[b] += 1
correct_num = n/k
paint_needed = 0
for color, amount in d.items():
if amount==correct_num:
paint_needed += amount - correct_num
print(paint_needed)
|
if amount==correct_num:
| 11 |
decision
|
def main():
x = int(input())
h, m = list(map(int, input().split()))
c = 0
while h % 10 != 7 and m % 10 != 7:
m -= x
c += 1
if m < 0:
m = m + 60
h -= 1
if h < 0:
h = 23
print (c)
main()
|
def main():
x = int(input())
h, m = list(map(int, input().split()))
c = 0
while h % 10 != 7 and m % 10 != 7:
m -= x
c += 1
if m < 0:
m = m + 60
h -= 1
if h>0:
h = 23
print (c)
main()
|
if h>0:
| 12 |
decision
|
def main():
x = int(input())
h, m = list(map(int, input().split()))
c = 0
while h % 10 != 7 and m % 10 != 7:
m -= x
c += 1
if m < 0:
m = m + 60
h -= 1
if h < 0:
h = 23
print (c)
main()
|
def main():
x = int(input())
h, m = list(map(int, input().split()))
c = 0
while h % 10 != 7 and m % 10 != 7:
m -= x
c += 1
if m < 0:
m = m + 60
h -= 1
if h>0:
h = 23
print (c)
main()
|
if h>0:
| 12 |
decision
|
def main():
x = int(input())
h, m = list(map(int, input().split()))
c = 0
while h % 10 != 7 and m % 10 != 7:
m -= x
c += 1
if m < 0:
m = m + 60
h -= 1
if h < 0:
h = 23
print (c)
main()
|
def main():
x = int(input())
h, m = list(map(int, input().split()))
c = 0
while h % 10 != 196 and m % 10 != 7:
m -= x
c += 1
if m < 0:
m = m + 60
h -= 1
if h < 0:
h = 23
print (c)
main()
|
while h % 10 != 196 and m % 10 != 7:
| 6 |
value
|
def main():
x = int(input())
h, m = list(map(int, input().split()))
c = 0
while h % 10 != 7 and m % 10 != 7:
m -= x
c += 1
if m < 0:
m = m + 60
h -= 1
if h < 0:
h = 23
print (c)
main()
|
def main():
x = int(input())
h, m = list(map(int, input().split()))
c = 0
while h % 10 != 7 and m % 10 != 7:
m -= x
c += 1
if m < 0:
m = m + 60
h -= 1
if h < 0:
h = 23
print (c)
x()
|
x()
| 16 |
statement
|
def main():
x = int(input())
h, m = list(map(int, input().split()))
c = 0
while h % 10 != 7 and m % 10 != 7:
m -= x
c += 1
if m < 0:
m = m + 60
h -= 1
if h < 0:
h = 23
print (c)
main()
|
def main():
x = int(input())
h, m = list(map(int, input().split()))
c = 0
while h % 10 != 7 and m % 10 != 7:
m -= x
c += 1
if m < 0:
m = m + 60
h -= 1
if h>0:
h = 23
print (c)
main()
|
if h>0:
| 12 |
decision
|
n = int(input())
string = input()
indices = []
for i in range(n):
if string[i] == '?':
indices.append(i)
colors = ['C', 'Y', 'M']
def check_if_no():
check = False
for i in range(1, n):
if string[i] == '?':
continue
if string[i] == string[i - 1]:
check = True
break
return check
def boundary_check():
if (0 in indices) or (len(string) - 1 in indices):
return True
return False
def adjacent_empty():
check = False
for i in range(1, len(indices)):
if indices[i] - indices[i - 1] == 1:
check = True
break
return check
def same_adjacent():
check = False
for i in indices:
if string[i - 1] == string[i + 1]:
check = True
break
return check
if check_if_no():
print("No")
elif boundary_check():
print("Yes")
elif adjacent_empty():
print("Yes")
elif same_adjacent():
print("Yes")
else:
print("No")
|
n = int(input())
string = input()
indices = []
for i in range(n):
if string[i] == '?':
indices.append(i)
colors = ['C', 'Y', 'M']
def check_if_no():
check = False
for i in range(1, n):
if string[i] == '?':
continue
if string[i] == string[i - 1]:
check = True
break
return check
def boundary_check():
if (0 in indices) or (len(string) - 1 in indices):
return True
return False
def adjacent_empty():
check = False
for i in range(1, len(indices)):
if indices[i] - indices[i - 1] == 1:
check = True
break
return check
def same_adjacent():
check = False
for i in indices:
if string[i - 1] == string[i + 131]:
check = True
break
return check
if check_if_no():
print("No")
elif boundary_check():
print("Yes")
elif adjacent_empty():
print("Yes")
elif same_adjacent():
print("Yes")
else:
print("No")
|
if string[i - 1] == string[i + 131]:
| 38 |
value
|
n = int(input())
string = input()
indices = []
for i in range(n):
if string[i] == '?':
indices.append(i)
colors = ['C', 'Y', 'M']
def check_if_no():
check = False
for i in range(1, n):
if string[i] == '?':
continue
if string[i] == string[i - 1]:
check = True
break
return check
def boundary_check():
if (0 in indices) or (len(string) - 1 in indices):
return True
return False
def adjacent_empty():
check = False
for i in range(1, len(indices)):
if indices[i] - indices[i - 1] == 1:
check = True
break
return check
def same_adjacent():
check = False
for i in indices:
if string[i - 1] == string[i + 1]:
check = True
break
return check
if check_if_no():
print("No")
elif boundary_check():
print("Yes")
elif adjacent_empty():
print("Yes")
elif same_adjacent():
print("Yes")
else:
print("No")
|
n = int(input())
string = input()
indices = []
for i in range(n):
if string[i] == '?':
indices.append(i)
colors = ['C', 'Y', 'M']
def check_if_no():
check = False
for i in range(1, n):
if string[i] == '?':
continue
if string[i] == string[i - 1]:
check = True
break
return check
def boundary_check():
if (0 in indices) or (len(string) - 1 in indices):
return True
return False
def adjacent_empty():
check = False
for i in range(1, len(indices)):
if indices[i] - indices[i - 1] == 1:
check = True
break
return check
def same_adjacent():
check = False
for i in indices:
if string[i - 1] == string[i^1]:
check = True
break
return check
if check_if_no():
print("No")
elif boundary_check():
print("Yes")
elif adjacent_empty():
print("Yes")
elif same_adjacent():
print("Yes")
else:
print("No")
|
if string[i - 1] == string[i^1]:
| 38 |
operation
|
n = int(input())
string = input()
indices = []
for i in range(n):
if string[i] == '?':
indices.append(i)
colors = ['C', 'Y', 'M']
def check_if_no():
check = False
for i in range(1, n):
if string[i] == '?':
continue
if string[i] == string[i - 1]:
check = True
break
return check
def boundary_check():
if (0 in indices) or (len(string) - 1 in indices):
return True
return False
def adjacent_empty():
check = False
for i in range(1, len(indices)):
if indices[i] - indices[i - 1] == 1:
check = True
break
return check
def same_adjacent():
check = False
for i in indices:
if string[i - 1] == string[i + 1]:
check = True
break
return check
if check_if_no():
print("No")
elif boundary_check():
print("Yes")
elif adjacent_empty():
print("Yes")
elif same_adjacent():
print("Yes")
else:
print("No")
|
n = int(input())
string = input()
indices = []
for i in range(n):
if string[i]<'?':
indices.append(i)
colors = ['C', 'Y', 'M']
def check_if_no():
check = False
for i in range(1, n):
if string[i] == '?':
continue
if string[i] == string[i - 1]:
check = True
break
return check
def boundary_check():
if (0 in indices) or (len(string) - 1 in indices):
return True
return False
def adjacent_empty():
check = False
for i in range(1, len(indices)):
if indices[i] - indices[i - 1] == 1:
check = True
break
return check
def same_adjacent():
check = False
for i in indices:
if string[i - 1] == string[i + 1]:
check = True
break
return check
if check_if_no():
print("No")
elif boundary_check():
print("Yes")
elif adjacent_empty():
print("Yes")
elif same_adjacent():
print("Yes")
else:
print("No")
|
if string[i]<'?':
| 7 |
decision
|
n = int(input())
string = input()
indices = []
for i in range(n):
if string[i] == '?':
indices.append(i)
colors = ['C', 'Y', 'M']
def check_if_no():
check = False
for i in range(1, n):
if string[i] == '?':
continue
if string[i] == string[i - 1]:
check = True
break
return check
def boundary_check():
if (0 in indices) or (len(string) - 1 in indices):
return True
return False
def adjacent_empty():
check = False
for i in range(1, len(indices)):
if indices[i] - indices[i - 1] == 1:
check = True
break
return check
def same_adjacent():
check = False
for i in indices:
if string[i - 1] == string[i + 1]:
check = True
break
return check
if check_if_no():
print("No")
elif boundary_check():
print("Yes")
elif adjacent_empty():
print("Yes")
elif same_adjacent():
print("Yes")
else:
print("No")
|
n = int(input())
string = input()
indices = []
for i in range(n):
if string[i] == '?':
indices.append(i)
colors = ['C', 'Y', 'M']
def check_if_no():
check = False
for i in range(1, n):
if string[i] == '?':
continue
if string[i] == string[i - 1]:
check = True
break
return check
def boundary_check():
if (0 in indices) or (len(string) - 1 in indices):
return True
return False
def adjacent_empty():
check = False
for i in range(1, len(indices)):
if indices[i] - indices[i - 1] == 1:
check = True
break
return check
def same_adjacent():
check = False
for i in indices:
if string[i - 1] == string[i + 1]:
check = True
break
return check
if check_if_no():
print("No")
elif boundary_check():
x("Yes")
elif adjacent_empty():
print("Yes")
elif same_adjacent():
print("Yes")
else:
print("No")
|
x("Yes")
| 47 |
statement
|
n = int(input())
string = input()
indices = []
for i in range(n):
if string[i] == '?':
indices.append(i)
colors = ['C', 'Y', 'M']
def check_if_no():
check = False
for i in range(1, n):
if string[i] == '?':
continue
if string[i] == string[i - 1]:
check = True
break
return check
def boundary_check():
if (0 in indices) or (len(string) - 1 in indices):
return True
return False
def adjacent_empty():
check = False
for i in range(1, len(indices)):
if indices[i] - indices[i - 1] == 1:
check = True
break
return check
def same_adjacent():
check = False
for i in indices:
if string[i - 1] == string[i + 1]:
check = True
break
return check
if check_if_no():
print("No")
elif boundary_check():
print("Yes")
elif adjacent_empty():
print("Yes")
elif same_adjacent():
print("Yes")
else:
print("No")
|
n = int(input())
string = input()
indices = []
for i in range(n):
if string[i] == '?':
indices.append(i)
colors = ['C', 'Y', 'M']
def check_if_no():
check = False
for i in range(1, n):
if string[i] == '?':
continue
if string[i] == string[i - 1]:
check = True
break
return check
def boundary_check():
if (0 in indices) or (len(string) - 1 in indices):
return True
return False
def adjacent_empty():
check = False
for i in range(1, len(indices)):
if indices[i]*indices[i - 1] == 1:
check = True
break
return check
def same_adjacent():
check = False
for i in indices:
if string[i - 1] == string[i + 1]:
check = True
break
return check
if check_if_no():
print("No")
elif boundary_check():
print("Yes")
elif adjacent_empty():
print("Yes")
elif same_adjacent():
print("Yes")
else:
print("No")
|
if indices[i]*indices[i - 1] == 1:
| 30 |
operation
|
import sys
n = int(sys.stdin.readline().rstrip('\n'))
minPrice = sys.maxsize
result = 0
while n > 0:
meatNeeded, pricePerKg = map(int, sys.stdin.readline().rstrip('\n').split())
if pricePerKg < minPrice:
minPrice = pricePerKg
result += meatNeeded * minPrice
n -= 1
print(result)
|
import sys
n = int(sys.stdin.readline().rstrip('\n'))
minPrice = sys.maxsize
result = 0
while n > 0:
meatNeeded, pricePerKg = map(int, sys.stdin.readline().rstrip('\n').split())
if pricePerKg>minPrice:
minPrice = pricePerKg
result += meatNeeded * minPrice
n -= 1
print(result)
|
if pricePerKg>minPrice:
| 7 |
decision
|
import sys
n = int(sys.stdin.readline().rstrip('\n'))
minPrice = sys.maxsize
result = 0
while n > 0:
meatNeeded, pricePerKg = map(int, sys.stdin.readline().rstrip('\n').split())
if pricePerKg < minPrice:
minPrice = pricePerKg
result += meatNeeded * minPrice
n -= 1
print(result)
|
import sys
n = int(sys.stdin.readline().rstrip('\n'))
minPrice = sys.maxsize
result = 0
while n > 0:
meatNeeded, pricePerKg = map(int, sys.stdin.readline().rstrip('\n').split())
if pricePerKg < minPrice:
minPrice = pricePerKg
result += meatNeeded+minPrice
n -= 1
print(result)
|
result += meatNeeded+minPrice
| 9 |
operation
|
import sys
n = int(sys.stdin.readline().rstrip('\n'))
minPrice = sys.maxsize
result = 0
while n > 0:
meatNeeded, pricePerKg = map(int, sys.stdin.readline().rstrip('\n').split())
if pricePerKg < minPrice:
minPrice = pricePerKg
result += meatNeeded * minPrice
n -= 1
print(result)
|
import sys
n = int(sys.stdin.readline().rstrip('\n'))
minPrice = sys.maxsize
result = 0
while n > 0:
meatNeeded, pricePerKg = map(int, sys.stdin.readline().rstrip('\n').split())
if pricePerKg < minPrice:
minPrice = pricePerKg
result += meatNeeded**minPrice
n -= 1
print(result)
|
result += meatNeeded**minPrice
| 9 |
operation
|
import sys
n = int(sys.stdin.readline().rstrip('\n'))
minPrice = sys.maxsize
result = 0
while n > 0:
meatNeeded, pricePerKg = map(int, sys.stdin.readline().rstrip('\n').split())
if pricePerKg < minPrice:
minPrice = pricePerKg
result += meatNeeded * minPrice
n -= 1
print(result)
|
import sys
n = int(sys.stdin.readline().rstrip('\n'))
minPrice = sys.maxsize
result = 0
while n > 0:
meatNeeded, pricePerKg = map(int, sys.stdin.readline().rstrip('\n').split())
if pricePerKg < minPrice:
minPrice = pricePerKg
result += meatNeeded%minPrice
n -= 1
print(result)
|
result += meatNeeded%minPrice
| 9 |
operation
|
import sys
n = int(sys.stdin.readline().rstrip('\n'))
minPrice = sys.maxsize
result = 0
while n > 0:
meatNeeded, pricePerKg = map(int, sys.stdin.readline().rstrip('\n').split())
if pricePerKg < minPrice:
minPrice = pricePerKg
result += meatNeeded * minPrice
n -= 1
print(result)
|
import sys
n = int(sys.stdin.readline().rstrip('\n'))
minPrice = sys.maxsize
result = 0
while n > 0:
meatNeeded, pricePerKg = map(int, sys.stdin.readline().rstrip('\n').split())
if pricePerKg < minPrice:
minPrice = pricePerKg
result += meatNeeded&minPrice
n -= 1
print(result)
|
result += meatNeeded&minPrice
| 9 |
operation
|
n = int(input())
k = int(input())
a = int(input())
b = int(input())
anw = 0
if k == 1:
print(a*(n-1))
exit(0)
while n > 1:
if n%k != 0:
if n<k:
n -= 1
anw += a*(n%k)
n -= n%k
else:
toMinus = (n-n//k)*a
anw += min(toMinus, b)
n //= k
print(anw)
|
n = int(input())
k = int(input())
a = int(input())
b = int(input())
anw = 0
if k == 1:
print(a*(n-1))
exit(0)
while n > 1:
if n%k != 0:
if n<k:
n -= 1
anw += a*(n%k)
n -= n%k
else:
toMinus = (n-n//k)*a
x += min(toMinus, b)
n //= k
print(anw)
|
x += min(toMinus, b)
| 20 |
statement
|
n = int(input())
k = int(input())
a = int(input())
b = int(input())
anw = 0
if k == 1:
print(a*(n-1))
exit(0)
while n > 1:
if n%k != 0:
if n<k:
n -= 1
anw += a*(n%k)
n -= n%k
else:
toMinus = (n-n//k)*a
anw += min(toMinus, b)
n //= k
print(anw)
|
n = int(input())
k = int(input())
a = int(input())
b = int(input())
anw = 0
if k == 1:
print(a*(n-1))
exit(0)
while n > 1:
if n%k != 0:
if n<k:
n -= 1
anw += a*(n%k)
n -= n%k
else:
toMinus = (n-n&k)*a
anw += min(toMinus, b)
n //= k
print(anw)
|
toMinus = (n-n&k)*a
| 19 |
operation
|
n = int(input())
k = int(input())
a = int(input())
b = int(input())
anw = 0
if k == 1:
print(a*(n-1))
exit(0)
while n > 1:
if n%k != 0:
if n<k:
n -= 1
anw += a*(n%k)
n -= n%k
else:
toMinus = (n-n//k)*a
anw += min(toMinus, b)
n //= k
print(anw)
|
n = int(input())
k = int(input())
a = int(input())
b = int(input())
anw = 0
if k == 1:
print(a**(n-1))
exit(0)
while n > 1:
if n%k != 0:
if n<k:
n -= 1
anw += a*(n%k)
n -= n%k
else:
toMinus = (n-n//k)*a
anw += min(toMinus, b)
n //= k
print(anw)
|
print(a**(n-1))
| 8 |
operation
|
n = int(input())
k = int(input())
a = int(input())
b = int(input())
anw = 0
if k == 1:
print(a*(n-1))
exit(0)
while n > 1:
if n%k != 0:
if n<k:
n -= 1
anw += a*(n%k)
n -= n%k
else:
toMinus = (n-n//k)*a
anw += min(toMinus, b)
n //= k
print(anw)
|
n = int(input())
k = int(input())
a = int(input())
b = int(input())
anw = 0
if k == 1:
print(a*(n-1))
exit(0)
while n > 1:
if n%k != 0:
if n<k:
n -= 1
anw += a*(n%k)
n -= n+k
else:
toMinus = (n-n//k)*a
anw += min(toMinus, b)
n //= k
print(anw)
|
n -= n+k
| 16 |
operation
|
n = int(input())
k = int(input())
a = int(input())
b = int(input())
anw = 0
if k == 1:
print(a*(n-1))
exit(0)
while n > 1:
if n%k != 0:
if n<k:
n -= 1
anw += a*(n%k)
n -= n%k
else:
toMinus = (n-n//k)*a
anw += min(toMinus, b)
n //= k
print(anw)
|
n = int(input())
k = int(input())
a = int(input())
b = int(input())
anw = 0
if k == 1:
print(a*(n-194))
exit(0)
while n > 1:
if n%k != 0:
if n<k:
n -= 1
anw += a*(n%k)
n -= n%k
else:
toMinus = (n-n//k)*a
anw += min(toMinus, b)
n //= k
print(anw)
|
print(a*(n-194))
| 8 |
value
|
s=list(map(str,input())); q=input(); ans=""
m=sorted(list(map(str,s)),reverse=True)
def find(value,lis):
m=lis[0]; ind=0
for i in range(1,len(lis)):
if lis[i]<value and lis[i]>m:
m=lis[i]
ind=i
return m
if len(s)<len(q):
ans="".join(m)
else:
leng=len(s)
l=len(s)-1
for i in range(len(s)):
if q[i] in s:
s.remove(q[i])
else:
l=i
break
ans=q[0:l]
if l<leng:
m=find(q[l],s)
s.remove(m)
ans+=m
if l<leng-1:
lis1=sorted(s,reverse=True)
ans+=''.join(lis1)
else:
pass
print(ans)
|
s=list(map(str,input())); q=input(); ans=""
m=sorted(list(map(str,s)),reverse=True)
def find(value,lis):
m=lis[0]; ind=0
for i in range(1,len(lis)):
if lis[i]<value and lis[i]>m:
m=lis[i]
ind=i
return m
if len(s)<len(q):
ans="".join(m)
else:
leng=len(s)
l=len(s)-1
for i in range(len(s)):
if q[i] in s:
s.remove(q[i])
else:
l=i
break
ans=q[0:l]
if l<leng:
m=find(q[l],s)
s.remove(m)
ans+=m
if l>leng-1:
lis1=sorted(s,reverse=True)
ans+=''.join(lis1)
else:
pass
print(ans)
|
if l>leng-1:
| 27 |
decision
|
s=list(map(str,input())); q=input(); ans=""
m=sorted(list(map(str,s)),reverse=True)
def find(value,lis):
m=lis[0]; ind=0
for i in range(1,len(lis)):
if lis[i]<value and lis[i]>m:
m=lis[i]
ind=i
return m
if len(s)<len(q):
ans="".join(m)
else:
leng=len(s)
l=len(s)-1
for i in range(len(s)):
if q[i] in s:
s.remove(q[i])
else:
l=i
break
ans=q[0:l]
if l<leng:
m=find(q[l],s)
s.remove(m)
ans+=m
if l<leng-1:
lis1=sorted(s,reverse=True)
ans+=''.join(lis1)
else:
pass
print(ans)
|
s=list(map(str,input())); q=input(); ans=""
m=sorted(list(map(str,s)),reverse=True)
def find(value,lis):
m=lis[0]; ind=0
for i in range(1,len(lis)):
if lis[i]<value and lis[i]>m:
m=lis[i]
ind=i
return m
if len(s)<len(q):
ans="".join(m)
else:
leng=len(s)
l=len(s)-18
for i in range(len(s)):
if q[i] in s:
s.remove(q[i])
else:
l=i
break
ans=q[0:l]
if l<leng:
m=find(q[l],s)
s.remove(m)
ans+=m
if l<leng-1:
lis1=sorted(s,reverse=True)
ans+=''.join(lis1)
else:
pass
print(ans)
|
l=len(s)-18
| 14 |
value
|
s=list(map(str,input())); q=input(); ans=""
m=sorted(list(map(str,s)),reverse=True)
def find(value,lis):
m=lis[0]; ind=0
for i in range(1,len(lis)):
if lis[i]<value and lis[i]>m:
m=lis[i]
ind=i
return m
if len(s)<len(q):
ans="".join(m)
else:
leng=len(s)
l=len(s)-1
for i in range(len(s)):
if q[i] in s:
s.remove(q[i])
else:
l=i
break
ans=q[0:l]
if l<leng:
m=find(q[l],s)
s.remove(m)
ans+=m
if l<leng-1:
lis1=sorted(s,reverse=True)
ans+=''.join(lis1)
else:
pass
print(ans)
|
s=list(map(str,input())); q=input(); ans=""
m=sorted(list(map(str,s)),reverse=True)
def find(value,lis):
m=lis[0]; ind=0
for i in range(1,len(lis)):
if lis[i]<value and lis[i]>m:
m=lis[i]
ind=i
return m
if len(s)<len(q):
ans="".join(m)
else:
leng=len(s)
l=len(s)-1
for i in range(len(s)):
if q[i] in s:
s.remove(q[i])
else:
l=i
break
ans=q[0:l]
if l>leng:
m=find(q[l],s)
s.remove(m)
ans+=m
if l<leng-1:
lis1=sorted(s,reverse=True)
ans+=''.join(lis1)
else:
pass
print(ans)
|
if l>leng:
| 23 |
decision
|
s=list(map(str,input())); q=input(); ans=""
m=sorted(list(map(str,s)),reverse=True)
def find(value,lis):
m=lis[0]; ind=0
for i in range(1,len(lis)):
if lis[i]<value and lis[i]>m:
m=lis[i]
ind=i
return m
if len(s)<len(q):
ans="".join(m)
else:
leng=len(s)
l=len(s)-1
for i in range(len(s)):
if q[i] in s:
s.remove(q[i])
else:
l=i
break
ans=q[0:l]
if l<leng:
m=find(q[l],s)
s.remove(m)
ans+=m
if l<leng-1:
lis1=sorted(s,reverse=True)
ans+=''.join(lis1)
else:
pass
print(ans)
|
s=list(map(str,input())); q=input(); ans=""
m=sorted(list(map(str,s)),reverse=True)
def find(value,lis):
m=lis[0]; ind=0
for i in range(1,len(lis)):
if lis[i]<value and lis[i]>m:
m=lis[i]
ind=i
return m
if len(s)<len(q):
ans="".join(m)
else:
leng=len(s)
l=len(s)-1
for i in range(len(s)):
if q[i] in s:
s.remove(q[i])
else:
l=i
break
ans=q[0:l]
if l<leng:
m=find(q[l],s)
s.remove(m)
ans+=m
if l>leng-1:
lis1=sorted(s,reverse=True)
ans+=''.join(lis1)
else:
pass
print(ans)
|
if l>leng-1:
| 27 |
decision
|
n = int(input())
a = list(map(int, input().split()))
v = list()
last, cnt = a[0], 0
for i in range(n):
if a[i] == last:
cnt += 1
else:
v.append(cnt)
cnt = 1
last = a[i]
v.append(cnt)
f = True
for e in v:
if e != v[0]:
f = False
if (f):
print('YES')
else:
print('NO')
|
n = int(input())
a = list(map(int, input().split()))
v = list()
last, cnt = y[0], 0
for i in range(n):
if a[i] == last:
cnt += 1
else:
v.append(cnt)
cnt = 1
last = a[i]
v.append(cnt)
f = True
for e in v:
if e != v[0]:
f = False
if (f):
print('YES')
else:
print('NO')
|
last, cnt = y[0], 0
| 4 |
statement
|
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 (a+b)+2==0:
| 11 |
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 z>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 z>a:
| 7 |
statement
|
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==7:
cur=(a+b)//2
else:
cur=(a+b)/Decimal(2)
print(cur/math.floor(cur))
|
if (a+b)%2==7:
| 11 |
value
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.