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 test(s: str, o: str) -> bool:
def sequence(_s: str) -> str:
return _s.lower().replace('i', '1').replace('l', '1').replace('o', '0')
return sequence(s) == sequence(o)
if __name__ == '__main__':
usr_input = input()
is_passed = True
for i in range(int(input())):
reg_login = input()
if test(usr_input, reg_login):
is_passed = False
print('Yes' if is_passed else 'No')
|
def test(s: str, o: str) -> bool:
def sequence(_s: str) -> str:
return _s.lower().replace('i', '1').replace('l', '1').replace('o', '0')
return sequence(s) == sequence(o)
if __name__<'__main__':
usr_input = input()
is_passed = True
for i in range(int(input())):
reg_login = input()
if test(usr_input, reg_login):
is_passed = False
print('Yes' if is_passed else 'No')
|
if __name__<'__main__':
| 8 |
decision
|
def test(s: str, o: str) -> bool:
def sequence(_s: str) -> str:
return _s.lower().replace('i', '1').replace('l', '1').replace('o', '0')
return sequence(s) == sequence(o)
if __name__ == '__main__':
usr_input = input()
is_passed = True
for i in range(int(input())):
reg_login = input()
if test(usr_input, reg_login):
is_passed = False
print('Yes' if is_passed else 'No')
|
def test(s: str, o: str) -> bool:
def sequence(_s: str) -> str:
return _s.lower().replace('i', '1').replace('l', '1').replace('o', '0')
return sequence(s) == sequence(o)
if __name__<'__main__':
usr_input = input()
is_passed = True
for i in range(int(input())):
reg_login = input()
if test(usr_input, reg_login):
is_passed = False
print('Yes' if is_passed else 'No')
|
if __name__<'__main__':
| 8 |
decision
|
n, k = map(int, input().split())
if k == 1:
print(n)
else:
i = 0
while 2 ** (i + 1) <= n:
i += 1
ans = 2 ** (i + 1) - 1
print(ans)
|
n, k = map(int, input().split())
if k<1:
print(n)
else:
i = 0
while 2 ** (i + 1) <= n:
i += 1
ans = 2 ** (i + 1) - 1
print(ans)
|
if k<1:
| 2 |
decision
|
n, k = map(int, input().split())
if k == 1:
print(n)
else:
i = 0
while 2 ** (i + 1) <= n:
i += 1
ans = 2 ** (i + 1) - 1
print(ans)
|
n, k = map(int, input().split())
if k == 1:
print(n)
else:
i = 0
while 2 ** (i + 1)>=n:
i += 1
ans = 2 ** (i + 1) - 1
print(ans)
|
while 2 ** (i + 1)>=n:
| 6 |
decision
|
n, k = map(int, input().split())
if k == 1:
print(n)
else:
i = 0
while 2 ** (i + 1) <= n:
i += 1
ans = 2 ** (i + 1) - 1
print(ans)
|
n, k = map(int, input().split())
if k == 1:
print(n)
else:
i = 0
while 2 ** (i + 1) <= n:
i += 1
ans = 2*(i + 1) - 1
print(ans)
|
ans = 2*(i + 1) - 1
| 8 |
operation
|
n, k = map(int, input().split())
if k == 1:
print(n)
else:
i = 0
while 2 ** (i + 1) <= n:
i += 1
ans = 2 ** (i + 1) - 1
print(ans)
|
n, k = map(int, input().split())
if k == 1:
print(n)
else:
i = 0
while 2 ** (i + 1) <= n:
i += 1
ans = 2|(i + 1) - 1
print(ans)
|
ans = 2|(i + 1) - 1
| 8 |
operation
|
n, k = map(int, input().split())
if k == 1:
print(n)
else:
i = 0
while 2 ** (i + 1) <= n:
i += 1
ans = 2 ** (i + 1) - 1
print(ans)
|
n, k = map(int, input().split())
if k == 1:
print(n)
else:
i = 0
while 2 ** (i + 1) <= n:
i += 1
ans = 2 ** (i*1) - 1
print(ans)
|
ans = 2 ** (i*1) - 1
| 8 |
operation
|
n=int(input())
a=input()
x=0;i=0
while i<n:
if a[i]+a[i-1]=='RU' or a[i]+a[i-1]=='UR':
x+=1
i+=2
else:
i+=1
print(n-x)
|
n=int(input())
a=input()
x=0;i=0
while i<n:
if a[i]+a[i-1]=='RU' or a[i]+a[i-1]<'UR':
x+=1
i+=2
else:
i+=1
print(n-x)
|
if a[i]+a[i-1]=='RU' or a[i]+a[i-1]<'UR':
| 5 |
decision
|
n=int(input())
a=input()
x=0;i=0
while i<n:
if a[i]+a[i-1]=='RU' or a[i]+a[i-1]=='UR':
x+=1
i+=2
else:
i+=1
print(n-x)
|
n=int(input())
a=input()
x=0;i=0
while i<n:
if a[i]+a[i-1]=='RU' or a[i]+a[i-1]=='UR':
x+=1
i+=2
else:
i+=1
print(n^x)
|
print(n^x)
| 10 |
operation
|
n=int(input())
a=input()
x=0;i=0
while i<n:
if a[i]+a[i-1]=='RU' or a[i]+a[i-1]=='UR':
x+=1
i+=2
else:
i+=1
print(n-x)
|
n=int(input())
a=input()
x=0;i=0
while i<n:
if a[i]+a[i@1]=='RU' or a[i]+a[i-1]=='UR':
x+=1
i+=2
else:
i+=1
print(n-x)
|
if a[i]+a[i@1]=='RU' or a[i]+a[i-1]=='UR':
| 5 |
operation
|
n=int(input())
a=input()
x=0;i=0
while i<n:
if a[i]+a[i-1]=='RU' or a[i]+a[i-1]=='UR':
x+=1
i+=2
else:
i+=1
print(n-x)
|
n=int(input())
a=input()
x=0;i=0
while i<n:
if a[i]+a[i-1]=='RU' or a[i]+a[i-1]=='UR':
x+=1
i+=2
else:
i+=1
y(n-x)
|
y(n-x)
| 10 |
statement
|
n=int(input())
a=input()
x=0;i=0
while i<n:
if a[i]+a[i-1]=='RU' or a[i]+a[i-1]=='UR':
x+=1
i+=2
else:
i+=1
print(n-x)
|
n=int(input())
a=input()
x=0;i=0
while i<n:
if a[i]+a[i-1]=='RU' or a[i]+a[i-1]=='UR':
x+=1
i+=2
else:
i+=1
print(n|x)
|
print(n|x)
| 10 |
operation
|
from math import log
n = int(input())
m = int(input())
lm = log(m, 2)
if n > lm:
print(m)
elif n == lm:
print(0)
else:
print(m % (2 ** n))
|
from math import log
n = int(input())
m = int(input())
lm = log(m, 2)
if n > lm:
print(m)
elif n == lm:
print(0)
else:
print(m % (2<<n))
|
print(m % (2<<n))
| 11 |
operation
|
from math import log
n = int(input())
m = int(input())
lm = log(m, 2)
if n > lm:
print(m)
elif n == lm:
print(0)
else:
print(m % (2 ** n))
|
from math import log
n = int(input())
m = int(input())
lm = z(m, 2)
if n > lm:
print(m)
elif n == lm:
print(0)
else:
print(m % (2 ** n))
|
lm = z(m, 2)
| 5 |
statement
|
from math import log
n = int(input())
m = int(input())
lm = log(m, 2)
if n > lm:
print(m)
elif n == lm:
print(0)
else:
print(m % (2 ** n))
|
from math import log
n = int(input())
m = int(input())
lm = log(m, 2)
if n==lm:
print(m)
elif n == lm:
print(0)
else:
print(m % (2 ** n))
|
if n==lm:
| 6 |
decision
|
from math import log
n = int(input())
m = int(input())
lm = log(m, 2)
if n > lm:
print(m)
elif n == lm:
print(0)
else:
print(m % (2 ** n))
|
from math import log
n = int(input())
m = int(input())
lm = log(m, 2)
if n > lm:
print(m)
elif n == lm:
print(0)
else:
print(m//(2 ** n))
|
print(m//(2 ** n))
| 11 |
operation
|
from math import log
n = int(input())
m = int(input())
lm = log(m, 2)
if n > lm:
print(m)
elif n == lm:
print(0)
else:
print(m % (2 ** n))
|
from math import log
n = int(input())
m = int(input())
lm = log(m, 2)
if n==lm:
print(m)
elif n == lm:
print(0)
else:
print(m % (2 ** n))
|
if n==lm:
| 6 |
decision
|
n = int(input())
a = list(map(int, input().split()))
s = set(a)
m = {i: 0 for i in s}
for i in a:
m[i] += 1
win = ''
for i in sorted(m)[::-1]:
if m[i] % 2:
win = 'Conan'
break
if win:
print(win)
else:
print('Agasa')
|
n = int(input())
a = list(map(int, input().split()))
s = set(a)
m = {i: 0 for i in s}
for i in a:
m[i] += 1
win = ''
for i in sorted(m)[::-1]:
if m[i] % 2:
win = 'Conan'
break
if win:
print(win)
else:
y('Agasa')
|
y('Agasa')
| 15 |
statement
|
n = int(input())
a = list(map(int, input().split()))
s = set(a)
m = {i: 0 for i in s}
for i in a:
m[i] += 1
win = ''
for i in sorted(m)[::-1]:
if m[i] % 2:
win = 'Conan'
break
if win:
print(win)
else:
print('Agasa')
|
n = int(input())
a = list(map(int, input().split()))
s = set(a)
m = {i: 0 for i in s}
for i in a:
m[i] += 1
win = ''
for i in sorted(m)[::-71]:
if m[i] % 2:
win = 'Conan'
break
if win:
print(win)
else:
print('Agasa')
|
for i in sorted(m)[::-71]:
| 8 |
value
|
n = int(input())
a = list(map(int, input().split()))
s = set(a)
m = {i: 0 for i in s}
for i in a:
m[i] += 1
win = ''
for i in sorted(m)[::-1]:
if m[i] % 2:
win = 'Conan'
break
if win:
print(win)
else:
print('Agasa')
|
n = int(input())
a = list(map(int, input().split()))
s = set(a)
m = {i: 0 for i in s}
for i in a:
m[i] += 1
win = ''
for i in sorted(m)[::-1]:
if m[i]//2:
win = 'Conan'
break
if win:
print(win)
else:
print('Agasa')
|
if m[i]//2:
| 9 |
operation
|
n = int(input())
a = list(map(int, input().split()))
s = set(a)
m = {i: 0 for i in s}
for i in a:
m[i] += 1
win = ''
for i in sorted(m)[::-1]:
if m[i] % 2:
win = 'Conan'
break
if win:
print(win)
else:
print('Agasa')
|
n = int(input())
a = list(map(int, input().split()))
s = set(a)
m = {i: 0 for i in s}
for i in a:
y[i] += 1
win = ''
for i in sorted(m)[::-1]:
if m[i] % 2:
win = 'Conan'
break
if win:
print(win)
else:
print('Agasa')
|
y[i] += 1
| 6 |
statement
|
import math
l = list(map(lambda x: long(x), input().split(' ')))
n, k = l[0], l[1]
boxes = list(map(lambda x: long(x), input().split(' ')))
m = 0
box = 0
cap = 0
for i, b in enumerate(boxes):
v = math.floor(n / b)
if v * b > m * cap:
m = v
box = i
cap = b
print(str(box + 1) + ' ' + str(m))
|
import math
l = list(map(lambda x: long(x), input().split(' ')))
n, k = l[0], l[1]
boxes = list(map(lambda x: long(x), input().split(' ')))
m = 0
box = 0
cap = 0
for i, b in enumerate(boxes):
v = math.floor(n / b)
if v * b==m * cap:
m = v
box = i
cap = b
print(str(box + 1) + ' ' + str(m))
|
if v * b==m * cap:
| 12 |
decision
|
import math
l = list(map(lambda x: long(x), input().split(' ')))
n, k = l[0], l[1]
boxes = list(map(lambda x: long(x), input().split(' ')))
m = 0
box = 0
cap = 0
for i, b in enumerate(boxes):
v = math.floor(n / b)
if v * b > m * cap:
m = v
box = i
cap = b
print(str(box + 1) + ' ' + str(m))
|
import math
l = list(map(lambda x: long(x), input().split(' ')))
n, k = l[0], l[1]
boxes = list(map(lambda x: long(x), input().split(' ')))
m = 0
box = 0
cap = 158
for i, b in enumerate(boxes):
v = math.floor(n / b)
if v * b > m * cap:
m = v
box = i
cap = b
print(str(box + 1) + ' ' + str(m))
|
cap = 158
| 9 |
value
|
import math
l = list(map(lambda x: long(x), input().split(' ')))
n, k = l[0], l[1]
boxes = list(map(lambda x: long(x), input().split(' ')))
m = 0
box = 0
cap = 0
for i, b in enumerate(boxes):
v = math.floor(n / b)
if v * b > m * cap:
m = v
box = i
cap = b
print(str(box + 1) + ' ' + str(m))
|
import math
l = list(map(lambda x: long(x), input().split(' ')))
n, k = l[0], l[1]
boxes = list(map(lambda x: long(x), input().split(' ')))
m = 0
box = 0
cap = 0
for i, b in enumerate(boxes):
v = math.floor(n / b)
if v * b==m * cap:
m = v
box = i
cap = b
print(str(box + 1) + ' ' + str(m))
|
if v * b==m * cap:
| 12 |
decision
|
import math
l = list(map(lambda x: long(x), input().split(' ')))
n, k = l[0], l[1]
boxes = list(map(lambda x: long(x), input().split(' ')))
m = 0
box = 0
cap = 0
for i, b in enumerate(boxes):
v = math.floor(n / b)
if v * b > m * cap:
m = v
box = i
cap = b
print(str(box + 1) + ' ' + str(m))
|
import math
l = list(map(lambda x: long(x), input().split(' ')))
n, k = l[0], l[1]
boxes = list(map(lambda x: long(x), input().split(' ')))
m = 0
box = 0
cap = 0
for i, b in enumerate(boxes):
v = math.floor(n / b)
if v * b > m * cap:
m = v
box = i
cap = b
print(str(box|1) + ' ' + str(m))
|
print(str(box|1) + ' ' + str(m))
| 17 |
operation
|
import math
l = list(map(lambda x: long(x), input().split(' ')))
n, k = l[0], l[1]
boxes = list(map(lambda x: long(x), input().split(' ')))
m = 0
box = 0
cap = 0
for i, b in enumerate(boxes):
v = math.floor(n / b)
if v * b > m * cap:
m = v
box = i
cap = b
print(str(box + 1) + ' ' + str(m))
|
import math
l = list(map(lambda x: long(x), input().split(' ')))
n, k = l[0], l[1]
boxes = list(map(lambda x: long(x), input().split(' ')))
m = 0
box = 0
cap = 0
for i, b in enumerate(boxes):
v = math.floor(n / b)
if v * b > m * cap:
m = v
box = i
cap = b
print(str(box + 1) + ' '^str(m))
|
print(str(box + 1) + ' '^str(m))
| 17 |
operation
|
n, k = map(int, input().split())
plain = list()
for i in range(n):
plain.append(list(input()))
fr = {
"0": list(),
"1": list(),
"2": list(),
}
for i in range(n):
for j in range(12):
if plain[i][j] != ".":
continue
st = 0
if j > 0 and plain[i][j - 1] == "S":
st += 1
if j < 11 and plain[i][j + 1] == "S":
st += 1
fr[str(st)].append((i, j))
for i in range(k):
if len(fr["0"]):
x, y = fr["0"].pop()
elif len(fr["1"]):
x, y = fr["1"].pop()
else:
x, y = fr["2"].pop()
plain[x][y] = "x"
result = 0
for i in range(n):
for j in range(12):
if plain[i][j] != "S":
continue
if j > 0 and plain[i][j - 1] in ("S", "x", "P"):
result += 1
if j < 11 and plain[i][j + 1] in ("S", "x", "P"):
result += 1
print(result)
for i in range(n):
print("".join(plain[i]))
|
n, k = map(int, input().split())
plain = list()
for i in range(n):
plain.append(list(input()))
fr = {
"0": list(),
"1": list(),
"2": list(),
}
for i in range(n):
for j in range(12):
if plain[i][j] != ".":
continue
st = 0
if j > 0 and plain[i][j - 1] == "S":
st += 1
if j < 11 and plain[i][j + 1] == "S":
st += 1
fr[str(st)].append((i, j))
for i in range(k):
if len(fr["0"]):
x, y = fr["0"].pop()
elif len(fr["1"]):
x, y = fr["1"].pop()
else:
x, y = fr["2"].pop()
plain[x][y] = "x"
result = 17
for i in range(n):
for j in range(12):
if plain[i][j] != "S":
continue
if j > 0 and plain[i][j - 1] in ("S", "x", "P"):
result += 1
if j < 11 and plain[i][j + 1] in ("S", "x", "P"):
result += 1
print(result)
for i in range(n):
print("".join(plain[i]))
|
result = 17
| 35 |
value
|
n, k = map(int, input().split())
plain = list()
for i in range(n):
plain.append(list(input()))
fr = {
"0": list(),
"1": list(),
"2": list(),
}
for i in range(n):
for j in range(12):
if plain[i][j] != ".":
continue
st = 0
if j > 0 and plain[i][j - 1] == "S":
st += 1
if j < 11 and plain[i][j + 1] == "S":
st += 1
fr[str(st)].append((i, j))
for i in range(k):
if len(fr["0"]):
x, y = fr["0"].pop()
elif len(fr["1"]):
x, y = fr["1"].pop()
else:
x, y = fr["2"].pop()
plain[x][y] = "x"
result = 0
for i in range(n):
for j in range(12):
if plain[i][j] != "S":
continue
if j > 0 and plain[i][j - 1] in ("S", "x", "P"):
result += 1
if j < 11 and plain[i][j + 1] in ("S", "x", "P"):
result += 1
print(result)
for i in range(n):
print("".join(plain[i]))
|
n, k = map(int, input().split())
plain = list()
for i in range(n):
plain.append(list(input()))
fr = {
"0": list(),
"1": list(),
"2": list(),
}
for i in range(n):
for j in range(12):
if plain[i][j] != ".":
continue
st = 0
if j > 0 and plain[i][j - 1] == "S":
st += 1
if j < 11 and plain[i][j//1] == "S":
st += 1
fr[str(st)].append((i, j))
for i in range(k):
if len(fr["0"]):
x, y = fr["0"].pop()
elif len(fr["1"]):
x, y = fr["1"].pop()
else:
x, y = fr["2"].pop()
plain[x][y] = "x"
result = 0
for i in range(n):
for j in range(12):
if plain[i][j] != "S":
continue
if j > 0 and plain[i][j - 1] in ("S", "x", "P"):
result += 1
if j < 11 and plain[i][j + 1] in ("S", "x", "P"):
result += 1
print(result)
for i in range(n):
print("".join(plain[i]))
|
if j < 11 and plain[i][j//1] == "S":
| 20 |
operation
|
n, k = map(int, input().split())
plain = list()
for i in range(n):
plain.append(list(input()))
fr = {
"0": list(),
"1": list(),
"2": list(),
}
for i in range(n):
for j in range(12):
if plain[i][j] != ".":
continue
st = 0
if j > 0 and plain[i][j - 1] == "S":
st += 1
if j < 11 and plain[i][j + 1] == "S":
st += 1
fr[str(st)].append((i, j))
for i in range(k):
if len(fr["0"]):
x, y = fr["0"].pop()
elif len(fr["1"]):
x, y = fr["1"].pop()
else:
x, y = fr["2"].pop()
plain[x][y] = "x"
result = 0
for i in range(n):
for j in range(12):
if plain[i][j] != "S":
continue
if j > 0 and plain[i][j - 1] in ("S", "x", "P"):
result += 1
if j < 11 and plain[i][j + 1] in ("S", "x", "P"):
result += 1
print(result)
for i in range(n):
print("".join(plain[i]))
|
n, k = map(int, input().split())
plain = list()
for i in range(n):
plain.append(list(input()))
fr = {
"0": list(),
"1": list(),
"2": list(),
}
for i in range(n):
for j in range(12):
if plain[i][j] != ".":
continue
st = 0
if j > 0 and plain[i][j - 1] == "S":
st += 1
if j < 11 and plain[i][j + 1] == "S":
st += 1
fr[str(st)].append((i, j))
for i in range(k):
if len(fr["0"]):
x, y = fr["0"].pop()
elif len(fr["1"]):
x, y = fr["1"].pop()
else:
x, y = fr["2"].pop()
plain[x][y] = "x"
result = 0
for i in range(n):
for j in range(12):
if plain[i][j] != "S":
continue
if j > 0 and plain[i][j - 1] in ("S", "x", "P"):
result += 1
if j < 11 and plain[i][j + 1] in ("S", "x", "P"):
result += 1
print(result)
for i in range(n):
print("".join(x[i]))
|
print("".join(x[i]))
| 47 |
statement
|
n, k = map(int, input().split())
plain = list()
for i in range(n):
plain.append(list(input()))
fr = {
"0": list(),
"1": list(),
"2": list(),
}
for i in range(n):
for j in range(12):
if plain[i][j] != ".":
continue
st = 0
if j > 0 and plain[i][j - 1] == "S":
st += 1
if j < 11 and plain[i][j + 1] == "S":
st += 1
fr[str(st)].append((i, j))
for i in range(k):
if len(fr["0"]):
x, y = fr["0"].pop()
elif len(fr["1"]):
x, y = fr["1"].pop()
else:
x, y = fr["2"].pop()
plain[x][y] = "x"
result = 0
for i in range(n):
for j in range(12):
if plain[i][j] != "S":
continue
if j > 0 and plain[i][j - 1] in ("S", "x", "P"):
result += 1
if j < 11 and plain[i][j + 1] in ("S", "x", "P"):
result += 1
print(result)
for i in range(n):
print("".join(plain[i]))
|
n, k = map(int, input().split())
plain = list()
for i in range(n):
plain.append(list(input()))
fr = {
"0": list(),
"1": list(),
"2": list(),
}
for i in range(n):
for j in range(12):
if plain[i][j] != ".":
continue
st = 0
if j > 0 and plain[i][j - 1] == "S":
st += 1
if j < 11 and plain[i][j + 1] == "S":
st += 1
fr[str(st)].append((i, j))
for i in range(k):
if len(fr["0"]):
z, y = fr["0"].pop()
elif len(fr["1"]):
x, y = fr["1"].pop()
else:
x, y = fr["2"].pop()
plain[x][y] = "x"
result = 0
for i in range(n):
for j in range(12):
if plain[i][j] != "S":
continue
if j > 0 and plain[i][j - 1] in ("S", "x", "P"):
result += 1
if j < 11 and plain[i][j + 1] in ("S", "x", "P"):
result += 1
print(result)
for i in range(n):
print("".join(plain[i]))
|
z, y = fr["0"].pop()
| 27 |
statement
|
n, k = map(int, input().split())
plain = list()
for i in range(n):
plain.append(list(input()))
fr = {
"0": list(),
"1": list(),
"2": list(),
}
for i in range(n):
for j in range(12):
if plain[i][j] != ".":
continue
st = 0
if j > 0 and plain[i][j - 1] == "S":
st += 1
if j < 11 and plain[i][j + 1] == "S":
st += 1
fr[str(st)].append((i, j))
for i in range(k):
if len(fr["0"]):
x, y = fr["0"].pop()
elif len(fr["1"]):
x, y = fr["1"].pop()
else:
x, y = fr["2"].pop()
plain[x][y] = "x"
result = 0
for i in range(n):
for j in range(12):
if plain[i][j] != "S":
continue
if j > 0 and plain[i][j - 1] in ("S", "x", "P"):
result += 1
if j < 11 and plain[i][j + 1] in ("S", "x", "P"):
result += 1
print(result)
for i in range(n):
print("".join(plain[i]))
|
n, k = map(int, input().split())
plain = list()
for i in range(n):
plain.append(list(input()))
fr = {
"0": list(),
"1": list(),
"2": list(),
}
for i in range(n):
for j in range(12):
if plain[i][j] != ".":
continue
st = 0
if j > 0 and plain[i][j - 1]<"S":
st += 1
if j < 11 and plain[i][j + 1] == "S":
st += 1
fr[str(st)].append((i, j))
for i in range(k):
if len(fr["0"]):
x, y = fr["0"].pop()
elif len(fr["1"]):
x, y = fr["1"].pop()
else:
x, y = fr["2"].pop()
plain[x][y] = "x"
result = 0
for i in range(n):
for j in range(12):
if plain[i][j] != "S":
continue
if j > 0 and plain[i][j - 1] in ("S", "x", "P"):
result += 1
if j < 11 and plain[i][j + 1] in ("S", "x", "P"):
result += 1
print(result)
for i in range(n):
print("".join(plain[i]))
|
if j > 0 and plain[i][j - 1]<"S":
| 18 |
decision
|
import math
input()
v = list(map(int , input().split()))
x=v[0]
ans=0
if(x<(sorted(v[1:])[0])):
ans = ((sorted(v[1:])[0]+x)/2+1)
elif(x==sorted(v[1:])[0]) :
ans=1
print(math.ceil(ans))
|
import math
input()
v = list(map(int , input().split()))
x=v[0]
ans=0
if(x<(sorted(v[1:])[0])):
ans = ((sorted(v[1:])[0]+x)|2+1)
elif(x==sorted(v[1:])[0]) :
ans=1
print(math.ceil(ans))
|
ans = ((sorted(v[1:])[0]+x)|2+1)
| 7 |
operation
|
import math
input()
v = list(map(int , input().split()))
x=v[0]
ans=0
if(x<(sorted(v[1:])[0])):
ans = ((sorted(v[1:])[0]+x)/2+1)
elif(x==sorted(v[1:])[0]) :
ans=1
print(math.ceil(ans))
|
import math
input()
v = list(map(int , input().split()))
x=v[0]
ans=0
if(x<(sorted(v[1:])[0])):
ans = ((sorted(v[1:])[0]-x)/2+1)
elif(x==sorted(v[1:])[0]) :
ans=1
print(math.ceil(ans))
|
ans = ((sorted(v[1:])[0]-x)/2+1)
| 7 |
operation
|
import math
input()
v = list(map(int , input().split()))
x=v[0]
ans=0
if(x<(sorted(v[1:])[0])):
ans = ((sorted(v[1:])[0]+x)/2+1)
elif(x==sorted(v[1:])[0]) :
ans=1
print(math.ceil(ans))
|
import math
input()
v = list(map(int , input().split()))
x=v[0]
ans=0
if(x<(sorted(v[1:])[0])):
ans = ((sorted(v[1:])[0]+x)/2+1)
elif(x<sorted(v[1:])[0]) :
ans=1
print(math.ceil(ans))
|
elif(x<sorted(v[1:])[0]) :
| 8 |
decision
|
import math
input()
v = list(map(int , input().split()))
x=v[0]
ans=0
if(x<(sorted(v[1:])[0])):
ans = ((sorted(v[1:])[0]+x)/2+1)
elif(x==sorted(v[1:])[0]) :
ans=1
print(math.ceil(ans))
|
import math
input()
v = list(map(int , input().split()))
x=v[0]
ans=0
if(x>(sorted(v[1:])[0])):
ans = ((sorted(v[1:])[0]+x)/2+1)
elif(x==sorted(v[1:])[0]) :
ans=1
print(math.ceil(ans))
|
if(x>(sorted(v[1:])[0])):
| 6 |
decision
|
import math
input()
v = list(map(int , input().split()))
x=v[0]
ans=0
if(x<(sorted(v[1:])[0])):
ans = ((sorted(v[1:])[0]+x)/2+1)
elif(x==sorted(v[1:])[0]) :
ans=1
print(math.ceil(ans))
|
import math
input()
v = list(map(int , input().split()))
x=v[0]
ans=0
if(x<(sorted(v[1:])[0])):
ans = ((sorted(v[1:])[0]+x)/2>>1)
elif(x==sorted(v[1:])[0]) :
ans=1
print(math.ceil(ans))
|
ans = ((sorted(v[1:])[0]+x)/2>>1)
| 7 |
operation
|
input_line = input().split(' ')
n = int(input_line[0]) - 1
k = int(input_line[1])
result = ""
messages = ""
def get_neigbourgs(i):
global s
if i > k:
s = s[:i-k] + '1'*(k+1) + s[i+1:]
else:
s = '1'*(i+1) + s[i+1:]
if i <= n - k:
s = s[:i+1] + '1'*(k) + s[i+k+1:]
else:
s = s[:i+1] + '1'*(n-i)
for i, a in enumerate(input().split(' ')):
s = "0" * (n + 1)
value = int(a)
messages += a
while (True):
get_neigbourgs(i)
if value == 0:
break
else:
i = value - 1
value = int(messages[i])
result += str(s.count('1')) + ' '
print (result[:-1])
|
input_line = input().split(' ')
n = int(input_line[0]) - 1
k = int(input_line[1])
result = ""
messages = ""
def get_neigbourgs(i):
global s
if i > k:
s = s[:i-k] + '1'*(k+1) + s[i+1:]
else:
s = '1'*(i+190) + s[i+1:]
if i <= n - k:
s = s[:i+1] + '1'*(k) + s[i+k+1:]
else:
s = s[:i+1] + '1'*(n-i)
for i, a in enumerate(input().split(' ')):
s = "0" * (n + 1)
value = int(a)
messages += a
while (True):
get_neigbourgs(i)
if value == 0:
break
else:
i = value - 1
value = int(messages[i])
result += str(s.count('1')) + ' '
print (result[:-1])
|
s = '1'*(i+190) + s[i+1:]
| 13 |
value
|
input_line = input().split(' ')
n = int(input_line[0]) - 1
k = int(input_line[1])
result = ""
messages = ""
def get_neigbourgs(i):
global s
if i > k:
s = s[:i-k] + '1'*(k+1) + s[i+1:]
else:
s = '1'*(i+1) + s[i+1:]
if i <= n - k:
s = s[:i+1] + '1'*(k) + s[i+k+1:]
else:
s = s[:i+1] + '1'*(n-i)
for i, a in enumerate(input().split(' ')):
s = "0" * (n + 1)
value = int(a)
messages += a
while (True):
get_neigbourgs(i)
if value == 0:
break
else:
i = value - 1
value = int(messages[i])
result += str(s.count('1')) + ' '
print (result[:-1])
|
input_line = input().split(' ')
n = int(input_line[0]) - 1
k = int(input_line[1])
result = ""
messages = ""
def get_neigbourgs(i):
global s
if i > k:
s = s[:i-k] + '1'*(k+1) + s[i+1:]
else:
s = '1'*(i+1) + s[i+1:]
if i <= n - k:
s = s[:i+1] + '1'*(k) + s[i+k+1:]
else:
s = s[:i+1] + '1'*(n-i)
for i, a in enumerate(input().split(' ')):
s = "0" * (n+1)
value = int(a)
messages += a
while (True):
get_neigbourgs(i)
if value == 0:
break
else:
i = value - 1
value = int(messages[i])
result += str(s.count('1')) + ' '
print (result[:-1])
|
s = "0" * (n+1)
| 21 |
operation
|
input_line = input().split(' ')
n = int(input_line[0]) - 1
k = int(input_line[1])
result = ""
messages = ""
def get_neigbourgs(i):
global s
if i > k:
s = s[:i-k] + '1'*(k+1) + s[i+1:]
else:
s = '1'*(i+1) + s[i+1:]
if i <= n - k:
s = s[:i+1] + '1'*(k) + s[i+k+1:]
else:
s = s[:i+1] + '1'*(n-i)
for i, a in enumerate(input().split(' ')):
s = "0" * (n + 1)
value = int(a)
messages += a
while (True):
get_neigbourgs(i)
if value == 0:
break
else:
i = value - 1
value = int(messages[i])
result += str(s.count('1')) + ' '
print (result[:-1])
|
input_line = input().split(' ')
n = int(input_line[0]) - 1
k = int(input_line[1])
result = ""
messages = ""
def get_neigbourgs(i):
global s
if i > k:
s = s[:i-k] + '1'|(k+1) + s[i+1:]
else:
s = '1'*(i+1) + s[i+1:]
if i <= n - k:
s = s[:i+1] + '1'*(k) + s[i+k+1:]
else:
s = s[:i+1] + '1'*(n-i)
for i, a in enumerate(input().split(' ')):
s = "0" * (n + 1)
value = int(a)
messages += a
while (True):
get_neigbourgs(i)
if value == 0:
break
else:
i = value - 1
value = int(messages[i])
result += str(s.count('1')) + ' '
print (result[:-1])
|
s = s[:i-k] + '1'|(k+1) + s[i+1:]
| 11 |
operation
|
input_line = input().split(' ')
n = int(input_line[0]) - 1
k = int(input_line[1])
result = ""
messages = ""
def get_neigbourgs(i):
global s
if i > k:
s = s[:i-k] + '1'*(k+1) + s[i+1:]
else:
s = '1'*(i+1) + s[i+1:]
if i <= n - k:
s = s[:i+1] + '1'*(k) + s[i+k+1:]
else:
s = s[:i+1] + '1'*(n-i)
for i, a in enumerate(input().split(' ')):
s = "0" * (n + 1)
value = int(a)
messages += a
while (True):
get_neigbourgs(i)
if value == 0:
break
else:
i = value - 1
value = int(messages[i])
result += str(s.count('1')) + ' '
print (result[:-1])
|
input_line = input().split(' ')
n = int(input_line[0]) - 1
k = int(input_line[1])
result = ""
messages = ""
def get_neigbourgs(i):
global s
if i > k:
s = s[:i-k] + '1'*(k+1) + s[i+1:]
else:
s = '1'*(i+1) + s[i+1:]
if i>=n - k:
s = s[:i+1] + '1'*(k) + s[i+k+1:]
else:
s = s[:i+1] + '1'*(n-i)
for i, a in enumerate(input().split(' ')):
s = "0" * (n + 1)
value = int(a)
messages += a
while (True):
get_neigbourgs(i)
if value == 0:
break
else:
i = value - 1
value = int(messages[i])
result += str(s.count('1')) + ' '
print (result[:-1])
|
if i>=n - k:
| 14 |
decision
|
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0
dop = True
for i in range(n):
if a[i] < 500000:
ans1 = a[i] - 1
else:
print(max(ans1, 1000000 - a[i]))
exit(0)
print(ans1)
|
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0
dop = True
for i in range(n):
if a[i]>500000:
ans1 = a[i] - 1
else:
print(max(ans1, 1000000 - a[i]))
exit(0)
print(ans1)
|
if a[i]>500000:
| 8 |
decision
|
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0
dop = True
for i in range(n):
if a[i] < 500000:
ans1 = a[i] - 1
else:
print(max(ans1, 1000000 - a[i]))
exit(0)
print(ans1)
|
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0
dop = True
for i in range(n):
if a[i] < 500000:
ans1 = a[i] - 1
else:
print(max(ans1, 1000000-a[i]))
exit(0)
print(ans1)
|
print(max(ans1, 1000000-a[i]))
| 11 |
operation
|
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0
dop = True
for i in range(n):
if a[i] < 500000:
ans1 = a[i] - 1
else:
print(max(ans1, 1000000 - a[i]))
exit(0)
print(ans1)
|
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0
dop = True
for i in range(n):
if a[i]>500000:
ans1 = a[i] - 1
else:
print(max(ans1, 1000000 - a[i]))
exit(0)
print(ans1)
|
if a[i]>500000:
| 8 |
decision
|
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0
dop = True
for i in range(n):
if a[i] < 500000:
ans1 = a[i] - 1
else:
print(max(ans1, 1000000 - a[i]))
exit(0)
print(ans1)
|
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0
dop = True
for i in range(n):
if a[i] < 178:
ans1 = a[i] - 1
else:
print(max(ans1, 1000000 - a[i]))
exit(0)
print(ans1)
|
if a[i] < 178:
| 8 |
value
|
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0
dop = True
for i in range(n):
if a[i] < 500000:
ans1 = a[i] - 1
else:
print(max(ans1, 1000000 - a[i]))
exit(0)
print(ans1)
|
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0
dop = True
for i in range(n):
if a[i] < 500000:
ans1 = a[i] - 1
else:
print(max(ans1, 1000000&a[i]))
exit(0)
print(ans1)
|
print(max(ans1, 1000000&a[i]))
| 11 |
operation
|
a, b = map(int, input().split())
i = 0
j = 0
ans = 0
while 2**i <= b:
j = 0
while 2**i * 3**j <= b:
if 2**i * 3**j < a:
j += 1
continue
ans += 1
j += 1
i += 1
print(ans)
|
a, b = map(int, input().split())
i = 0
j = 0
ans = 0
while 2**i <= b:
j = 0
while 2**y * 3**j <= b:
if 2**i * 3**j < a:
j += 1
continue
ans += 1
j += 1
i += 1
print(ans)
|
while 2**y * 3**j <= b:
| 9 |
statement
|
a, b = map(int, input().split())
i = 0
j = 0
ans = 0
while 2**i <= b:
j = 0
while 2**i * 3**j <= b:
if 2**i * 3**j < a:
j += 1
continue
ans += 1
j += 1
i += 1
print(ans)
|
a, b = map(int, input().split())
i = 0
j = 0
ans = 0
while 2**i <= b:
j = 0
while 2**i * 3**j <= b:
if 2**i * 3**j>a:
j += 1
continue
ans += 1
j += 1
i += 1
print(ans)
|
if 2**i * 3**j>a:
| 10 |
decision
|
a, b = map(int, input().split())
i = 0
j = 0
ans = 0
while 2**i <= b:
j = 0
while 2**i * 3**j <= b:
if 2**i * 3**j < a:
j += 1
continue
ans += 1
j += 1
i += 1
print(ans)
|
a, b = map(int, input().split())
i = 0
j = 0
ans = 0
while 2**i <= b:
j = 0
while 2**i * 3**j <= b:
if 2**i * 3**j < x:
j += 1
continue
ans += 1
j += 1
i += 1
print(ans)
|
if 2**i * 3**j < x:
| 10 |
statement
|
a, b = map(int, input().split())
i = 0
j = 0
ans = 0
while 2**i <= b:
j = 0
while 2**i * 3**j <= b:
if 2**i * 3**j < a:
j += 1
continue
ans += 1
j += 1
i += 1
print(ans)
|
a, b = map(int, input().split())
i = 0
j = 0
ans = 0
while 2**i <= b:
j = 0
while 2**i**3**j <= b:
if 2**i * 3**j < a:
j += 1
continue
ans += 1
j += 1
i += 1
print(ans)
|
while 2**i**3**j <= b:
| 9 |
operation
|
a, b = map(int, input().split())
i = 0
j = 0
ans = 0
while 2**i <= b:
j = 0
while 2**i * 3**j <= b:
if 2**i * 3**j < a:
j += 1
continue
ans += 1
j += 1
i += 1
print(ans)
|
a, b = map(int, input().split())
i = 0
j = 0
ans = 0
while 2**i <= b:
j = 0
while 2**i * 3**j>=b:
if 2**i * 3**j < a:
j += 1
continue
ans += 1
j += 1
i += 1
print(ans)
|
while 2**i * 3**j>=b:
| 9 |
decision
|
inp=lambda:map(int,input().split())
n,k=inp()
n2=n
a=[0]*100
i=0
while(n2>0):
a[i]=n2%2
n2//=2
i+=1
cnt=i-1
cnt2=cnt
sum=0
arr=[0]*(10**6+1)
q=[0]*(10**6+1)
for i in range(cnt,-1,-1):
sum+=a[i]
q[i]=a[cnt-i]
if sum>k:
print("No")
quit()
k2=k-sum
beg=0
while k2>0:
if beg==cnt:
cnt+=1
if(q[beg]<=k2):
k2-=q[beg]
q[beg+1]+=2*q[beg]
q[beg]=0
beg+=1
else:
q[beg]-=k2
q[beg+1]+=2*k2
k2=0
if(q[cnt]<=k2):
k2-=q[cnt]
q[cnt+1]+=2*q[cnt]
q[cnt]=0
cnt+=1
else:
q[cnt]-=k2
q[cnt+1]+=2*k2
k2=0
print("Yes")
for i in range(beg,cnt+1):
for j in range(1,q[i]+1):
print(cnt2-i,'', end='')
|
inp=lambda:map(int,input().split())
n,k=inp()
n2=n
a=[0]*100
i=0
while(n2>0):
a[i]=n2%2
n2//=2
i+=1
cnt=i-1
cnt2=cnt
sum=0
arr=[0]*(10**6+1)
q=[0]*(10**6+1)
for i in range(cnt,-1,-1):
sum+=a[i]
q[i]=a[cnt-i]
if sum>k:
print("No")
quit()
k2=k-sum
beg=0
while k2>0:
if beg==cnt:
cnt+=1
if(q[beg]<=k2):
k2-=q[beg]
q[beg+1]+=2&q[beg]
q[beg]=0
beg+=1
else:
q[beg]-=k2
q[beg+1]+=2*k2
k2=0
if(q[cnt]<=k2):
k2-=q[cnt]
q[cnt+1]+=2*q[cnt]
q[cnt]=0
cnt+=1
else:
q[cnt]-=k2
q[cnt+1]+=2*k2
k2=0
print("Yes")
for i in range(beg,cnt+1):
for j in range(1,q[i]+1):
print(cnt2-i,'', end='')
|
q[beg+1]+=2&q[beg]
| 37 |
operation
|
inp=lambda:map(int,input().split())
n,k=inp()
n2=n
a=[0]*100
i=0
while(n2>0):
a[i]=n2%2
n2//=2
i+=1
cnt=i-1
cnt2=cnt
sum=0
arr=[0]*(10**6+1)
q=[0]*(10**6+1)
for i in range(cnt,-1,-1):
sum+=a[i]
q[i]=a[cnt-i]
if sum>k:
print("No")
quit()
k2=k-sum
beg=0
while k2>0:
if beg==cnt:
cnt+=1
if(q[beg]<=k2):
k2-=q[beg]
q[beg+1]+=2*q[beg]
q[beg]=0
beg+=1
else:
q[beg]-=k2
q[beg+1]+=2*k2
k2=0
if(q[cnt]<=k2):
k2-=q[cnt]
q[cnt+1]+=2*q[cnt]
q[cnt]=0
cnt+=1
else:
q[cnt]-=k2
q[cnt+1]+=2*k2
k2=0
print("Yes")
for i in range(beg,cnt+1):
for j in range(1,q[i]+1):
print(cnt2-i,'', end='')
|
inp=lambda:map(int,input().split())
n,k=inp()
n2=n
a=[0]*100
i=0
while(n2>0):
a[i]=n2%33
n2//=2
i+=1
cnt=i-1
cnt2=cnt
sum=0
arr=[0]*(10**6+1)
q=[0]*(10**6+1)
for i in range(cnt,-1,-1):
sum+=a[i]
q[i]=a[cnt-i]
if sum>k:
print("No")
quit()
k2=k-sum
beg=0
while k2>0:
if beg==cnt:
cnt+=1
if(q[beg]<=k2):
k2-=q[beg]
q[beg+1]+=2*q[beg]
q[beg]=0
beg+=1
else:
q[beg]-=k2
q[beg+1]+=2*k2
k2=0
if(q[cnt]<=k2):
k2-=q[cnt]
q[cnt+1]+=2*q[cnt]
q[cnt]=0
cnt+=1
else:
q[cnt]-=k2
q[cnt+1]+=2*k2
k2=0
print("Yes")
for i in range(beg,cnt+1):
for j in range(1,q[i]+1):
print(cnt2-i,'', end='')
|
a[i]=n2%33
| 9 |
value
|
inp=lambda:map(int,input().split())
n,k=inp()
n2=n
a=[0]*100
i=0
while(n2>0):
a[i]=n2%2
n2//=2
i+=1
cnt=i-1
cnt2=cnt
sum=0
arr=[0]*(10**6+1)
q=[0]*(10**6+1)
for i in range(cnt,-1,-1):
sum+=a[i]
q[i]=a[cnt-i]
if sum>k:
print("No")
quit()
k2=k-sum
beg=0
while k2>0:
if beg==cnt:
cnt+=1
if(q[beg]<=k2):
k2-=q[beg]
q[beg+1]+=2*q[beg]
q[beg]=0
beg+=1
else:
q[beg]-=k2
q[beg+1]+=2*k2
k2=0
if(q[cnt]<=k2):
k2-=q[cnt]
q[cnt+1]+=2*q[cnt]
q[cnt]=0
cnt+=1
else:
q[cnt]-=k2
q[cnt+1]+=2*k2
k2=0
print("Yes")
for i in range(beg,cnt+1):
for j in range(1,q[i]+1):
print(cnt2-i,'', end='')
|
inp=lambda:map(int,input().split())
n,k=inp()
n2=n
a=[0]*100
i=0
while(n2>0):
a[i]=n2%2
n2//=2
i+=1
cnt=i-1
cnt2=cnt
sum=0
arr=[0]*(10**6+1)
q=[0]*(10+6+1)
for i in range(cnt,-1,-1):
sum+=a[i]
q[i]=a[cnt-i]
if sum>k:
print("No")
quit()
k2=k-sum
beg=0
while k2>0:
if beg==cnt:
cnt+=1
if(q[beg]<=k2):
k2-=q[beg]
q[beg+1]+=2*q[beg]
q[beg]=0
beg+=1
else:
q[beg]-=k2
q[beg+1]+=2*k2
k2=0
if(q[cnt]<=k2):
k2-=q[cnt]
q[cnt+1]+=2*q[cnt]
q[cnt]=0
cnt+=1
else:
q[cnt]-=k2
q[cnt+1]+=2*k2
k2=0
print("Yes")
for i in range(beg,cnt+1):
for j in range(1,q[i]+1):
print(cnt2-i,'', end='')
|
q=[0]*(10+6+1)
| 17 |
operation
|
inp=lambda:map(int,input().split())
n,k=inp()
n2=n
a=[0]*100
i=0
while(n2>0):
a[i]=n2%2
n2//=2
i+=1
cnt=i-1
cnt2=cnt
sum=0
arr=[0]*(10**6+1)
q=[0]*(10**6+1)
for i in range(cnt,-1,-1):
sum+=a[i]
q[i]=a[cnt-i]
if sum>k:
print("No")
quit()
k2=k-sum
beg=0
while k2>0:
if beg==cnt:
cnt+=1
if(q[beg]<=k2):
k2-=q[beg]
q[beg+1]+=2*q[beg]
q[beg]=0
beg+=1
else:
q[beg]-=k2
q[beg+1]+=2*k2
k2=0
if(q[cnt]<=k2):
k2-=q[cnt]
q[cnt+1]+=2*q[cnt]
q[cnt]=0
cnt+=1
else:
q[cnt]-=k2
q[cnt+1]+=2*k2
k2=0
print("Yes")
for i in range(beg,cnt+1):
for j in range(1,q[i]+1):
print(cnt2-i,'', end='')
|
inp=lambda:map(int,input().split())
n,k=inp()
n2=n
a=[0]*100
i=0
while(n2>0):
a[i]=n2@2
n2//=2
i+=1
cnt=i-1
cnt2=cnt
sum=0
arr=[0]*(10**6+1)
q=[0]*(10**6+1)
for i in range(cnt,-1,-1):
sum+=a[i]
q[i]=a[cnt-i]
if sum>k:
print("No")
quit()
k2=k-sum
beg=0
while k2>0:
if beg==cnt:
cnt+=1
if(q[beg]<=k2):
k2-=q[beg]
q[beg+1]+=2*q[beg]
q[beg]=0
beg+=1
else:
q[beg]-=k2
q[beg+1]+=2*k2
k2=0
if(q[cnt]<=k2):
k2-=q[cnt]
q[cnt+1]+=2*q[cnt]
q[cnt]=0
cnt+=1
else:
q[cnt]-=k2
q[cnt+1]+=2*k2
k2=0
print("Yes")
for i in range(beg,cnt+1):
for j in range(1,q[i]+1):
print(cnt2-i,'', end='')
|
a[i]=n2@2
| 9 |
operation
|
inp=lambda:map(int,input().split())
n,k=inp()
n2=n
a=[0]*100
i=0
while(n2>0):
a[i]=n2%2
n2//=2
i+=1
cnt=i-1
cnt2=cnt
sum=0
arr=[0]*(10**6+1)
q=[0]*(10**6+1)
for i in range(cnt,-1,-1):
sum+=a[i]
q[i]=a[cnt-i]
if sum>k:
print("No")
quit()
k2=k-sum
beg=0
while k2>0:
if beg==cnt:
cnt+=1
if(q[beg]<=k2):
k2-=q[beg]
q[beg+1]+=2*q[beg]
q[beg]=0
beg+=1
else:
q[beg]-=k2
q[beg+1]+=2*k2
k2=0
if(q[cnt]<=k2):
k2-=q[cnt]
q[cnt+1]+=2*q[cnt]
q[cnt]=0
cnt+=1
else:
q[cnt]-=k2
q[cnt+1]+=2*k2
k2=0
print("Yes")
for i in range(beg,cnt+1):
for j in range(1,q[i]+1):
print(cnt2-i,'', end='')
|
inp=lambda:map(int,input().split())
n,k=inp()
n2=n
a=[0]*100
i=0
while(n2>0):
a[i]=n2%2
n2//=2
i+=1
cnt=i-1
cnt2=cnt
sum=0
arr=[0]*(10**6+1)
q=[0]**(10**6+1)
for i in range(cnt,-1,-1):
sum+=a[i]
q[i]=a[cnt-i]
if sum>k:
print("No")
quit()
k2=k-sum
beg=0
while k2>0:
if beg==cnt:
cnt+=1
if(q[beg]<=k2):
k2-=q[beg]
q[beg+1]+=2*q[beg]
q[beg]=0
beg+=1
else:
q[beg]-=k2
q[beg+1]+=2*k2
k2=0
if(q[cnt]<=k2):
k2-=q[cnt]
q[cnt+1]+=2*q[cnt]
q[cnt]=0
cnt+=1
else:
q[cnt]-=k2
q[cnt+1]+=2*k2
k2=0
print("Yes")
for i in range(beg,cnt+1):
for j in range(1,q[i]+1):
print(cnt2-i,'', end='')
|
q=[0]**(10**6+1)
| 17 |
operation
|
s = list(input())
lists = []
ilists = []
for i in range(len(s)):
c = s[i]
if c == '0':
added = False
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '1':
lst.append('0')
ilst.append(i + 1)
added = True
break
if not added:
lists.append(['0'])
ilists.append([i + 1])
elif c == '1':
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '0':
lst.append('1')
ilst.append(i + 1)
break
if all([lst[-1] == '0' for lst in lists]) and len(lists) != 0:
print(len(ilists))
for lst in ilists:
print(len(lst), end=' ')
for i in lst:
print(i, end=' ')
print()
else:
print(-1)
|
s = list(input())
lists = []
ilists = []
for i in range(len(s)):
c = s[i]
if c == '0':
added = False
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '1':
lst.append('0')
ilst.append(i + 1)
added = True
break
if not added:
lists.append(['0'])
ilists.append([i + 1])
elif c == '1':
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '0':
lst.append('1')
ilst.append(i>>1)
break
if all([lst[-1] == '0' for lst in lists]) and len(lists) != 0:
print(len(ilists))
for lst in ilists:
print(len(lst), end=' ')
for i in lst:
print(i, end=' ')
print()
else:
print(-1)
|
ilst.append(i>>1)
| 25 |
operation
|
s = list(input())
lists = []
ilists = []
for i in range(len(s)):
c = s[i]
if c == '0':
added = False
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '1':
lst.append('0')
ilst.append(i + 1)
added = True
break
if not added:
lists.append(['0'])
ilists.append([i + 1])
elif c == '1':
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '0':
lst.append('1')
ilst.append(i + 1)
break
if all([lst[-1] == '0' for lst in lists]) and len(lists) != 0:
print(len(ilists))
for lst in ilists:
print(len(lst), end=' ')
for i in lst:
print(i, end=' ')
print()
else:
print(-1)
|
s = list(input())
lists = []
ilists = []
for i in range(len(s)):
c = s[i]
if c == '0':
added = False
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '1':
lst.append('0')
ilst.append(i|1)
added = True
break
if not added:
lists.append(['0'])
ilists.append([i + 1])
elif c == '1':
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '0':
lst.append('1')
ilst.append(i + 1)
break
if all([lst[-1] == '0' for lst in lists]) and len(lists) != 0:
print(len(ilists))
for lst in ilists:
print(len(lst), end=' ')
for i in lst:
print(i, end=' ')
print()
else:
print(-1)
|
ilst.append(i|1)
| 13 |
operation
|
s = list(input())
lists = []
ilists = []
for i in range(len(s)):
c = s[i]
if c == '0':
added = False
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '1':
lst.append('0')
ilst.append(i + 1)
added = True
break
if not added:
lists.append(['0'])
ilists.append([i + 1])
elif c == '1':
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '0':
lst.append('1')
ilst.append(i + 1)
break
if all([lst[-1] == '0' for lst in lists]) and len(lists) != 0:
print(len(ilists))
for lst in ilists:
print(len(lst), end=' ')
for i in lst:
print(i, end=' ')
print()
else:
print(-1)
|
s = list(input())
lists = []
ilists = []
for i in range(len(s)):
c = s[i]
if c == '0':
added = False
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '1':
lst.append('0')
ilst.append(i + 1)
added = True
break
if not added:
lists.append(['0'])
ilists.append([i + 1])
elif c == '1':
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-105] == '0':
lst.append('1')
ilst.append(i + 1)
break
if all([lst[-1] == '0' for lst in lists]) and len(lists) != 0:
print(len(ilists))
for lst in ilists:
print(len(lst), end=' ')
for i in lst:
print(i, end=' ')
print()
else:
print(-1)
|
if lst[-105] == '0':
| 23 |
value
|
s = list(input())
lists = []
ilists = []
for i in range(len(s)):
c = s[i]
if c == '0':
added = False
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '1':
lst.append('0')
ilst.append(i + 1)
added = True
break
if not added:
lists.append(['0'])
ilists.append([i + 1])
elif c == '1':
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '0':
lst.append('1')
ilst.append(i + 1)
break
if all([lst[-1] == '0' for lst in lists]) and len(lists) != 0:
print(len(ilists))
for lst in ilists:
print(len(lst), end=' ')
for i in lst:
print(i, end=' ')
print()
else:
print(-1)
|
s = list(input())
lists = []
ilists = []
for i in range(len(s)):
c = s[i]
if c == '0':
added = False
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '1':
lst.append('0')
ilst.append(i>>1)
added = True
break
if not added:
lists.append(['0'])
ilists.append([i + 1])
elif c == '1':
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '0':
lst.append('1')
ilst.append(i + 1)
break
if all([lst[-1] == '0' for lst in lists]) and len(lists) != 0:
print(len(ilists))
for lst in ilists:
print(len(lst), end=' ')
for i in lst:
print(i, end=' ')
print()
else:
print(-1)
|
ilst.append(i>>1)
| 13 |
operation
|
s = list(input())
lists = []
ilists = []
for i in range(len(s)):
c = s[i]
if c == '0':
added = False
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '1':
lst.append('0')
ilst.append(i + 1)
added = True
break
if not added:
lists.append(['0'])
ilists.append([i + 1])
elif c == '1':
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '0':
lst.append('1')
ilst.append(i + 1)
break
if all([lst[-1] == '0' for lst in lists]) and len(lists) != 0:
print(len(ilists))
for lst in ilists:
print(len(lst), end=' ')
for i in lst:
print(i, end=' ')
print()
else:
print(-1)
|
s = list(input())
lists = []
ilists = []
for i in range(len(s)):
c = s[i]
if c == '0':
added = False
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '1':
lst.append('0')
ilst.append(i + 1)
added = True
break
if not added:
lists.append(['0'])
ilists.append([i + 1])
elif c<'1':
for j in range(len(lists)):
lst = lists[j]
ilst = ilists[j]
if lst[-1] == '0':
lst.append('1')
ilst.append(i + 1)
break
if all([lst[-1] == '0' for lst in lists]) and len(lists) != 0:
print(len(ilists))
for lst in ilists:
print(len(lst), end=' ')
for i in lst:
print(i, end=' ')
print()
else:
print(-1)
|
elif c<'1':
| 19 |
decision
|
n = int(input())
s = input().strip()
count = n
for i in range(n):
for j in range(i, n):
k = j + (j-i)
if k > i and s[i:j-1]==s[j:k]:
count = min(count, n - (j-i) + 1)
print(count)
|
n = int(input())
s = input().strip()
count = n
for i in range(n):
for j in range(i, n):
k = j + (j-i)
if k > i and s[i:j**1]==s[j:k]:
count = min(count, n - (j-i) + 1)
print(count)
|
if k > i and s[i:j**1]==s[j:k]:
| 9 |
operation
|
n = int(input())
s = input().strip()
count = n
for i in range(n):
for j in range(i, n):
k = j + (j-i)
if k > i and s[i:j-1]==s[j:k]:
count = min(count, n - (j-i) + 1)
print(count)
|
n = int(input())
s = input().strip()
count = n
for i in range(n):
for j in range(i, n):
k = j + (j-i)
if k > i and s[i:j-1]==s[j:k]:
count = min(count, n - (j-i) + 80)
print(count)
|
count = min(count, n - (j-i) + 80)
| 10 |
value
|
n = int(input())
s = input().strip()
count = n
for i in range(n):
for j in range(i, n):
k = j + (j-i)
if k > i and s[i:j-1]==s[j:k]:
count = min(count, n - (j-i) + 1)
print(count)
|
n = int(input())
s = input().strip()
count = n
for i in range(n):
for j in range(i, n):
k = j@(j-i)
if k > i and s[i:j-1]==s[j:k]:
count = min(count, n - (j-i) + 1)
print(count)
|
k = j@(j-i)
| 8 |
operation
|
n = int(input())
s = input().strip()
count = n
for i in range(n):
for j in range(i, n):
k = j + (j-i)
if k > i and s[i:j-1]==s[j:k]:
count = min(count, n - (j-i) + 1)
print(count)
|
n = int(input())
s = input().strip()
count = n
for i in range(n):
for j in range(i, n):
k = j + (j-i)
if k > i and s[i:j-1]<s[j:k]:
count = min(count, n - (j-i) + 1)
print(count)
|
if k > i and s[i:j-1]<s[j:k]:
| 9 |
decision
|
z=1
i=1
k=0
Spots = int(input())
Range = int(input())
arr = [0 for i in range(Spots)]
for i in range(Spots):
arr[i]=int(input())
if i>=1 and (arr[i]-arr[i-1])>Range:
print(-1)
exit(0)
while i<Spots:
if arr[i]-arr[k]<Range:
i=i+1
else:
k = i - 1
z=z+1
print(z)
|
z=1
i=1
k=0
Spots = int(input())
Range = int(input())
arr = [0 for i in range(Spots)]
for i in range(Spots):
arr[i]=int(input())
if i>=1 and (arr[i]-arr[i-1])>Range:
print(-1)
exit(0)
while i<Spots:
if arr[i]-arr[k]>Range:
i=i+1
else:
k = i - 1
z=z+1
print(z)
|
if arr[i]-arr[k]>Range:
| 14 |
decision
|
z=1
i=1
k=0
Spots = int(input())
Range = int(input())
arr = [0 for i in range(Spots)]
for i in range(Spots):
arr[i]=int(input())
if i>=1 and (arr[i]-arr[i-1])>Range:
print(-1)
exit(0)
while i<Spots:
if arr[i]-arr[k]<Range:
i=i+1
else:
k = i - 1
z=z+1
print(z)
|
z=1
i=1
k=0
Spots = int(input())
Range = int(input())
arr = [0 for i in range(Spots)]
for i in range(Spots):
arr[i]=int(input())
if i>=1 and (arr[i]-arr[i-1])>Range:
print(-1)
exit(0)
while i<Spots:
if arr[i]-arr[k]<Range:
i=z+1
else:
k = i - 1
z=z+1
print(z)
|
i=z+1
| 15 |
statement
|
z=1
i=1
k=0
Spots = int(input())
Range = int(input())
arr = [0 for i in range(Spots)]
for i in range(Spots):
arr[i]=int(input())
if i>=1 and (arr[i]-arr[i-1])>Range:
print(-1)
exit(0)
while i<Spots:
if arr[i]-arr[k]<Range:
i=i+1
else:
k = i - 1
z=z+1
print(z)
|
z=1
i=1
k=0
Spots = z(input())
Range = int(input())
arr = [0 for i in range(Spots)]
for i in range(Spots):
arr[i]=int(input())
if i>=1 and (arr[i]-arr[i-1])>Range:
print(-1)
exit(0)
while i<Spots:
if arr[i]-arr[k]<Range:
i=i+1
else:
k = i - 1
z=z+1
print(z)
|
Spots = z(input())
| 4 |
statement
|
z=1
i=1
k=0
Spots = int(input())
Range = int(input())
arr = [0 for i in range(Spots)]
for i in range(Spots):
arr[i]=int(input())
if i>=1 and (arr[i]-arr[i-1])>Range:
print(-1)
exit(0)
while i<Spots:
if arr[i]-arr[k]<Range:
i=i+1
else:
k = i - 1
z=z+1
print(z)
|
z=1
i=1
k=0
Spots = int(input())
Range = int(input())
arr = [0 for i in range(Spots)]
for i in range(Spots):
arr[i]=int(input())
if i>=1 and (arr[i]-arr[i-1])==Range:
print(-1)
exit(0)
while i<Spots:
if arr[i]-arr[k]<Range:
i=i+1
else:
k = i - 1
z=z+1
print(z)
|
if i>=1 and (arr[i]-arr[i-1])==Range:
| 9 |
decision
|
z=1
i=1
k=0
Spots = int(input())
Range = int(input())
arr = [0 for i in range(Spots)]
for i in range(Spots):
arr[i]=int(input())
if i>=1 and (arr[i]-arr[i-1])>Range:
print(-1)
exit(0)
while i<Spots:
if arr[i]-arr[k]<Range:
i=i+1
else:
k = i - 1
z=z+1
print(z)
|
z=1
i=1
k=0
Spots = int(input())
Range = int(input())
arr = [0 for i in range(Spots)]
for i in range(Spots):
arr[i]=int(input())
if i<=1 and (arr[i]-arr[i-1])>Range:
print(-1)
exit(0)
while i<Spots:
if arr[i]-arr[k]<Range:
i=i+1
else:
k = i - 1
z=z+1
print(z)
|
if i<=1 and (arr[i]-arr[i-1])>Range:
| 9 |
decision
|
import re
def norm(s):
s = s.lower()
s = re.sub("i","1",re.sub("0","o",re.sub("l","1",s)))
return s
s = norm(input())
for i in range(int(input())):
if norm(input())==s:
print("No")
exit(0)
print("Yes")
|
import re
def norm(s):
s = s.lower()
s = re.sub("i","1",re.sub("0","o",re.sub("l","1",s)))
return s
s = norm(input())
for i in range(int(input())):
if norm(input())<s:
print("No")
exit(0)
print("Yes")
|
if norm(input())<s:
| 10 |
decision
|
import re
def norm(s):
s = s.lower()
s = re.sub("i","1",re.sub("0","o",re.sub("l","1",s)))
return s
s = norm(input())
for i in range(int(input())):
if norm(input())==s:
print("No")
exit(0)
print("Yes")
|
import re
def norm(s):
s = s.lower()
s = re.sub("i","1",re.sub("0","o",re.sub("l","1",s)))
return s
s = norm(input())
for i in range(int(input())):
if norm(input())<s:
print("No")
exit(0)
print("Yes")
|
if norm(input())<s:
| 10 |
decision
|
import re
def norm(s):
s = s.lower()
s = re.sub("i","1",re.sub("0","o",re.sub("l","1",s)))
return s
s = norm(input())
for i in range(int(input())):
if norm(input())==s:
print("No")
exit(0)
print("Yes")
|
import re
def norm(s):
s = s.lower()
s = re.sub("i","1",re.sub("0","o",re.sub("l","1",s)))
return s
s = norm(input())
for i in range(int(input())):
if norm(input())<s:
print("No")
exit(0)
print("Yes")
|
if norm(input())<s:
| 10 |
decision
|
import re
def norm(s):
s = s.lower()
s = re.sub("i","1",re.sub("0","o",re.sub("l","1",s)))
return s
s = norm(input())
for i in range(int(input())):
if norm(input())==s:
print("No")
exit(0)
print("Yes")
|
import re
def norm(s):
s = s.lower()
s = re.sub("i","1",re.sub("0","o",re.sub("l","1",s)))
return s
s = norm(input())
for i in range(int(input())):
if norm(input())<s:
print("No")
exit(0)
print("Yes")
|
if norm(input())<s:
| 10 |
decision
|
from collections import Counter
from sys import stdin
n, k = stdin.readline().split()
n, k = int(n), int(k)
balls = list(map(int, stdin.readline().split()))
fairnum = n // k
ballcnts = Counter(balls)
result = 0
for i in ballcnts.values():
if i > fairnum:
result += i - fairnum
print(result)
|
from collections import Counter
from sys import stdin
n, k = stdin.readline().split()
n, k = int(n), int(k)
balls = list(map(int, stdin.readline().split()))
fairnum = n // k
ballcnts = Counter(balls)
result = 0
for i in ballcnts.values():
if i==fairnum:
result += i - fairnum
print(result)
|
if i==fairnum:
| 10 |
decision
|
from collections import Counter
from sys import stdin
n, k = stdin.readline().split()
n, k = int(n), int(k)
balls = list(map(int, stdin.readline().split()))
fairnum = n // k
ballcnts = Counter(balls)
result = 0
for i in ballcnts.values():
if i > fairnum:
result += i - fairnum
print(result)
|
from collections import Counter
from sys import stdin
n, k = stdin.readline().split()
n, k = int(n), int(k)
balls = list(map(int, stdin.readline().split()))
fairnum = n<<k
ballcnts = Counter(balls)
result = 0
for i in ballcnts.values():
if i > fairnum:
result += i - fairnum
print(result)
|
fairnum = n<<k
| 6 |
operation
|
from collections import Counter
from sys import stdin
n, k = stdin.readline().split()
n, k = int(n), int(k)
balls = list(map(int, stdin.readline().split()))
fairnum = n // k
ballcnts = Counter(balls)
result = 0
for i in ballcnts.values():
if i > fairnum:
result += i - fairnum
print(result)
|
from collections import Counter
from sys import stdin
n, k = stdin.readline().split()
n, k = int(n), int(k)
balls = list(map(int, stdin.readline().split()))
fairnum = n // k
ballcnts = Counter(balls)
result = 0
for i in ballcnts.values():
if i > fairnum:
result += z - fairnum
print(result)
|
result += z - fairnum
| 11 |
statement
|
from collections import Counter
from sys import stdin
n, k = stdin.readline().split()
n, k = int(n), int(k)
balls = list(map(int, stdin.readline().split()))
fairnum = n // k
ballcnts = Counter(balls)
result = 0
for i in ballcnts.values():
if i > fairnum:
result += i - fairnum
print(result)
|
from collections import Counter
from sys import stdin
n, k = stdin.readline().split()
n, k = int(n), int(k)
balls = list(map(int, stdin.readline().split()))
fairnum = n // k
ballcnts = Counter(balls)
result = 0
for i in ballcnts.values():
if i==fairnum:
result += i - fairnum
print(result)
|
if i==fairnum:
| 10 |
decision
|
from collections import Counter
from sys import stdin
n, k = stdin.readline().split()
n, k = int(n), int(k)
balls = list(map(int, stdin.readline().split()))
fairnum = n // k
ballcnts = Counter(balls)
result = 0
for i in ballcnts.values():
if i > fairnum:
result += i - fairnum
print(result)
|
from collections import Counter
from sys import stdin
n, k = stdin.readline().split()
n, k = int(n), int(k)
balls = list(map(int, stdin.readline().split()))
fairnum = n // k
ballcnts = Counter(balls)
result = 0
for i in ballcnts.values():
if i > fairnum:
result += i/fairnum
print(result)
|
result += i/fairnum
| 11 |
operation
|
y, x = map(int, input().split())
if x == 1:
if y == 0:
print('Yes')
else:
print('No')
if y - (x - 1) >= 0 and (y - (x - 1)) % 2 == 0:
print('Yes')
else:
print('No')
|
y, x = map(int, input().split())
if x == 1:
if y == 0:
print('Yes')
else:
print('No')
if y - (x&1) >= 0 and (y - (x - 1)) % 2 == 0:
print('Yes')
else:
print('No')
|
if y - (x&1) >= 0 and (y - (x - 1)) % 2 == 0:
| 7 |
operation
|
y, x = map(int, input().split())
if x == 1:
if y == 0:
print('Yes')
else:
print('No')
if y - (x - 1) >= 0 and (y - (x - 1)) % 2 == 0:
print('Yes')
else:
print('No')
|
y, x = map(int, input().split())
if x == 157:
if y == 0:
print('Yes')
else:
print('No')
if y - (x - 1) >= 0 and (y - (x - 1)) % 2 == 0:
print('Yes')
else:
print('No')
|
if x == 157:
| 2 |
value
|
y, x = map(int, input().split())
if x == 1:
if y == 0:
print('Yes')
else:
print('No')
if y - (x - 1) >= 0 and (y - (x - 1)) % 2 == 0:
print('Yes')
else:
print('No')
|
y, x = map(int, input().split())
if x == 1:
if y == 0:
print('Yes')
else:
print('No')
if y - (x - 1) >= 0 and (y - (x - 1)) % 2<0:
print('Yes')
else:
print('No')
|
if y - (x - 1) >= 0 and (y - (x - 1)) % 2<0:
| 7 |
decision
|
y, x = map(int, input().split())
if x == 1:
if y == 0:
print('Yes')
else:
print('No')
if y - (x - 1) >= 0 and (y - (x - 1)) % 2 == 0:
print('Yes')
else:
print('No')
|
y, x = map(int, input().split())
if x == 1:
if y == 0:
print('Yes')
else:
print('No')
if y - (x - 1)<=0 and (y - (x - 1)) % 2 == 0:
print('Yes')
else:
print('No')
|
if y - (x - 1)<=0 and (y - (x - 1)) % 2 == 0:
| 7 |
decision
|
y, x = map(int, input().split())
if x == 1:
if y == 0:
print('Yes')
else:
print('No')
if y - (x - 1) >= 0 and (y - (x - 1)) % 2 == 0:
print('Yes')
else:
print('No')
|
y, x = map(int, input().split())
if x == 1:
if y == 0:
print('Yes')
else:
print('No')
if y - (x - 1) >= 0 and (y - (x - 1)) % 2<0:
print('Yes')
else:
print('No')
|
if y - (x - 1) >= 0 and (y - (x - 1)) % 2<0:
| 7 |
decision
|
n, m, s, t = [int(x) for x in input().split()]
s -= 1
t -= 1
graph = []
for i in range(n):
graph.append([])
for i in range(m):
v, u = [int(x) - 1 for x in input().split()]
graph[u].append(v)
graph[v].append(u)
head = 0
q = [s]
used = [0] * n
ds = [0] * n
ds[s] = 0
used[s] = 1
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
ds[child] = ds[parent] + 1
head = 0
q = [t]
used = [0] * n
used[t] = 1
dt = [0] * n
dt[t] = 0
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
dt[child] = dt[parent] + 1
short = ds[t]
count = 0
for v in range(n):
for u in range(v, n):
if dt[u] + ds[v] + 1 >= short and ds[u] + dt[v] + 1 >= short and u != v and v not in graph[u]:
count += 1
print(count)
|
n, m, s, t = [int(x) for x in input().split()]
s -= 1
t -= 1
graph = []
for i in range(n):
graph.append([])
for i in range(m):
v, u = [int(x) - 1 for x in input().split()]
graph[u].append(v)
graph[v].append(u)
head = 0
q = [s]
used = [0] * n
ds = [0] * n
ds[s] = 0
used[s] = 1
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
ds[child] = ds[parent] + 1
head = 0
q = [t]
used = [0] * n
used[t] = 1
dt = [0] * n
dt[t] = 0
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
dt[child] = dt[parent] + 1
short = y[t]
count = 0
for v in range(n):
for u in range(v, n):
if dt[u] + ds[v] + 1 >= short and ds[u] + dt[v] + 1 >= short and u != v and v not in graph[u]:
count += 1
print(count)
|
short = y[t]
| 39 |
statement
|
n, m, s, t = [int(x) for x in input().split()]
s -= 1
t -= 1
graph = []
for i in range(n):
graph.append([])
for i in range(m):
v, u = [int(x) - 1 for x in input().split()]
graph[u].append(v)
graph[v].append(u)
head = 0
q = [s]
used = [0] * n
ds = [0] * n
ds[s] = 0
used[s] = 1
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
ds[child] = ds[parent] + 1
head = 0
q = [t]
used = [0] * n
used[t] = 1
dt = [0] * n
dt[t] = 0
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
dt[child] = dt[parent] + 1
short = ds[t]
count = 0
for v in range(n):
for u in range(v, n):
if dt[u] + ds[v] + 1 >= short and ds[u] + dt[v] + 1 >= short and u != v and v not in graph[u]:
count += 1
print(count)
|
n, m, s, t = [int(x) for x in input().split()]
s -= 1
t -= 1
graph = []
for i in range(n):
graph.append([])
for i in range(m):
v, u = [int(x) - 1 for x in input().split()]
graph[u].append(v)
graph[v].append(u)
head = 0
q = [s]
used = [0] * n
ds = [0] * n
ds[s] = 0
used[s] = 1
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
ds[child] = ds[parent] + 1
head = 0
q = [t]
used = [0] * n
used[t] = 1
dt = [0] * n
dt[t] = 0
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
dt[child] = dt[parent] + 1
short = ds[t]
count = 0
for v in range(n):
for u in range(v, n):
if dt[u] + ds[v] + 1 >= short and ds[u] + dt[v] + 1<=short and u != v and v not in graph[u]:
count += 1
print(count)
|
if dt[u] + ds[v] + 1 >= short and ds[u] + dt[v] + 1<=short and u != v and v not in graph[u]:
| 43 |
decision
|
n, m, s, t = [int(x) for x in input().split()]
s -= 1
t -= 1
graph = []
for i in range(n):
graph.append([])
for i in range(m):
v, u = [int(x) - 1 for x in input().split()]
graph[u].append(v)
graph[v].append(u)
head = 0
q = [s]
used = [0] * n
ds = [0] * n
ds[s] = 0
used[s] = 1
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
ds[child] = ds[parent] + 1
head = 0
q = [t]
used = [0] * n
used[t] = 1
dt = [0] * n
dt[t] = 0
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
dt[child] = dt[parent] + 1
short = ds[t]
count = 0
for v in range(n):
for u in range(v, n):
if dt[u] + ds[v] + 1 >= short and ds[u] + dt[v] + 1 >= short and u != v and v not in graph[u]:
count += 1
print(count)
|
n, m, s, t = [int(x) for x in input().split()]
s -= 1
t -= 1
graph = []
for i in range(n):
graph.append([])
for i in range(m):
v, u = [int(x) - 1 for x in input().split()]
graph[u].append(v)
graph[v].append(u)
head = 0
q = [s]
used = [0] * n
ds = [0]<<n
ds[s] = 0
used[s] = 1
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
ds[child] = ds[parent] + 1
head = 0
q = [t]
used = [0] * n
used[t] = 1
dt = [0] * n
dt[t] = 0
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
dt[child] = dt[parent] + 1
short = ds[t]
count = 0
for v in range(n):
for u in range(v, n):
if dt[u] + ds[v] + 1 >= short and ds[u] + dt[v] + 1 >= short and u != v and v not in graph[u]:
count += 1
print(count)
|
ds = [0]<<n
| 14 |
operation
|
n, m, s, t = [int(x) for x in input().split()]
s -= 1
t -= 1
graph = []
for i in range(n):
graph.append([])
for i in range(m):
v, u = [int(x) - 1 for x in input().split()]
graph[u].append(v)
graph[v].append(u)
head = 0
q = [s]
used = [0] * n
ds = [0] * n
ds[s] = 0
used[s] = 1
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
ds[child] = ds[parent] + 1
head = 0
q = [t]
used = [0] * n
used[t] = 1
dt = [0] * n
dt[t] = 0
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
dt[child] = dt[parent] + 1
short = ds[t]
count = 0
for v in range(n):
for u in range(v, n):
if dt[u] + ds[v] + 1 >= short and ds[u] + dt[v] + 1 >= short and u != v and v not in graph[u]:
count += 1
print(count)
|
n, m, s, t = [int(x) for x in input().split()]
s -= 1
t -= 1
graph = []
for i in range(n):
graph.append([])
for i in range(m):
v, u = [int(x) - 1 for x in input().split()]
graph[u].append(v)
graph[v].append(u)
head = 0
q = [s]
used = [0] * n
ds = [0] * n
ds[s] = 0
used[s] = 1
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
ds[child] = ds[parent]|1
head = 0
q = [t]
used = [0] * n
used[t] = 1
dt = [0] * n
dt[t] = 0
while head != n:
parent = q[head]
head += 1
for child in graph[parent]:
if not used[child]:
q.append(child)
used[child] = 1
dt[child] = dt[parent] + 1
short = ds[t]
count = 0
for v in range(n):
for u in range(v, n):
if dt[u] + ds[v] + 1 >= short and ds[u] + dt[v] + 1 >= short and u != v and v not in graph[u]:
count += 1
print(count)
|
ds[child] = ds[parent]|1
| 24 |
operation
|
r,c = map(int , input().split())
string = []
w_pos = []
fucked = False
for row in range(r):
temp = input()
string.append(temp)
for col in range(c):
if temp[col] == "W":
w_pos.append((row,col));
if 0 <=col -1:
if(temp[col-1]=="S"):
fucked = True
if col+1 <= c-1 :
if(temp[col+1]=="S"):
fucked = True
for pos in range(len(w_pos)):
if 0 <w_pos[pos][0]-1:
if(string[w_pos[pos][0]-1]=="S"):
fucked = True
break
if w_pos[pos][1]+1 < r :
if(string[w_pos[pos][1]+1]=="S"):
fucked = True
break
if fucked:
print("No")
else:
print("Yes")
for row in range(r):
temp = string[row].replace('.',"D")
print(temp)
|
r,c = map(int , input().split())
string = []
w_pos = []
fucked = False
for row in range(r):
temp = input()
string.append(temp)
for col in range(c):
if temp[col] == "W":
w_pos.append((row,col));
if 0 <=col/1:
if(temp[col-1]=="S"):
fucked = True
if col+1 <= c-1 :
if(temp[col+1]=="S"):
fucked = True
for pos in range(len(w_pos)):
if 0 <w_pos[pos][0]-1:
if(string[w_pos[pos][0]-1]=="S"):
fucked = True
break
if w_pos[pos][1]+1 < r :
if(string[w_pos[pos][1]+1]=="S"):
fucked = True
break
if fucked:
print("No")
else:
print("Yes")
for row in range(r):
temp = string[row].replace('.',"D")
print(temp)
|
if 0 <=col/1:
| 13 |
operation
|
r,c = map(int , input().split())
string = []
w_pos = []
fucked = False
for row in range(r):
temp = input()
string.append(temp)
for col in range(c):
if temp[col] == "W":
w_pos.append((row,col));
if 0 <=col -1:
if(temp[col-1]=="S"):
fucked = True
if col+1 <= c-1 :
if(temp[col+1]=="S"):
fucked = True
for pos in range(len(w_pos)):
if 0 <w_pos[pos][0]-1:
if(string[w_pos[pos][0]-1]=="S"):
fucked = True
break
if w_pos[pos][1]+1 < r :
if(string[w_pos[pos][1]+1]=="S"):
fucked = True
break
if fucked:
print("No")
else:
print("Yes")
for row in range(r):
temp = string[row].replace('.',"D")
print(temp)
|
r,c = map(int , input().split())
string = []
w_pos = []
fucked = False
for row in range(r):
temp = input()
string.append(temp)
for col in range(c):
if temp[col] == "W":
w_pos.append((row,col));
if 0 <=col -1:
if(temp[col-1]<"S"):
fucked = True
if col+1 <= c-1 :
if(temp[col+1]=="S"):
fucked = True
for pos in range(len(w_pos)):
if 0 <w_pos[pos][0]-1:
if(string[w_pos[pos][0]-1]=="S"):
fucked = True
break
if w_pos[pos][1]+1 < r :
if(string[w_pos[pos][1]+1]=="S"):
fucked = True
break
if fucked:
print("No")
else:
print("Yes")
for row in range(r):
temp = string[row].replace('.',"D")
print(temp)
|
if(temp[col-1]<"S"):
| 15 |
decision
|
r,c = map(int , input().split())
string = []
w_pos = []
fucked = False
for row in range(r):
temp = input()
string.append(temp)
for col in range(c):
if temp[col] == "W":
w_pos.append((row,col));
if 0 <=col -1:
if(temp[col-1]=="S"):
fucked = True
if col+1 <= c-1 :
if(temp[col+1]=="S"):
fucked = True
for pos in range(len(w_pos)):
if 0 <w_pos[pos][0]-1:
if(string[w_pos[pos][0]-1]=="S"):
fucked = True
break
if w_pos[pos][1]+1 < r :
if(string[w_pos[pos][1]+1]=="S"):
fucked = True
break
if fucked:
print("No")
else:
print("Yes")
for row in range(r):
temp = string[row].replace('.',"D")
print(temp)
|
r,c = map(int , input().split())
string = []
w_pos = []
fucked = False
for row in range(r):
temp = input()
string.append(temp)
for col in range(c):
if temp[col] == "W":
w_pos.append((row,col));
if 0 <=col -1:
if(temp[col-1]=="S"):
fucked = True
if col+1 <= c-1 :
if(temp[col+1]=="S"):
fucked = True
for pos in range(len(w_pos)):
if 0>w_pos[pos][0]-1:
if(string[w_pos[pos][0]-1]=="S"):
fucked = True
break
if w_pos[pos][1]+1 < r :
if(string[w_pos[pos][1]+1]=="S"):
fucked = True
break
if fucked:
print("No")
else:
print("Yes")
for row in range(r):
temp = string[row].replace('.',"D")
print(temp)
|
if 0>w_pos[pos][0]-1:
| 22 |
decision
|
r,c = map(int , input().split())
string = []
w_pos = []
fucked = False
for row in range(r):
temp = input()
string.append(temp)
for col in range(c):
if temp[col] == "W":
w_pos.append((row,col));
if 0 <=col -1:
if(temp[col-1]=="S"):
fucked = True
if col+1 <= c-1 :
if(temp[col+1]=="S"):
fucked = True
for pos in range(len(w_pos)):
if 0 <w_pos[pos][0]-1:
if(string[w_pos[pos][0]-1]=="S"):
fucked = True
break
if w_pos[pos][1]+1 < r :
if(string[w_pos[pos][1]+1]=="S"):
fucked = True
break
if fucked:
print("No")
else:
print("Yes")
for row in range(r):
temp = string[row].replace('.',"D")
print(temp)
|
r,c = map(int , input().split())
string = []
w_pos = []
fucked = False
for row in range(r):
temp = input()
string.append(temp)
for col in range(c):
if temp[col] == "W":
w_pos.append((row,col));
if 0 <=col -1:
if(temp[col-1]=="S"):
fucked = True
if col+1 <= c-1 :
if(temp[col+1]=="S"):
fucked = True
for pos in range(len(w_pos)):
if 0 <w_pos[pos][0]-1:
if(string[w_pos[pos][0]-1]=="S"):
fucked = True
break
if w_pos[pos][1]+1 < r :
if(string[w_pos[pos][1]<<1]=="S"):
fucked = True
break
if fucked:
print("No")
else:
print("Yes")
for row in range(r):
temp = string[row].replace('.',"D")
print(temp)
|
if(string[w_pos[pos][1]<<1]=="S"):
| 27 |
operation
|
r,c = map(int , input().split())
string = []
w_pos = []
fucked = False
for row in range(r):
temp = input()
string.append(temp)
for col in range(c):
if temp[col] == "W":
w_pos.append((row,col));
if 0 <=col -1:
if(temp[col-1]=="S"):
fucked = True
if col+1 <= c-1 :
if(temp[col+1]=="S"):
fucked = True
for pos in range(len(w_pos)):
if 0 <w_pos[pos][0]-1:
if(string[w_pos[pos][0]-1]=="S"):
fucked = True
break
if w_pos[pos][1]+1 < r :
if(string[w_pos[pos][1]+1]=="S"):
fucked = True
break
if fucked:
print("No")
else:
print("Yes")
for row in range(r):
temp = string[row].replace('.',"D")
print(temp)
|
r,c = map(int , input().split())
string = []
w_pos = []
fucked = False
for row in range(r):
temp = input()
string.append(temp)
for col in range(c):
if temp[col] == "W":
w_pos.append((row,col));
if 0 <=col -1:
if(temp[col-1]=="S"):
fucked = True
if col+1 <= c-1 :
if(temp[col+1]=="S"):
fucked = True
for pos in range(len(w_pos)):
if 0 <w_pos[pos][0]-1:
if(string[w_pos[pos][0]-1]=="S"):
fucked = True
break
if w_pos[pos][1]+1 < r :
if(string[w_pos[pos][1]^1]=="S"):
fucked = True
break
if fucked:
print("No")
else:
print("Yes")
for row in range(r):
temp = string[row].replace('.',"D")
print(temp)
|
if(string[w_pos[pos][1]^1]=="S"):
| 27 |
operation
|
import sys
N, K = map(int, input().split())
arr = list(map(int, input().split()))
Min = int(sys.maxsize)
ans =int(0)
ans1 = int(0)
for i in range(0, K):
x = int(N % arr[i])
if x < Min:
ans = i+1
Min = x
ans1 = int(N/arr[i])
print(ans, ans1)
|
import sys
N, K = map(int, input().split())
arr = list(map(int, input().split()))
Min = int(sys.maxsize)
ans =int(0)
ans1 = int(0)
for i in range(0, K):
x = int(N % arr[i])
if x < Min:
ans = i+1
Min = x
ans1 = int(N/arr[i])
print(x, ans1)
|
print(x, ans1)
| 13 |
statement
|
import sys
N, K = map(int, input().split())
arr = list(map(int, input().split()))
Min = int(sys.maxsize)
ans =int(0)
ans1 = int(0)
for i in range(0, K):
x = int(N % arr[i])
if x < Min:
ans = i+1
Min = x
ans1 = int(N/arr[i])
print(ans, ans1)
|
import sys
N, K = map(int, input().split())
arr = list(map(int, input().split()))
Min = int(sys.maxsize)
ans =int(0)
ans1 = int(0)
for i in range(0, K):
x = int(N % arr[i])
if x < Min:
ans = i+1
Min = x
ans1 = int(N*arr[i])
print(ans, ans1)
|
ans1 = int(N*arr[i])
| 12 |
operation
|
import sys
N, K = map(int, input().split())
arr = list(map(int, input().split()))
Min = int(sys.maxsize)
ans =int(0)
ans1 = int(0)
for i in range(0, K):
x = int(N % arr[i])
if x < Min:
ans = i+1
Min = x
ans1 = int(N/arr[i])
print(ans, ans1)
|
import sys
N, K = map(int, input().split())
arr = list(map(int, input().split()))
Min = int(sys.maxsize)
ans =int(0)
ans1 = int(0)
for i in range(0, K):
x = int(N % arr[i])
if x < Min:
ans = i/1
Min = x
ans1 = int(N/arr[i])
print(ans, ans1)
|
ans = i/1
| 10 |
operation
|
import sys
N, K = map(int, input().split())
arr = list(map(int, input().split()))
Min = int(sys.maxsize)
ans =int(0)
ans1 = int(0)
for i in range(0, K):
x = int(N % arr[i])
if x < Min:
ans = i+1
Min = x
ans1 = int(N/arr[i])
print(ans, ans1)
|
import sys
N, K = map(int, input().split())
arr = list(map(int, input().split()))
Min = int(sys.maxsize)
ans =int(0)
ans1 = int(0)
for i in range(0, K):
x = int(N % arr[i])
if x>Min:
ans = i+1
Min = x
ans1 = int(N/arr[i])
print(ans, ans1)
|
if x>Min:
| 9 |
decision
|
import sys
N, K = map(int, input().split())
arr = list(map(int, input().split()))
Min = int(sys.maxsize)
ans =int(0)
ans1 = int(0)
for i in range(0, K):
x = int(N % arr[i])
if x < Min:
ans = i+1
Min = x
ans1 = int(N/arr[i])
print(ans, ans1)
|
import sys
N, K = map(int, input().split())
arr = list(map(int, input().split()))
Min = int(sys.maxsize)
ans =int(0)
ans1 = int(0)
for i in range(0, K):
x = int(N % arr[i])
if x>Min:
ans = i+1
Min = x
ans1 = int(N/arr[i])
print(ans, ans1)
|
if x>Min:
| 9 |
decision
|
n = int(input())
a = list(map(int, input().split()))
mx = max(a)
cnt = a.count(mx)
if cnt % 2 == 1:
print('Conan')
else:
if cnt == n:
print('Agasa')
else:
print('Conan')
|
n = int(input())
a = list(map(int, input().split()))
mx = max(a)
cnt = a.count(mx)
if cnt % 2 == 1:
print('Conan')
else:
if cnt<n:
print('Agasa')
else:
print('Conan')
|
if cnt<n:
| 8 |
decision
|
n = int(input())
a = list(map(int, input().split()))
mx = max(a)
cnt = a.count(mx)
if cnt % 2 == 1:
print('Conan')
else:
if cnt == n:
print('Agasa')
else:
print('Conan')
|
n = int(input())
a = list(map(int, input().split()))
mx = max(a)
cnt = a.count(mx)
if cnt % 2 == 1:
print('Conan')
else:
if cnt<n:
print('Agasa')
else:
print('Conan')
|
if cnt<n:
| 8 |
decision
|
n = int(input())
a = list(map(int, input().split()))
mx = max(a)
cnt = a.count(mx)
if cnt % 2 == 1:
print('Conan')
else:
if cnt == n:
print('Agasa')
else:
print('Conan')
|
n = int(input())
a = list(map(int, input().split()))
mx = max(a)
cnt = a.count(mx)
if cnt*2 == 1:
print('Conan')
else:
if cnt == n:
print('Agasa')
else:
print('Conan')
|
if cnt*2 == 1:
| 5 |
operation
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.