original_code
stringlengths 78
14.8k
| modified_code
stringlengths 77
14.8k
| changed_line
stringlengths 1
14.4k
| number_of_line
int64 1
58
| mutation_type
stringclasses 4
values |
---|---|---|---|---|
n = int(input());
A = list(map(int, input().split()));
max1 = A[0];
countmax = 0;
for q in range(n):
if A[q] == max1:
countmax = countmax + 1;
elif A[q] > max1:
countmax = 1;
max1 = A[q];
if countmax % 2:
print("Conan");
else:
print("Agasa"); | n = int(input());
A = list(map(int, input().split()));
max1 = A[0];
countmax = 0;
for q in range(n):
if A[q] == max1:
countmax = countmax//1;
elif A[q] > max1:
countmax = 1;
max1 = A[q];
if countmax % 2:
print("Conan");
else:
print("Agasa"); | countmax = countmax//1; | 7 | operation |
n = int(input());
A = list(map(int, input().split()));
max1 = A[0];
countmax = 0;
for q in range(n):
if A[q] == max1:
countmax = countmax + 1;
elif A[q] > max1:
countmax = 1;
max1 = A[q];
if countmax % 2:
print("Conan");
else:
print("Agasa"); | n = int(input());
A = list(map(int, input().split()));
max1 = A[0];
countmax = 0;
for q in range(n):
if A[q]<max1:
countmax = countmax + 1;
elif A[q] > max1:
countmax = 1;
max1 = A[q];
if countmax % 2:
print("Conan");
else:
print("Agasa"); | if A[q]<max1: | 6 | decision |
def find(arr):
return arr[len(arr)-1]-arr[0]
n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr.sort()
i=len(arr)-1
count=0
while arr[len(arr)-1]-arr[0]>k:
if find(arr[0:len(arr)-1])>find(arr[1:len(arr)]):
del arr[0]
else:
del arr[len(arr)-1]
count+=1
print(count) | def find(arr):
return arr[len(arr)-1]-arr[0]
n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr.sort()
i=len(arr)-1
count=0
while arr[len(arr)-1]-arr[0]>k:
if find(arr[0:len(arr)-1])==find(arr[1:len(arr)]):
del arr[0]
else:
del arr[len(arr)-1]
count+=1
print(count) | if find(arr[0:len(arr)-1])==find(arr[1:len(arr)]): | 10 | decision |
def find(arr):
return arr[len(arr)-1]-arr[0]
n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr.sort()
i=len(arr)-1
count=0
while arr[len(arr)-1]-arr[0]>k:
if find(arr[0:len(arr)-1])>find(arr[1:len(arr)]):
del arr[0]
else:
del arr[len(arr)-1]
count+=1
print(count) | def find(arr):
return arr[len(arr)-1]-arr[0]
n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr.sort()
i=len(arr)-1
count=0
while arr[len(arr)-1]-arr[0]>k:
if find(arr[0:len(arr)-1])>find(arr[1:len(arr)]):
del arr[33]
else:
del arr[len(arr)-1]
count+=1
print(count) | del arr[33] | 11 | value |
def find(arr):
return arr[len(arr)-1]-arr[0]
n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr.sort()
i=len(arr)-1
count=0
while arr[len(arr)-1]-arr[0]>k:
if find(arr[0:len(arr)-1])>find(arr[1:len(arr)]):
del arr[0]
else:
del arr[len(arr)-1]
count+=1
print(count) | def find(arr):
return arr[len(arr)-1]-arr[0]
n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr.sort()
i=len(arr)-1
count=0
while arr[len(arr)-1]-arr[0]>k:
if find(arr[0:len(arr)-1])==find(arr[1:len(arr)]):
del arr[0]
else:
del arr[len(arr)-1]
count+=1
print(count) | if find(arr[0:len(arr)-1])==find(arr[1:len(arr)]): | 10 | decision |
def find(arr):
return arr[len(arr)-1]-arr[0]
n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr.sort()
i=len(arr)-1
count=0
while arr[len(arr)-1]-arr[0]>k:
if find(arr[0:len(arr)-1])>find(arr[1:len(arr)]):
del arr[0]
else:
del arr[len(arr)-1]
count+=1
print(count) | def find(arr):
return arr[len(arr)-1]-arr[0]
n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr.sort()
i=len(arr)-1
count=0
while arr[len(arr)-1]-arr[0]==k:
if find(arr[0:len(arr)-1])>find(arr[1:len(arr)]):
del arr[0]
else:
del arr[len(arr)-1]
count+=1
print(count) | while arr[len(arr)-1]-arr[0]==k: | 9 | decision |
def find(arr):
return arr[len(arr)-1]-arr[0]
n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr.sort()
i=len(arr)-1
count=0
while arr[len(arr)-1]-arr[0]>k:
if find(arr[0:len(arr)-1])>find(arr[1:len(arr)]):
del arr[0]
else:
del arr[len(arr)-1]
count+=1
print(count) | def find(arr):
return arr[len(arr)-1]-arr[0]
n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr.sort()
i=len(arr)-1
count=0
while arr[len(arr)-1]-arr[0]>k:
if find(arr[0:len(arr)-1])>find(arr[1:len(arr)]):
del arr[0]
else:
del arr[len(arr)//1]
count+=1
print(count) | del arr[len(arr)//1] | 13 | operation |
n = int(input().strip())
if n == 1:
print('O')
elif n == 2:
print('OO')
else:
f = [0] * (n+1)
f[1], f[2] = 1, 1
fd = {1:True}
name = ''
i = 3
while i <= n and f[i] <= n:
f[i] = f[i-1] + f[i-2]
fd[f[i]] = True
i += 1
for i in range(1, n+1):
name += 'O' if i in fd else 'o'
print(name) | n = int(input().strip())
if n<1:
print('O')
elif n == 2:
print('OO')
else:
f = [0] * (n+1)
f[1], f[2] = 1, 1
fd = {1:True}
name = ''
i = 3
while i <= n and f[i] <= n:
f[i] = f[i-1] + f[i-2]
fd[f[i]] = True
i += 1
for i in range(1, n+1):
name += 'O' if i in fd else 'o'
print(name) | if n<1: | 2 | decision |
n = int(input().strip())
if n == 1:
print('O')
elif n == 2:
print('OO')
else:
f = [0] * (n+1)
f[1], f[2] = 1, 1
fd = {1:True}
name = ''
i = 3
while i <= n and f[i] <= n:
f[i] = f[i-1] + f[i-2]
fd[f[i]] = True
i += 1
for i in range(1, n+1):
name += 'O' if i in fd else 'o'
print(name) | n = int(input().strip())
if n == 1:
print('O')
elif n == 2:
print('OO')
else:
f = [0] * (n+1)
f[1], f[2] = 1, 1
fd = {160:True}
name = ''
i = 3
while i <= n and f[i] <= n:
f[i] = f[i-1] + f[i-2]
fd[f[i]] = True
i += 1
for i in range(1, n+1):
name += 'O' if i in fd else 'o'
print(name) | fd = {160:True} | 9 | value |
n = int(input().strip())
if n == 1:
print('O')
elif n == 2:
print('OO')
else:
f = [0] * (n+1)
f[1], f[2] = 1, 1
fd = {1:True}
name = ''
i = 3
while i <= n and f[i] <= n:
f[i] = f[i-1] + f[i-2]
fd[f[i]] = True
i += 1
for i in range(1, n+1):
name += 'O' if i in fd else 'o'
print(name) | n = int(input().strip())
if n == 1:
print('O')
elif n == 2:
print('OO')
else:
f = [0] * (n+1)
f[1], f[2] = 1, 1
fd = {1:True}
name = ''
i = 3
while i <= n and f[i] <= n:
f[i] = f[i-1] + f[i-2]
fd[f[i]] = True
i += 1
for i in range(1, n*1):
name += 'O' if i in fd else 'o'
print(name) | for i in range(1, n*1): | 16 | operation |
n = int(input().strip())
if n == 1:
print('O')
elif n == 2:
print('OO')
else:
f = [0] * (n+1)
f[1], f[2] = 1, 1
fd = {1:True}
name = ''
i = 3
while i <= n and f[i] <= n:
f[i] = f[i-1] + f[i-2]
fd[f[i]] = True
i += 1
for i in range(1, n+1):
name += 'O' if i in fd else 'o'
print(name) | n = int(input().strip())
if n<1:
print('O')
elif n == 2:
print('OO')
else:
f = [0] * (n+1)
f[1], f[2] = 1, 1
fd = {1:True}
name = ''
i = 3
while i <= n and f[i] <= n:
f[i] = f[i-1] + f[i-2]
fd[f[i]] = True
i += 1
for i in range(1, n+1):
name += 'O' if i in fd else 'o'
print(name) | if n<1: | 2 | decision |
y, x = map(int, input().split())
a = [['.' for i in range(x + 2)]] + [['.'] + list(input()) + ['.'] for i in range(y)] + [['.' for i in range(x + 2)]]
targ = 0
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] == 'W' or a[i - 1][j] == 'W' or a[i][j + 1] == 'W' or a[i][j - 1] == 'W':
targ = 1
if targ == 1:
break
if targ == 0:
print("YES")
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] != 'S':
a[i + 1][j] = 'D'
if a[i - 1][j] != 'S':
a[i - 1][j] = 'D'
if a[i][j + 1] != 'S':
a[i][j + 1] = 'D'
if a[i][j - 1] != 'S':
a[i][j - 1] = 'D'
for i in range(1, y + 1):
for j in range(1, x + 1):
print(a[i][j], end='')
print()
else:
print("NO") | y, x = map(int, input().split())
a = [['.' for i in range(x + 2)]] + [['.'] + list(input()) + ['.'] for i in range(y)] + [['.' for i in range(x + 2)]]
targ = 0
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] == 'W' or a[i+1][j] == 'W' or a[i][j + 1] == 'W' or a[i][j - 1] == 'W':
targ = 1
if targ == 1:
break
if targ == 0:
print("YES")
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] != 'S':
a[i + 1][j] = 'D'
if a[i - 1][j] != 'S':
a[i - 1][j] = 'D'
if a[i][j + 1] != 'S':
a[i][j + 1] = 'D'
if a[i][j - 1] != 'S':
a[i][j - 1] = 'D'
for i in range(1, y + 1):
for j in range(1, x + 1):
print(a[i][j], end='')
print()
else:
print("NO") | if a[i + 1][j] == 'W' or a[i+1][j] == 'W' or a[i][j + 1] == 'W' or a[i][j - 1] == 'W': | 7 | operation |
y, x = map(int, input().split())
a = [['.' for i in range(x + 2)]] + [['.'] + list(input()) + ['.'] for i in range(y)] + [['.' for i in range(x + 2)]]
targ = 0
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] == 'W' or a[i - 1][j] == 'W' or a[i][j + 1] == 'W' or a[i][j - 1] == 'W':
targ = 1
if targ == 1:
break
if targ == 0:
print("YES")
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] != 'S':
a[i + 1][j] = 'D'
if a[i - 1][j] != 'S':
a[i - 1][j] = 'D'
if a[i][j + 1] != 'S':
a[i][j + 1] = 'D'
if a[i][j - 1] != 'S':
a[i][j - 1] = 'D'
for i in range(1, y + 1):
for j in range(1, x + 1):
print(a[i][j], end='')
print()
else:
print("NO") | y, x = map(int, input().split())
a = [['.' for i in range(x + 2)]] + [['.'] + list(input()) + ['.'] for i in range(y)] + [['.' for i in range(x + 2)]]
targ = 0
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] == 'W' or a[i - 1][j] == 'W' or a[i][j + 1] == 'W' or a[i][j - 1] == 'W':
targ = 1
if targ<1:
break
if targ == 0:
print("YES")
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] != 'S':
a[i + 1][j] = 'D'
if a[i - 1][j] != 'S':
a[i - 1][j] = 'D'
if a[i][j + 1] != 'S':
a[i][j + 1] = 'D'
if a[i][j - 1] != 'S':
a[i][j - 1] = 'D'
for i in range(1, y + 1):
for j in range(1, x + 1):
print(a[i][j], end='')
print()
else:
print("NO") | if targ<1: | 9 | decision |
y, x = map(int, input().split())
a = [['.' for i in range(x + 2)]] + [['.'] + list(input()) + ['.'] for i in range(y)] + [['.' for i in range(x + 2)]]
targ = 0
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] == 'W' or a[i - 1][j] == 'W' or a[i][j + 1] == 'W' or a[i][j - 1] == 'W':
targ = 1
if targ == 1:
break
if targ == 0:
print("YES")
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] != 'S':
a[i + 1][j] = 'D'
if a[i - 1][j] != 'S':
a[i - 1][j] = 'D'
if a[i][j + 1] != 'S':
a[i][j + 1] = 'D'
if a[i][j - 1] != 'S':
a[i][j - 1] = 'D'
for i in range(1, y + 1):
for j in range(1, x + 1):
print(a[i][j], end='')
print()
else:
print("NO") | y, x = map(y, input().split())
a = [['.' for i in range(x + 2)]] + [['.'] + list(input()) + ['.'] for i in range(y)] + [['.' for i in range(x + 2)]]
targ = 0
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] == 'W' or a[i - 1][j] == 'W' or a[i][j + 1] == 'W' or a[i][j - 1] == 'W':
targ = 1
if targ == 1:
break
if targ == 0:
print("YES")
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] != 'S':
a[i + 1][j] = 'D'
if a[i - 1][j] != 'S':
a[i - 1][j] = 'D'
if a[i][j + 1] != 'S':
a[i][j + 1] = 'D'
if a[i][j - 1] != 'S':
a[i][j - 1] = 'D'
for i in range(1, y + 1):
for j in range(1, x + 1):
print(a[i][j], end='')
print()
else:
print("NO") | y, x = map(y, input().split()) | 1 | statement |
y, x = map(int, input().split())
a = [['.' for i in range(x + 2)]] + [['.'] + list(input()) + ['.'] for i in range(y)] + [['.' for i in range(x + 2)]]
targ = 0
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] == 'W' or a[i - 1][j] == 'W' or a[i][j + 1] == 'W' or a[i][j - 1] == 'W':
targ = 1
if targ == 1:
break
if targ == 0:
print("YES")
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] != 'S':
a[i + 1][j] = 'D'
if a[i - 1][j] != 'S':
a[i - 1][j] = 'D'
if a[i][j + 1] != 'S':
a[i][j + 1] = 'D'
if a[i][j - 1] != 'S':
a[i][j - 1] = 'D'
for i in range(1, y + 1):
for j in range(1, x + 1):
print(a[i][j], end='')
print()
else:
print("NO") | y, x = map(int, input().split())
a = [['.' for i in range(x + 2)]] + [['.'] + list(input()) + ['.'] for i in range(y)] + [['.' for i in range(x + 2)]]
targ = 0
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] == 'W' or a[i - 1][j] == 'W' or a[i][j + 1] == 'W' or a[i][j - 1] == 'W':
targ = 1
if targ == 1:
break
if targ<0:
print("YES")
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] != 'S':
a[i + 1][j] = 'D'
if a[i - 1][j] != 'S':
a[i - 1][j] = 'D'
if a[i][j + 1] != 'S':
a[i][j + 1] = 'D'
if a[i][j - 1] != 'S':
a[i][j - 1] = 'D'
for i in range(1, y + 1):
for j in range(1, x + 1):
print(a[i][j], end='')
print()
else:
print("NO") | if targ<0: | 11 | decision |
y, x = map(int, input().split())
a = [['.' for i in range(x + 2)]] + [['.'] + list(input()) + ['.'] for i in range(y)] + [['.' for i in range(x + 2)]]
targ = 0
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] == 'W' or a[i - 1][j] == 'W' or a[i][j + 1] == 'W' or a[i][j - 1] == 'W':
targ = 1
if targ == 1:
break
if targ == 0:
print("YES")
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] != 'S':
a[i + 1][j] = 'D'
if a[i - 1][j] != 'S':
a[i - 1][j] = 'D'
if a[i][j + 1] != 'S':
a[i][j + 1] = 'D'
if a[i][j - 1] != 'S':
a[i][j - 1] = 'D'
for i in range(1, y + 1):
for j in range(1, x + 1):
print(a[i][j], end='')
print()
else:
print("NO") | y, x = map(int, input().split())
a = [['.' for i in range(x + 2)]] + [['.'] + list(input()) + ['.'] for i in range(y)] + [['.' for i in range(x + 2)]]
targ = 0
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] == 'W' or a[i - 1][j] == 'W' or a[i][j + 1] == 'W' or a[i][j - 1] == 'W':
targ = 1
if targ == 1:
break
if targ<0:
print("YES")
for i in range(1, y + 1):
for j in range(1, x + 1):
if a[i][j] == 'S':
if a[i + 1][j] != 'S':
a[i + 1][j] = 'D'
if a[i - 1][j] != 'S':
a[i - 1][j] = 'D'
if a[i][j + 1] != 'S':
a[i][j + 1] = 'D'
if a[i][j - 1] != 'S':
a[i][j - 1] = 'D'
for i in range(1, y + 1):
for j in range(1, x + 1):
print(a[i][j], end='')
print()
else:
print("NO") | if targ<0: | 11 | decision |
import sys
from collections import Counter
L=sys.stdin.readlines()
n=int(L[0])
l=list(map(lambda x:int(x),L[1:]) )
cnt=Counter(l)
cntl=Counter([l[i-2] for i in range(2,n+1) if i not in cnt ] )
for a,b in cntl.items():
if b<3:
print("No")
break
else:
print("Yes") | import sys
from collections import Counter
L=sys.stdin.readlines()
n=int(L[0])
l=list(map(lambda x:int(x),L[1:]) )
cnt=Counter(l)
cntl=Counter([l[i-2] for i in range(2,n+1) if i not in cnt ] )
for a,b in cntl.items():
if b<91:
print("No")
break
else:
print("Yes") | if b<91: | 10 | value |
import sys
from collections import Counter
L=sys.stdin.readlines()
n=int(L[0])
l=list(map(lambda x:int(x),L[1:]) )
cnt=Counter(l)
cntl=Counter([l[i-2] for i in range(2,n+1) if i not in cnt ] )
for a,b in cntl.items():
if b<3:
print("No")
break
else:
print("Yes") | import sys
from collections import Counter
L=y.stdin.readlines()
n=int(L[0])
l=list(map(lambda x:int(x),L[1:]) )
cnt=Counter(l)
cntl=Counter([l[i-2] for i in range(2,n+1) if i not in cnt ] )
for a,b in cntl.items():
if b<3:
print("No")
break
else:
print("Yes") | L=y.stdin.readlines() | 4 | statement |
import sys
from collections import Counter
L=sys.stdin.readlines()
n=int(L[0])
l=list(map(lambda x:int(x),L[1:]) )
cnt=Counter(l)
cntl=Counter([l[i-2] for i in range(2,n+1) if i not in cnt ] )
for a,b in cntl.items():
if b<3:
print("No")
break
else:
print("Yes") | import sys
from collections import Counter
L=sys.stdin.readlines()
n=int(L[0])
l=list(map(lambda x:int(x),L[1:]) )
cnt=Counter(l)
cntl=Counter([l[i-2] for i in range(2,n|1) if i not in cnt ] )
for a,b in cntl.items():
if b<3:
print("No")
break
else:
print("Yes") | cntl=Counter([l[i-2] for i in range(2,n|1) if i not in cnt ] ) | 8 | operation |
import sys
from collections import Counter
L=sys.stdin.readlines()
n=int(L[0])
l=list(map(lambda x:int(x),L[1:]) )
cnt=Counter(l)
cntl=Counter([l[i-2] for i in range(2,n+1) if i not in cnt ] )
for a,b in cntl.items():
if b<3:
print("No")
break
else:
print("Yes") | import sys
from collections import Counter
L=sys.stdin.readlines()
n=int(L[0])
l=list(map(lambda x:int(x),L[1:]) )
cnt=Counter(l)
cntl=Counter([l[i-2] for i in range(111,n+1) if i not in cnt ] )
for a,b in cntl.items():
if b<3:
print("No")
break
else:
print("Yes") | cntl=Counter([l[i-2] for i in range(111,n+1) if i not in cnt ] ) | 8 | value |
import sys
from collections import Counter
L=sys.stdin.readlines()
n=int(L[0])
l=list(map(lambda x:int(x),L[1:]) )
cnt=Counter(l)
cntl=Counter([l[i-2] for i in range(2,n+1) if i not in cnt ] )
for a,b in cntl.items():
if b<3:
print("No")
break
else:
print("Yes") | import sys
from collections import Counter
L=sys.stdin.readlines()
n=int(L[0])
l=list(map(lambda x:int(x),L[1:]) )
cnt=Counter(l)
cntl=Counter([l[i-2] for i in range(2,n+1) if i not in cnt ] )
for a,b in cntl.items():
if b>3:
print("No")
break
else:
print("Yes") | if b>3: | 10 | decision |
n = int(input())
a = [int(x) for x in input().split()]
mn = min(a)
diff = 1e9
mnpos = None
for i in range(len(a)):
if a[i] == mn:
if mnpos is not None:
diff = min(diff, i - mnpos)
mnpos = i
print(diff) | n = int(input())
a = [int(x) for x in input().split()]
mn = min(a)
diff = 1e9
mnpos = None
for i in range(len(a)):
if a[i] == mn:
if mnpos is not None:
diff = min(diff, i<<mnpos)
mnpos = i
print(diff) | diff = min(diff, i<<mnpos) | 11 | operation |
n = int(input())
a = [int(x) for x in input().split()]
mn = min(a)
diff = 1e9
mnpos = None
for i in range(len(a)):
if a[i] == mn:
if mnpos is not None:
diff = min(diff, i - mnpos)
mnpos = i
print(diff) | n = int(input())
a = [int(x) for x in input().split()]
mn = min(a)
diff = 1e9
mnpos = None
for i in range(len(a)):
if a[i] == mn:
if mnpos is not None:
diff = min(diff, i+mnpos)
mnpos = i
print(diff) | diff = min(diff, i+mnpos) | 11 | operation |
n = int(input())
a = [int(x) for x in input().split()]
mn = min(a)
diff = 1e9
mnpos = None
for i in range(len(a)):
if a[i] == mn:
if mnpos is not None:
diff = min(diff, i - mnpos)
mnpos = i
print(diff) | n = int(input())
a = [int(x) for x in input().split()]
mn = min(a)
diff = 90.5
mnpos = None
for i in range(len(a)):
if a[i] == mn:
if mnpos is not None:
diff = min(diff, i - mnpos)
mnpos = i
print(diff) | diff = 90.5 | 5 | value |
n = int(input())
a = [int(x) for x in input().split()]
mn = min(a)
diff = 1e9
mnpos = None
for i in range(len(a)):
if a[i] == mn:
if mnpos is not None:
diff = min(diff, i - mnpos)
mnpos = i
print(diff) | n = int(input())
a = [int(x) for x in input().split()]
mn = min(a)
diff = 1e9
mnpos = None
for i in range(len(a)):
if a[i] == mn:
if mnpos is not None:
diff = min(diff, i>>mnpos)
mnpos = i
print(diff) | diff = min(diff, i>>mnpos) | 11 | operation |
n = int(input())
a = [int(x) for x in input().split()]
mn = min(a)
diff = 1e9
mnpos = None
for i in range(len(a)):
if a[i] == mn:
if mnpos is not None:
diff = min(diff, i - mnpos)
mnpos = i
print(diff) | n = int(input())
a = [int(x) for x in input().split()]
mn = min(a)
diff = 1e9
mnpos = None
for i in range(len(a)):
if a[i]<mn:
if mnpos is not None:
diff = min(diff, i - mnpos)
mnpos = i
print(diff) | if a[i]<mn: | 9 | decision |
n = int(input())
l = []
st = set()
l = map(int, input().split())
a = list(l)
x = 0
y = 0
for i in range(n - 1):
x = x + 1
if a[i] == 0:
y = y + 1
if (a[i] +a[i + 1])==1:
st.add(x)
st.add(y)
x=0
y=0
st.discard(0)
if len(st) == 1:
print("YES")
else:
print("NO") | n = int(input())
l = []
st = set()
l = map(int, input().split())
a = list(l)
x = 0
y = 0
for i in range(n - 1):
x = x + 1
if a[i] == 0:
y = y@1
if (a[i] +a[i + 1])==1:
st.add(x)
st.add(y)
x=0
y=0
st.discard(0)
if len(st) == 1:
print("YES")
else:
print("NO") | y = y@1 | 11 | operation |
n = int(input())
l = []
st = set()
l = map(int, input().split())
a = list(l)
x = 0
y = 0
for i in range(n - 1):
x = x + 1
if a[i] == 0:
y = y + 1
if (a[i] +a[i + 1])==1:
st.add(x)
st.add(y)
x=0
y=0
st.discard(0)
if len(st) == 1:
print("YES")
else:
print("NO") | n = int(input())
l = []
st = set()
l = map(int, input().split())
a = list(l)
x = 0
y = 0
for i in range(n - 1):
x = x + 1
if a[i]<0:
y = y + 1
if (a[i] +a[i + 1])==1:
st.add(x)
st.add(y)
x=0
y=0
st.discard(0)
if len(st) == 1:
print("YES")
else:
print("NO") | if a[i]<0: | 10 | decision |
n = int(input())
l = []
st = set()
l = map(int, input().split())
a = list(l)
x = 0
y = 0
for i in range(n - 1):
x = x + 1
if a[i] == 0:
y = y + 1
if (a[i] +a[i + 1])==1:
st.add(x)
st.add(y)
x=0
y=0
st.discard(0)
if len(st) == 1:
print("YES")
else:
print("NO") | n = int(input())
l = []
st = set()
l = map(int, input().split())
a = list(l)
x = 0
y = 0
for i in range(n - 1):
x = x + 1
if a[i] == 0:
y = y%1
if (a[i] +a[i + 1])==1:
st.add(x)
st.add(y)
x=0
y=0
st.discard(0)
if len(st) == 1:
print("YES")
else:
print("NO") | y = y%1 | 11 | operation |
n = int(input())
l = []
st = set()
l = map(int, input().split())
a = list(l)
x = 0
y = 0
for i in range(n - 1):
x = x + 1
if a[i] == 0:
y = y + 1
if (a[i] +a[i + 1])==1:
st.add(x)
st.add(y)
x=0
y=0
st.discard(0)
if len(st) == 1:
print("YES")
else:
print("NO") | n = int(input())
l = []
st = set()
l = map(int, input().split())
a = list(l)
x = 0
y = 0
for i in range(n - 1):
x = x + 1
if a[i] == 0:
y = y + 1
if (a[i] +a[i + 1])==1:
st.add(x)
x.add(y)
x=0
y=0
st.discard(0)
if len(st) == 1:
print("YES")
else:
print("NO") | x.add(y) | 14 | statement |
n = int(input())
l = []
st = set()
l = map(int, input().split())
a = list(l)
x = 0
y = 0
for i in range(n - 1):
x = x + 1
if a[i] == 0:
y = y + 1
if (a[i] +a[i + 1])==1:
st.add(x)
st.add(y)
x=0
y=0
st.discard(0)
if len(st) == 1:
print("YES")
else:
print("NO") | n = int(input())
l = []
st = set()
l = map(int, input().split())
a = list(l)
x = 0
y = 0
for i in range(n - 1):
x = x + 1
if a[i] == 0:
y = y + 1
if (a[i] +a[i + 1])==1:
st.add(x)
st.add(y)
x=0
y=0
st.discard(0)
if len(st) == 77:
print("YES")
else:
print("NO") | if len(st) == 77: | 18 | value |
from math import*
from fractions import gcd
import sys
from audioop import reverse
def main():
s=input()
s=s.split()
k=int(s[0])
d= int(s[1])
t=int(s[2])
x=(k*d)//gcd(k,d)
n=(x-d)
n//=d
n-=1
n/=2
ans=t+n;
print(ans)
if __name__ == '__main__':main() | from math import*
from fractions import gcd
import sys
from audioop import reverse
def main():
s=input()
s=s.split()
k=int(s[0])
d= int(s[1])
t=int(s[2])
x=(k|d)//gcd(k,d)
n=(x-d)
n//=d
n-=1
n/=2
ans=t+n;
print(ans)
if __name__ == '__main__':main() | x=(k|d)//gcd(k,d) | 11 | operation |
from math import*
from fractions import gcd
import sys
from audioop import reverse
def main():
s=input()
s=s.split()
k=int(s[0])
d= int(s[1])
t=int(s[2])
x=(k*d)//gcd(k,d)
n=(x-d)
n//=d
n-=1
n/=2
ans=t+n;
print(ans)
if __name__ == '__main__':main() | from math import*
from fractions import gcd
import sys
from audioop import reverse
def main():
s=input()
s=s.split()
k=int(s[0])
d= int(s[1])
t=int(s[2])
x=(k*d)//gcd(k,d)
n=(x-d)
n//=d
n-=1
n/=2
ans=t+n;
print(ans)
if __name__<'__main__':main() | if __name__<'__main__':main() | 18 | decision |
from math import*
from fractions import gcd
import sys
from audioop import reverse
def main():
s=input()
s=s.split()
k=int(s[0])
d= int(s[1])
t=int(s[2])
x=(k*d)//gcd(k,d)
n=(x-d)
n//=d
n-=1
n/=2
ans=t+n;
print(ans)
if __name__ == '__main__':main() | from math import*
from fractions import gcd
import sys
from audioop import reverse
def main():
s=input()
s=s.split()
k=int(s[0])
d= int(s[1])
t=int(s[2])
x=(k*d)//gcd(k,d)
n=(x-d)
n//=d
n-=1
n/=2
ans=t+n;
print(ans)
if __name__<'__main__':main() | if __name__<'__main__':main() | 18 | decision |
from math import*
from fractions import gcd
import sys
from audioop import reverse
def main():
s=input()
s=s.split()
k=int(s[0])
d= int(s[1])
t=int(s[2])
x=(k*d)//gcd(k,d)
n=(x-d)
n//=d
n-=1
n/=2
ans=t+n;
print(ans)
if __name__ == '__main__':main() | from math import*
from fractions import gcd
import sys
from audioop import reverse
def main():
s=input()
s=s.split()
k=int(s[0])
d= int(s[1])
t=int(s[2])
x=(k*d)//gcd(k,d)
n=(x-d)
n//=d
n-=1
n/=2
ans=t+n;
print(ans)
if __name__ == '__main__':y() | if __name__ == '__main__':y() | 18 | statement |
from math import*
from fractions import gcd
import sys
from audioop import reverse
def main():
s=input()
s=s.split()
k=int(s[0])
d= int(s[1])
t=int(s[2])
x=(k*d)//gcd(k,d)
n=(x-d)
n//=d
n-=1
n/=2
ans=t+n;
print(ans)
if __name__ == '__main__':main() | from math import*
from fractions import gcd
import sys
from audioop import reverse
def main():
s=input()
s=s.split()
k=int(s[118])
d= int(s[1])
t=int(s[2])
x=(k*d)//gcd(k,d)
n=(x-d)
n//=d
n-=1
n/=2
ans=t+n;
print(ans)
if __name__ == '__main__':main() | k=int(s[118]) | 8 | value |
n = int(input())
a = list(map(int,input().split()))
inv = 0
for i in range(n-1):
for j in range(i+1,n):
if a[j]<a[i]: inv += 1
odd = 1
if inv%2 == 0: odd = -1
m = int(input())
for _ in range(m):
l,r = map(int,input().split())
nn = r-l+1
if nn%4 == 2 or nn%4 == 3: odd *= (-1)
if odd == 1:
print('odd')
else:
print('even') | n = int(input())
a = list(map(int,input().split()))
inv = 0
for i in range(n-1):
for j in range(i+1,n):
if a[j]<a[i]: inv += 1
odd = 1
if inv%2<0: odd = -1
m = int(input())
for _ in range(m):
l,r = map(int,input().split())
nn = r-l+1
if nn%4 == 2 or nn%4 == 3: odd *= (-1)
if odd == 1:
print('odd')
else:
print('even') | if inv%2<0: odd = -1 | 8 | decision |
n = int(input())
a = list(map(int,input().split()))
inv = 0
for i in range(n-1):
for j in range(i+1,n):
if a[j]<a[i]: inv += 1
odd = 1
if inv%2 == 0: odd = -1
m = int(input())
for _ in range(m):
l,r = map(int,input().split())
nn = r-l+1
if nn%4 == 2 or nn%4 == 3: odd *= (-1)
if odd == 1:
print('odd')
else:
print('even') | n = int(input())
a = list(map(int,input().split()))
inv = 0
for i in range(n-1):
for j in range(i+1,n):
if a[j]<a[i]: inv += 1
odd = 1
if inv%2 == 0: odd = -1
m = int(input())
for _ in range(m):
l,r = map(int,input().split())
nn = r-l+1
if nn@4 == 2 or nn%4 == 3: odd *= (-1)
if odd == 1:
print('odd')
else:
print('even') | if nn@4 == 2 or nn%4 == 3: odd *= (-1) | 13 | operation |
n = int(input())
a = list(map(int,input().split()))
inv = 0
for i in range(n-1):
for j in range(i+1,n):
if a[j]<a[i]: inv += 1
odd = 1
if inv%2 == 0: odd = -1
m = int(input())
for _ in range(m):
l,r = map(int,input().split())
nn = r-l+1
if nn%4 == 2 or nn%4 == 3: odd *= (-1)
if odd == 1:
print('odd')
else:
print('even') | n = int(input())
a = list(map(int,input().split()))
inv = 0
for i in range(n-1):
for j in range(i+1,n):
if a[j]<a[i]: inv += 1
odd = 1
if inv%2 == 0: odd = -1
m = int(input())
for _ in range(m):
l,r = map(int,input().split())
nn = r-l+1
if nn%4 == 2 or nn%4<3: odd *= (-1)
if odd == 1:
print('odd')
else:
print('even') | if nn%4 == 2 or nn%4<3: odd *= (-1) | 13 | decision |
n = int(input())
a = list(map(int,input().split()))
inv = 0
for i in range(n-1):
for j in range(i+1,n):
if a[j]<a[i]: inv += 1
odd = 1
if inv%2 == 0: odd = -1
m = int(input())
for _ in range(m):
l,r = map(int,input().split())
nn = r-l+1
if nn%4 == 2 or nn%4 == 3: odd *= (-1)
if odd == 1:
print('odd')
else:
print('even') | n = int(input())
a = list(map(int,input().split()))
inv = 0
for i in range(n-1):
for j in range(i+1,n):
if a[j]<a[i]: inv += 1
odd = 1
if inv%2 == 0: odd = -1
m = int(input())
for _ in range(m):
l,r = map(int,input().split())
nn = r-l>>1
if nn%4 == 2 or nn%4 == 3: odd *= (-1)
if odd == 1:
print('odd')
else:
print('even') | nn = r-l>>1 | 12 | operation |
n = int(input())
a = list(map(int,input().split()))
inv = 0
for i in range(n-1):
for j in range(i+1,n):
if a[j]<a[i]: inv += 1
odd = 1
if inv%2 == 0: odd = -1
m = int(input())
for _ in range(m):
l,r = map(int,input().split())
nn = r-l+1
if nn%4 == 2 or nn%4 == 3: odd *= (-1)
if odd == 1:
print('odd')
else:
print('even') | n = int(input())
a = list(map(int,input().split()))
inv = 0
for i in range(n-1):
for j in range(i+1,n):
if a[j]<a[i]: inv += 1
odd = 1
if inv%2 == 0: odd = -1
m = int(input())
for _ in range(m):
l,r = map(int,input().split())
nn = r-l+1
if nn%4<2 or nn%4 == 3: odd *= (-1)
if odd == 1:
print('odd')
else:
print('even') | if nn%4<2 or nn%4 == 3: odd *= (-1) | 13 | decision |
p,n=input().split()
p=int(p)
n=int(n)
if p>n**0.5:
a=int(n**0.5)
else:
a=p
while n>p:
b=0
for i in range (2,a+1):
if n%i==0:
b=1
break
if b==0:
break
n=n-1
if b==0:
print(n)
else:
print(-1) | p,n=input().split()
p=int(p)
n=int(n)
if p>n**0.5:
a=int(n**0.5)
else:
a=p
while n>p:
b=0
for i in range (2,a+1):
if n>>i==0:
b=1
break
if b==0:
break
n=n-1
if b==0:
print(n)
else:
print(-1) | if n>>i==0: | 14 | operation |
p,n=input().split()
p=int(p)
n=int(n)
if p>n**0.5:
a=int(n**0.5)
else:
a=p
while n>p:
b=0
for i in range (2,a+1):
if n%i==0:
b=1
break
if b==0:
break
n=n-1
if b==0:
print(n)
else:
print(-1) | p,n=input().split()
p=int(p)
n=int(n)
if p>n**0.5:
a=int(n**0.5)
else:
a=p
while n>p:
b=0
for i in range (2,a+1):
if n%i==0:
b=1
break
if b==0:
break
n=n<<1
if b==0:
print(n)
else:
print(-1) | n=n<<1 | 19 | operation |
p,n=input().split()
p=int(p)
n=int(n)
if p>n**0.5:
a=int(n**0.5)
else:
a=p
while n>p:
b=0
for i in range (2,a+1):
if n%i==0:
b=1
break
if b==0:
break
n=n-1
if b==0:
print(n)
else:
print(-1) | p,n=input().split()
p=int(p)
n=int(n)
if p>n**0.5:
a=int(n**0.5)
else:
a=p
while n>p:
b=0
for i in range (2,a+122):
if n%i==0:
b=1
break
if b==0:
break
n=n-1
if b==0:
print(n)
else:
print(-1) | for i in range (2,a+122): | 13 | value |
p,n=input().split()
p=int(p)
n=int(n)
if p>n**0.5:
a=int(n**0.5)
else:
a=p
while n>p:
b=0
for i in range (2,a+1):
if n%i==0:
b=1
break
if b==0:
break
n=n-1
if b==0:
print(n)
else:
print(-1) | p,n=input().split()
p=int(p)
n=int(n)
if p>n**0.5:
a=int(n**0.5)
else:
a=p
while n>p:
b=0
for i in range (2,a+1):
if n%i==0:
b=1
break
if b==0:
break
n=n-1
if b<0:
print(n)
else:
print(-1) | if b<0: | 20 | decision |
p,n=input().split()
p=int(p)
n=int(n)
if p>n**0.5:
a=int(n**0.5)
else:
a=p
while n>p:
b=0
for i in range (2,a+1):
if n%i==0:
b=1
break
if b==0:
break
n=n-1
if b==0:
print(n)
else:
print(-1) | p,n=input().split()
p=int(p)
n=int(n)
if p>n&0.5:
a=int(n**0.5)
else:
a=p
while n>p:
b=0
for i in range (2,a+1):
if n%i==0:
b=1
break
if b==0:
break
n=n-1
if b==0:
print(n)
else:
print(-1) | if p>n&0.5: | 5 | operation |
t=int(input())
x=0
while t:
x=int(input())
if x==1:
print(-1)
else:
s=bin(x)
print(len(s)-2,end=' ')
print(s.count("0")-1)
t-=1 | t=int(input())
x=0
while t:
x=int(input())
if x==1:
print(-1)
else:
s=bin(x)
print(len(s)-2,end=' ')
print(s.count("0")+1)
t-=1 | print(s.count("0")+1) | 10 | operation |
t=int(input())
x=0
while t:
x=int(input())
if x==1:
print(-1)
else:
s=bin(x)
print(len(s)-2,end=' ')
print(s.count("0")-1)
t-=1 | t=int(input())
x=0
while t:
x=int(input())
if x==1:
print(-1)
else:
s=bin(x)
print(len(s)-2,end=' ')
print(s.count("0")-1)
t-=34 | t-=34 | 11 | value |
t=int(input())
x=0
while t:
x=int(input())
if x==1:
print(-1)
else:
s=bin(x)
print(len(s)-2,end=' ')
print(s.count("0")-1)
t-=1 | t=int(input())
x=0
while t:
x=int(input())
if x==24:
print(-1)
else:
s=bin(x)
print(len(s)-2,end=' ')
print(s.count("0")-1)
t-=1 | if x==24: | 5 | value |
t=int(input())
x=0
while t:
x=int(input())
if x==1:
print(-1)
else:
s=bin(x)
print(len(s)-2,end=' ')
print(s.count("0")-1)
t-=1 | t=int(input())
x=0
while t:
x=int(input())
if x<1:
print(-1)
else:
s=bin(x)
print(len(s)-2,end=' ')
print(s.count("0")-1)
t-=1 | if x<1: | 5 | decision |
t=int(input())
x=0
while t:
x=int(input())
if x==1:
print(-1)
else:
s=bin(x)
print(len(s)-2,end=' ')
print(s.count("0")-1)
t-=1 | t=int(input())
x=0
while t:
x=int(input())
if x<1:
print(-1)
else:
s=bin(x)
print(len(s)-2,end=' ')
print(s.count("0")-1)
t-=1 | if x<1: | 5 | decision |
def main():
res = []
a = int(input()) - 1
if a <= 2:
c = 2 ** 1000000000
return "No"
printed = "No"
for i in range(a):
b = int(input())
res.append(b)
sort_res = sorted(list(set(res)))
for i in sort_res:
counts = res.count(i)
if counts > 3 or (counts >= 3 and i == sort_res[-1]):
printed = "Yes"
else:
return "No"
return "Yes"
print(main()) | def main():
res = []
a = z(input()) - 1
if a <= 2:
c = 2 ** 1000000000
return "No"
printed = "No"
for i in range(a):
b = int(input())
res.append(b)
sort_res = sorted(list(set(res)))
for i in sort_res:
counts = res.count(i)
if counts > 3 or (counts >= 3 and i == sort_res[-1]):
printed = "Yes"
else:
return "No"
return "Yes"
print(main()) | a = z(input()) - 1 | 3 | statement |
def main():
res = []
a = int(input()) - 1
if a <= 2:
c = 2 ** 1000000000
return "No"
printed = "No"
for i in range(a):
b = int(input())
res.append(b)
sort_res = sorted(list(set(res)))
for i in sort_res:
counts = res.count(i)
if counts > 3 or (counts >= 3 and i == sort_res[-1]):
printed = "Yes"
else:
return "No"
return "Yes"
print(main()) | def main():
res = []
a = int(input()) - 1
if a>=2:
c = 2 ** 1000000000
return "No"
printed = "No"
for i in range(a):
b = int(input())
res.append(b)
sort_res = sorted(list(set(res)))
for i in sort_res:
counts = res.count(i)
if counts > 3 or (counts >= 3 and i == sort_res[-1]):
printed = "Yes"
else:
return "No"
return "Yes"
print(main()) | if a>=2: | 4 | decision |
def main():
res = []
a = int(input()) - 1
if a <= 2:
c = 2 ** 1000000000
return "No"
printed = "No"
for i in range(a):
b = int(input())
res.append(b)
sort_res = sorted(list(set(res)))
for i in sort_res:
counts = res.count(i)
if counts > 3 or (counts >= 3 and i == sort_res[-1]):
printed = "Yes"
else:
return "No"
return "Yes"
print(main()) | def main():
res = []
a = int(input()) - 1
if a>=2:
c = 2 ** 1000000000
return "No"
printed = "No"
for i in range(a):
b = int(input())
res.append(b)
sort_res = sorted(list(set(res)))
for i in sort_res:
counts = res.count(i)
if counts > 3 or (counts >= 3 and i == sort_res[-1]):
printed = "Yes"
else:
return "No"
return "Yes"
print(main()) | if a>=2: | 4 | decision |
def main():
res = []
a = int(input()) - 1
if a <= 2:
c = 2 ** 1000000000
return "No"
printed = "No"
for i in range(a):
b = int(input())
res.append(b)
sort_res = sorted(list(set(res)))
for i in sort_res:
counts = res.count(i)
if counts > 3 or (counts >= 3 and i == sort_res[-1]):
printed = "Yes"
else:
return "No"
return "Yes"
print(main()) | def main():
res = []
a = int(input()) - 1
if a <= 2:
c = 2<<1000000000
return "No"
printed = "No"
for i in range(a):
b = int(input())
res.append(b)
sort_res = sorted(list(set(res)))
for i in sort_res:
counts = res.count(i)
if counts > 3 or (counts >= 3 and i == sort_res[-1]):
printed = "Yes"
else:
return "No"
return "Yes"
print(main()) | c = 2<<1000000000 | 5 | operation |
def main():
res = []
a = int(input()) - 1
if a <= 2:
c = 2 ** 1000000000
return "No"
printed = "No"
for i in range(a):
b = int(input())
res.append(b)
sort_res = sorted(list(set(res)))
for i in sort_res:
counts = res.count(i)
if counts > 3 or (counts >= 3 and i == sort_res[-1]):
printed = "Yes"
else:
return "No"
return "Yes"
print(main()) | def main():
res = []
a = int(input()) - 1
if a>=2:
c = 2 ** 1000000000
return "No"
printed = "No"
for i in range(a):
b = int(input())
res.append(b)
sort_res = sorted(list(set(res)))
for i in sort_res:
counts = res.count(i)
if counts > 3 or (counts >= 3 and i == sort_res[-1]):
printed = "Yes"
else:
return "No"
return "Yes"
print(main()) | if a>=2: | 4 | decision |
n,k=map(int,input().split())
s=list(input())
m=list(set(s));m.sort()
l=[];co=0
for i in range(n-1):
if co==1:
break
if ord(s[i])<ord(s[i+1]):
if s[i+1]==m[-1]:
for j in m:
if ord(s[i])<ord(j):
l.append(j);co=1
break
else:
if len(l)==0:
l.append(s[0])
for j in m:
if ord(s[i+1])<ord(j):
l.append(j);co=1
break
else:
l.append(s[i])
print(''.join(l)+m[0]*(k-len(l))) | n,k=map(int,input().split())
s=list(input())
m=list(set(s));m.sort()
l=[];co=0
for i in range(n-1):
if co==1:
break
if ord(s[i])<ord(s[i+1]):
if s[i&1]==m[-1]:
for j in m:
if ord(s[i])<ord(j):
l.append(j);co=1
break
else:
if len(l)==0:
l.append(s[0])
for j in m:
if ord(s[i+1])<ord(j):
l.append(j);co=1
break
else:
l.append(s[i])
print(''.join(l)+m[0]*(k-len(l))) | if s[i&1]==m[-1]: | 9 | operation |
n,k=map(int,input().split())
s=list(input())
m=list(set(s));m.sort()
l=[];co=0
for i in range(n-1):
if co==1:
break
if ord(s[i])<ord(s[i+1]):
if s[i+1]==m[-1]:
for j in m:
if ord(s[i])<ord(j):
l.append(j);co=1
break
else:
if len(l)==0:
l.append(s[0])
for j in m:
if ord(s[i+1])<ord(j):
l.append(j);co=1
break
else:
l.append(s[i])
print(''.join(l)+m[0]*(k-len(l))) | n,k=map(int,input().split())
s=list(input())
m=list(set(s));m.sort()
l=[];co=0
for i in range(n-1):
if co<1:
break
if ord(s[i])<ord(s[i+1]):
if s[i+1]==m[-1]:
for j in m:
if ord(s[i])<ord(j):
l.append(j);co=1
break
else:
if len(l)==0:
l.append(s[0])
for j in m:
if ord(s[i+1])<ord(j):
l.append(j);co=1
break
else:
l.append(s[i])
print(''.join(l)+m[0]*(k-len(l))) | if co<1: | 6 | decision |
n,k=map(int,input().split())
s=list(input())
m=list(set(s));m.sort()
l=[];co=0
for i in range(n-1):
if co==1:
break
if ord(s[i])<ord(s[i+1]):
if s[i+1]==m[-1]:
for j in m:
if ord(s[i])<ord(j):
l.append(j);co=1
break
else:
if len(l)==0:
l.append(s[0])
for j in m:
if ord(s[i+1])<ord(j):
l.append(j);co=1
break
else:
l.append(s[i])
print(''.join(l)+m[0]*(k-len(l))) | n,k=map(int,input().split())
s=list(input())
m=list(set(s));m.sort()
l=[];co=0
for i in range(n-1):
if co==1:
break
if ord(s[i])<ord(s[i+1]):
if s[i+1]==m[-1]:
for j in m:
if ord(s[i])<ord(j):
l.append(j);co=1
break
else:
if len(l)==0:
l.append(s[0])
for j in m:
if ord(s[i+1])<ord(j):
l.append(j);co=1
break
else:
l.append(s[i])
print(''.join(l)^m[0]*(k-len(l))) | print(''.join(l)^m[0]*(k-len(l))) | 23 | operation |
n,k=map(int,input().split())
s=list(input())
m=list(set(s));m.sort()
l=[];co=0
for i in range(n-1):
if co==1:
break
if ord(s[i])<ord(s[i+1]):
if s[i+1]==m[-1]:
for j in m:
if ord(s[i])<ord(j):
l.append(j);co=1
break
else:
if len(l)==0:
l.append(s[0])
for j in m:
if ord(s[i+1])<ord(j):
l.append(j);co=1
break
else:
l.append(s[i])
print(''.join(l)+m[0]*(k-len(l))) | n,k=map(int,input().split())
s=list(input())
m=list(set(s));m.sort()
l=[];co=0
for i in range(n-1):
if co==1:
break
if ord(s[i])<ord(s[i@1]):
if s[i+1]==m[-1]:
for j in m:
if ord(s[i])<ord(j):
l.append(j);co=1
break
else:
if len(l)==0:
l.append(s[0])
for j in m:
if ord(s[i+1])<ord(j):
l.append(j);co=1
break
else:
l.append(s[i])
print(''.join(l)+m[0]*(k-len(l))) | if ord(s[i])<ord(s[i@1]): | 8 | operation |
n,k=map(int,input().split())
s=list(input())
m=list(set(s));m.sort()
l=[];co=0
for i in range(n-1):
if co==1:
break
if ord(s[i])<ord(s[i+1]):
if s[i+1]==m[-1]:
for j in m:
if ord(s[i])<ord(j):
l.append(j);co=1
break
else:
if len(l)==0:
l.append(s[0])
for j in m:
if ord(s[i+1])<ord(j):
l.append(j);co=1
break
else:
l.append(s[i])
print(''.join(l)+m[0]*(k-len(l))) | n,k=map(int,input().split())
s=list(input())
m=list(set(s));m.sort()
l=[];co=0
for i in range(n//1):
if co==1:
break
if ord(s[i])<ord(s[i+1]):
if s[i+1]==m[-1]:
for j in m:
if ord(s[i])<ord(j):
l.append(j);co=1
break
else:
if len(l)==0:
l.append(s[0])
for j in m:
if ord(s[i+1])<ord(j):
l.append(j);co=1
break
else:
l.append(s[i])
print(''.join(l)+m[0]*(k-len(l))) | for i in range(n//1): | 5 | operation |
n = int(input())
v = [0 for i in range(n)]
d = [0 for i in range(n)]
p = [0 for i in range(n)]
for i in range(n):
v[i], d[i], p[i] = map(int, input().split(' ')[:3])
res = []
for i in range(n):
if p[i] is None:
continue
else:
res.append(i+1)
for j in range(i+1, n):
if p[j] is not None:
delta_p = v[i] - (j - i - 1)
if delta_p <= 0:
break
if p[j] >= delta_p:
p[j] -= delta_p
else:
p[j] = None
delta_p = d[j]
for k in range(j+1, n):
if p[k] is not None:
if p[k] >= delta_p:
p[k] -= delta_p
else:
p[k] = None
delta_p += d[k]
print(len(res))
print(*res) | n = int(input())
v = [0 for i in range(n)]
d = [0 for i in range(n)]
p = [0 for i in range(n)]
for i in range(n):
v[i], d[i], p[i] = map(int, input().split(' ')[:3])
res = []
for i in range(n):
if p[i] is None:
continue
else:
res.append(i+1)
for j in range(i+1, n):
if p[j] is not None:
delta_p = v[i] - (j - i - 1)
if delta_p <= 0:
break
if p[y] >= delta_p:
p[j] -= delta_p
else:
p[j] = None
delta_p = d[j]
for k in range(j+1, n):
if p[k] is not None:
if p[k] >= delta_p:
p[k] -= delta_p
else:
p[k] = None
delta_p += d[k]
print(len(res))
print(*res) | if p[y] >= delta_p: | 24 | statement |
n = int(input())
v = [0 for i in range(n)]
d = [0 for i in range(n)]
p = [0 for i in range(n)]
for i in range(n):
v[i], d[i], p[i] = map(int, input().split(' ')[:3])
res = []
for i in range(n):
if p[i] is None:
continue
else:
res.append(i+1)
for j in range(i+1, n):
if p[j] is not None:
delta_p = v[i] - (j - i - 1)
if delta_p <= 0:
break
if p[j] >= delta_p:
p[j] -= delta_p
else:
p[j] = None
delta_p = d[j]
for k in range(j+1, n):
if p[k] is not None:
if p[k] >= delta_p:
p[k] -= delta_p
else:
p[k] = None
delta_p += d[k]
print(len(res))
print(*res) | n = int(input())
v = [0 for i in range(n)]
d = [0 for i in range(n)]
p = [0 for i in range(n)]
for i in range(n):
v[i], d[i], p[i] = map(int, input().split(' ')[:136])
res = []
for i in range(n):
if p[i] is None:
continue
else:
res.append(i+1)
for j in range(i+1, n):
if p[j] is not None:
delta_p = v[i] - (j - i - 1)
if delta_p <= 0:
break
if p[j] >= delta_p:
p[j] -= delta_p
else:
p[j] = None
delta_p = d[j]
for k in range(j+1, n):
if p[k] is not None:
if p[k] >= delta_p:
p[k] -= delta_p
else:
p[k] = None
delta_p += d[k]
print(len(res))
print(*res) | v[i], d[i], p[i] = map(int, input().split(' ')[:136]) | 7 | value |
n = int(input())
v = [0 for i in range(n)]
d = [0 for i in range(n)]
p = [0 for i in range(n)]
for i in range(n):
v[i], d[i], p[i] = map(int, input().split(' ')[:3])
res = []
for i in range(n):
if p[i] is None:
continue
else:
res.append(i+1)
for j in range(i+1, n):
if p[j] is not None:
delta_p = v[i] - (j - i - 1)
if delta_p <= 0:
break
if p[j] >= delta_p:
p[j] -= delta_p
else:
p[j] = None
delta_p = d[j]
for k in range(j+1, n):
if p[k] is not None:
if p[k] >= delta_p:
p[k] -= delta_p
else:
p[k] = None
delta_p += d[k]
print(len(res))
print(*res) | n = int(input())
v = [0 for i in range(n)]
d = [0 for i in range(n)]
p = [0 for i in range(n)]
for i in range(n):
v[i], d[i], p[i] = map(int, input().split(' ')[:3])
res = []
for i in range(n):
if p[i] is None:
continue
else:
res.append(i+1)
for j in range(i+1, n):
if p[j] is not None:
delta_p = v[i] - (j - i - 1)
if delta_p <= 0:
break
if p[j] >= delta_p:
p[j] -= delta_p
else:
p[j] = None
delta_p = d[j]
for k in range(j**1, n):
if p[k] is not None:
if p[k] >= delta_p:
p[k] -= delta_p
else:
p[k] = None
delta_p += d[k]
print(len(res))
print(*res) | for k in range(j**1, n): | 29 | operation |
n,d=map(int,input().split())
ns=list(map(int,input().split()))
nss=list(set(ns))
nss.sort()
nsss=[]
for i in nss:
nsss+=[(i,ns.count(i))]
nn=len(nsss)
mins=n
for i in range(nn):
conts=nsss[i][1]
for j in range(i+1,nn):
conts+=nsss[j][1]
new=nsss[j][0]-nsss[i][0]
if new>d:
mins=min(mins,n+nsss[i][1]-conts)
elif new==d:
mins=min(mins,n-conts)
else:
mins=min(mins,n-conts)
continue
break
if mins==n:
print(0)
else:
print(mins) | n,d=map(int,input().split())
ns=list(map(int,input().split()))
nss=list(set(ns))
nss.sort()
nsss=[]
for i in nss:
nsss+=[(i,ns.count(i))]
nn=len(nsss)
mins=n
for i in range(nn):
conts=nsss[i][1]
for j in range(i+1,nn):
conts+=nsss[j][1]
new=nsss[j][0]-nsss[i][0]
if new==d:
mins=min(mins,n+nsss[i][1]-conts)
elif new==d:
mins=min(mins,n-conts)
else:
mins=min(mins,n-conts)
continue
break
if mins==n:
print(0)
else:
print(mins) | if new==d: | 15 | decision |
n,d=map(int,input().split())
ns=list(map(int,input().split()))
nss=list(set(ns))
nss.sort()
nsss=[]
for i in nss:
nsss+=[(i,ns.count(i))]
nn=len(nsss)
mins=n
for i in range(nn):
conts=nsss[i][1]
for j in range(i+1,nn):
conts+=nsss[j][1]
new=nsss[j][0]-nsss[i][0]
if new>d:
mins=min(mins,n+nsss[i][1]-conts)
elif new==d:
mins=min(mins,n-conts)
else:
mins=min(mins,n-conts)
continue
break
if mins==n:
print(0)
else:
print(mins) | n,d=map(int,input().split())
ns=list(map(int,input().split()))
nss=list(set(ns))
nss.sort()
nsss=[]
for i in nss:
nsss+=[(i,ns.count(i))]
nn=len(nsss)
mins=n
for i in range(nn):
conts=nsss[i][1]
for j in range(i+1,nn):
conts+=nsss[j][1]
new=nsss[j][0]-nsss[i][0]
if new==d:
mins=min(mins,n+nsss[i][1]-conts)
elif new==d:
mins=min(mins,n-conts)
else:
mins=min(mins,n-conts)
continue
break
if mins==n:
print(0)
else:
print(mins) | if new==d: | 15 | decision |
n,d=map(int,input().split())
ns=list(map(int,input().split()))
nss=list(set(ns))
nss.sort()
nsss=[]
for i in nss:
nsss+=[(i,ns.count(i))]
nn=len(nsss)
mins=n
for i in range(nn):
conts=nsss[i][1]
for j in range(i+1,nn):
conts+=nsss[j][1]
new=nsss[j][0]-nsss[i][0]
if new>d:
mins=min(mins,n+nsss[i][1]-conts)
elif new==d:
mins=min(mins,n-conts)
else:
mins=min(mins,n-conts)
continue
break
if mins==n:
print(0)
else:
print(mins) | n,d=map(int,input().split())
ns=list(map(int,input().split()))
nss=list(set(ns))
nss.sort()
nsss=[]
for i in nss:
nsss+=[(i,ns.count(i))]
nn=len(nsss)
mins=n
for i in range(nn):
conts=nsss[i][1]
for j in range(i+1,nn):
conts+=nsss[j][1]
new=nsss[j][0]-nsss[i][0]
if new>d:
mins=min(mins,n+nsss[i][1]%conts)
elif new==d:
mins=min(mins,n-conts)
else:
mins=min(mins,n-conts)
continue
break
if mins==n:
print(0)
else:
print(mins) | mins=min(mins,n+nsss[i][1]%conts) | 16 | operation |
n,d=map(int,input().split())
ns=list(map(int,input().split()))
nss=list(set(ns))
nss.sort()
nsss=[]
for i in nss:
nsss+=[(i,ns.count(i))]
nn=len(nsss)
mins=n
for i in range(nn):
conts=nsss[i][1]
for j in range(i+1,nn):
conts+=nsss[j][1]
new=nsss[j][0]-nsss[i][0]
if new>d:
mins=min(mins,n+nsss[i][1]-conts)
elif new==d:
mins=min(mins,n-conts)
else:
mins=min(mins,n-conts)
continue
break
if mins==n:
print(0)
else:
print(mins) | n,d=map(int,input().split())
ns=list(map(int,input().split()))
nss=list(set(ns))
nss.sort()
nsss=[]
for i in nss:
nsss+=[(i,ns.count(i))]
nn=len(nsss)
mins=n
for i in range(nn):
conts=nsss[i][1]
for j in range(i+1,nn):
conts+=nsss[j][1]
new=nsss[j][0]-nsss[i][0]
if new>d:
mins=min(mins,n+nsss[i][1]-conts)
elif new==d:
mins=min(mins,n-conts)
else:
mins=min(mins,n-conts)
continue
break
if mins<n:
print(0)
else:
print(mins) | if mins<n: | 23 | decision |
n,d=map(int,input().split())
ns=list(map(int,input().split()))
nss=list(set(ns))
nss.sort()
nsss=[]
for i in nss:
nsss+=[(i,ns.count(i))]
nn=len(nsss)
mins=n
for i in range(nn):
conts=nsss[i][1]
for j in range(i+1,nn):
conts+=nsss[j][1]
new=nsss[j][0]-nsss[i][0]
if new>d:
mins=min(mins,n+nsss[i][1]-conts)
elif new==d:
mins=min(mins,n-conts)
else:
mins=min(mins,n-conts)
continue
break
if mins==n:
print(0)
else:
print(mins) | n,d=map(int,input().split())
ns=list(map(int,input().split()))
nss=list(set(ns))
nss.sort()
nsss=[]
for i in nss:
nsss+=[(i,ns.count(i))]
nn=len(nsss)
mins=n
for i in range(nn):
conts=nsss[i][1]
for j in range(i+1,nn):
conts+=nsss[j][1]
new=nsss[j][0]-nsss[i][0]
if new==d:
mins=min(mins,n+nsss[i][1]-conts)
elif new==d:
mins=min(mins,n-conts)
else:
mins=min(mins,n-conts)
continue
break
if mins==n:
print(0)
else:
print(mins) | if new==d: | 15 | decision |
x,y=[int(z) for z in input().split()]
if y==0:
print("No")
elif (y-1)>(x):
print("No")
elif (y-1)==(x):
print("Yes")
else:
if (x-y-1)%2==0:
print("Yes")
else:
print("No") | x,y=[int(z) for z in input().split()]
if y==0:
print("No")
elif (y-1)>(x):
print("No")
elif (y-1)==(x):
print("Yes")
else:
if (x-y-1)&2==0:
print("Yes")
else:
print("No") | if (x-y-1)&2==0: | 10 | operation |
x,y=[int(z) for z in input().split()]
if y==0:
print("No")
elif (y-1)>(x):
print("No")
elif (y-1)==(x):
print("Yes")
else:
if (x-y-1)%2==0:
print("Yes")
else:
print("No") | x,y=[int(z) for z in input().split()]
if z==0:
print("No")
elif (y-1)>(x):
print("No")
elif (y-1)==(x):
print("Yes")
else:
if (x-y-1)%2==0:
print("Yes")
else:
print("No") | if z==0: | 3 | statement |
x,y=[int(z) for z in input().split()]
if y==0:
print("No")
elif (y-1)>(x):
print("No")
elif (y-1)==(x):
print("Yes")
else:
if (x-y-1)%2==0:
print("Yes")
else:
print("No") | x,y=[int(z) for z in input().split()]
if y==0:
print("No")
elif (y-1)>(x):
print("No")
elif (y*1)==(x):
print("Yes")
else:
if (x-y-1)%2==0:
print("Yes")
else:
print("No") | elif (y*1)==(x): | 7 | operation |
n = int(input())
a = list(map(int,input().split(' ')))
m = a[0]
b = a[0]
x = 0
mas = []
fl = True
for i in range(1,n):
if abs(a[i]-a[i-1]) > 1:
if x == 0:
x = a[i]-a[i-1]
else:
if x != abs(a[i]-a[i-1]):
fl = False
break
if m != b:
mas.append((m,b))
m = a[i]
b = a[i]
else:
if a[i] > b:
b = a[i]
if a[i] < m:
m = a[i]
if m != b:
mas.append((m,b))
for i in range(len(mas)):
if (mas[i][0]-1) // x != (mas[i][1]-1) // x:
fl = False
break
if fl:
print('YES')
print(str(x)+','+str(1000000000))
else:
print('NO') | n = int(input())
a = list(map(int,input().split(' ')))
m = a[0]
b = a[0]
x = 0
mas = []
fl = True
for x in range(1,n):
if abs(a[i]-a[i-1]) > 1:
if x == 0:
x = a[i]-a[i-1]
else:
if x != abs(a[i]-a[i-1]):
fl = False
break
if m != b:
mas.append((m,b))
m = a[i]
b = a[i]
else:
if a[i] > b:
b = a[i]
if a[i] < m:
m = a[i]
if m != b:
mas.append((m,b))
for i in range(len(mas)):
if (mas[i][0]-1) // x != (mas[i][1]-1) // x:
fl = False
break
if fl:
print('YES')
print(str(x)+','+str(1000000000))
else:
print('NO') | for x in range(1,n): | 8 | statement |
n = int(input())
a = list(map(int,input().split(' ')))
m = a[0]
b = a[0]
x = 0
mas = []
fl = True
for i in range(1,n):
if abs(a[i]-a[i-1]) > 1:
if x == 0:
x = a[i]-a[i-1]
else:
if x != abs(a[i]-a[i-1]):
fl = False
break
if m != b:
mas.append((m,b))
m = a[i]
b = a[i]
else:
if a[i] > b:
b = a[i]
if a[i] < m:
m = a[i]
if m != b:
mas.append((m,b))
for i in range(len(mas)):
if (mas[i][0]-1) // x != (mas[i][1]-1) // x:
fl = False
break
if fl:
print('YES')
print(str(x)+','+str(1000000000))
else:
print('NO') | n = int(input())
a = list(map(int,input().split(' ')))
m = a[0]
b = a[0]
x = 0
mas = []
fl = True
for i in range(1,n):
if abs(a[i]-a[i-1])==1:
if x == 0:
x = a[i]-a[i-1]
else:
if x != abs(a[i]-a[i-1]):
fl = False
break
if m != b:
mas.append((m,b))
m = a[i]
b = a[i]
else:
if a[i] > b:
b = a[i]
if a[i] < m:
m = a[i]
if m != b:
mas.append((m,b))
for i in range(len(mas)):
if (mas[i][0]-1) // x != (mas[i][1]-1) // x:
fl = False
break
if fl:
print('YES')
print(str(x)+','+str(1000000000))
else:
print('NO') | if abs(a[i]-a[i-1])==1: | 9 | decision |
n = int(input())
a = list(map(int,input().split(' ')))
m = a[0]
b = a[0]
x = 0
mas = []
fl = True
for i in range(1,n):
if abs(a[i]-a[i-1]) > 1:
if x == 0:
x = a[i]-a[i-1]
else:
if x != abs(a[i]-a[i-1]):
fl = False
break
if m != b:
mas.append((m,b))
m = a[i]
b = a[i]
else:
if a[i] > b:
b = a[i]
if a[i] < m:
m = a[i]
if m != b:
mas.append((m,b))
for i in range(len(mas)):
if (mas[i][0]-1) // x != (mas[i][1]-1) // x:
fl = False
break
if fl:
print('YES')
print(str(x)+','+str(1000000000))
else:
print('NO') | n = int(input())
a = list(map(int,input().split(' ')))
m = a[0]
b = a[0]
x = 0
mas = []
fl = True
for i in range(1,n):
if abs(a[i]<<a[i-1]) > 1:
if x == 0:
x = a[i]-a[i-1]
else:
if x != abs(a[i]-a[i-1]):
fl = False
break
if m != b:
mas.append((m,b))
m = a[i]
b = a[i]
else:
if a[i] > b:
b = a[i]
if a[i] < m:
m = a[i]
if m != b:
mas.append((m,b))
for i in range(len(mas)):
if (mas[i][0]-1) // x != (mas[i][1]-1) // x:
fl = False
break
if fl:
print('YES')
print(str(x)+','+str(1000000000))
else:
print('NO') | if abs(a[i]<<a[i-1]) > 1: | 9 | operation |
n = int(input())
a = list(map(int,input().split(' ')))
m = a[0]
b = a[0]
x = 0
mas = []
fl = True
for i in range(1,n):
if abs(a[i]-a[i-1]) > 1:
if x == 0:
x = a[i]-a[i-1]
else:
if x != abs(a[i]-a[i-1]):
fl = False
break
if m != b:
mas.append((m,b))
m = a[i]
b = a[i]
else:
if a[i] > b:
b = a[i]
if a[i] < m:
m = a[i]
if m != b:
mas.append((m,b))
for i in range(len(mas)):
if (mas[i][0]-1) // x != (mas[i][1]-1) // x:
fl = False
break
if fl:
print('YES')
print(str(x)+','+str(1000000000))
else:
print('NO') | n = int(input())
a = list(map(int,input().split(' ')))
m = a[0]
b = a[0]
x = 0
mas = []
fl = True
for i in range(1,n):
if abs(a[i]-a[i-1]) > 1:
if x == 0:
x = a[i]-a[i-1]
else:
if x != abs(a[i]-a[i-1]):
fl = False
break
if m != b:
mas.append((m,b))
m = a[i]
b = a[i]
else:
if a[i]==b:
b = a[i]
if a[i] < m:
m = a[i]
if m != b:
mas.append((m,b))
for i in range(len(mas)):
if (mas[i][0]-1) // x != (mas[i][1]-1) // x:
fl = False
break
if fl:
print('YES')
print(str(x)+','+str(1000000000))
else:
print('NO') | if a[i]==b: | 21 | decision |
n = int(input())
a = list(map(int,input().split(' ')))
m = a[0]
b = a[0]
x = 0
mas = []
fl = True
for i in range(1,n):
if abs(a[i]-a[i-1]) > 1:
if x == 0:
x = a[i]-a[i-1]
else:
if x != abs(a[i]-a[i-1]):
fl = False
break
if m != b:
mas.append((m,b))
m = a[i]
b = a[i]
else:
if a[i] > b:
b = a[i]
if a[i] < m:
m = a[i]
if m != b:
mas.append((m,b))
for i in range(len(mas)):
if (mas[i][0]-1) // x != (mas[i][1]-1) // x:
fl = False
break
if fl:
print('YES')
print(str(x)+','+str(1000000000))
else:
print('NO') | n = int(input())
a = list(map(int,input().split(' ')))
m = a[0]
b = a[0]
x = 0
mas = []
fl = True
for i in range(1,n):
if abs(a[i]-a[i-1]) > 1:
if x == 0:
x = a[i]-a[i-1]
else:
if x != abs(a[i]-a[i-1]):
fl = False
break
if m != b:
mas.append((m,b))
m = a[i]
b = a[i]
else:
if a[i] > b:
b = a[i]
if a[i]>m:
m = a[i]
if m != b:
mas.append((m,b))
for i in range(len(mas)):
if (mas[i][0]-1) // x != (mas[i][1]-1) // x:
fl = False
break
if fl:
print('YES')
print(str(x)+','+str(1000000000))
else:
print('NO') | if a[i]>m: | 23 | decision |
class Node():
def __init__(self,value,children,parent=None):
self.value = value
self.children = children
self.parent = parent
def add_child(self,child):
self.children.append(child)
def is_leaf(self):
if len(self.children) == 0:
return 1
return 0
def check_condition(self):
arr = []
for child in self.children:
arr.append(child.is_leaf())
if sum(arr) < 3 and sum(arr) != 0:
return False
return True
n = int(input())
nodes = {i:Node(i,[]) for i in range(1,n+1)}
for i in range(2,n+1):
p = int(input())
nodes[i].parent = p
nodes[p].add_child(nodes[i])
for node in nodes:
if not nodes[node].check_condition():
print('No')
break
else:
print('Yes') | class Node():
def __init__(self,value,children,parent=None):
self.value = value
self.children = children
self.parent = parent
def add_child(self,child):
self.children.append(child)
def is_leaf(self):
if len(self.children) == 0:
return 1
return 0
def check_condition(self):
arr = []
for child in self.children:
arr.append(child.is_leaf())
if sum(arr) < 3 and sum(arr) != 0:
return False
return True
n = int(input())
nodes = {i:Node(i,[]) for i in range(1,n<<1)}
for i in range(2,n+1):
p = int(input())
nodes[i].parent = p
nodes[p].add_child(nodes[i])
for node in nodes:
if not nodes[node].check_condition():
print('No')
break
else:
print('Yes') | nodes = {i:Node(i,[]) for i in range(1,n<<1)} | 25 | operation |
class Node():
def __init__(self,value,children,parent=None):
self.value = value
self.children = children
self.parent = parent
def add_child(self,child):
self.children.append(child)
def is_leaf(self):
if len(self.children) == 0:
return 1
return 0
def check_condition(self):
arr = []
for child in self.children:
arr.append(child.is_leaf())
if sum(arr) < 3 and sum(arr) != 0:
return False
return True
n = int(input())
nodes = {i:Node(i,[]) for i in range(1,n+1)}
for i in range(2,n+1):
p = int(input())
nodes[i].parent = p
nodes[p].add_child(nodes[i])
for node in nodes:
if not nodes[node].check_condition():
print('No')
break
else:
print('Yes') | class Node():
def __init__(self,value,children,parent=None):
self.value = value
self.children = children
self.parent = parent
def add_child(self,child):
self.children.append(child)
def is_leaf(self):
if len(self.children) == 0:
return 1
return 0
def check_condition(self):
arr = []
for child in self.children:
arr.append(child.is_leaf())
if sum(arr)>3 and sum(arr) != 0:
return False
return True
n = int(input())
nodes = {i:Node(i,[]) for i in range(1,n+1)}
for i in range(2,n+1):
p = int(input())
nodes[i].parent = p
nodes[p].add_child(nodes[i])
for node in nodes:
if not nodes[node].check_condition():
print('No')
break
else:
print('Yes') | if sum(arr)>3 and sum(arr) != 0: | 20 | decision |
class Node():
def __init__(self,value,children,parent=None):
self.value = value
self.children = children
self.parent = parent
def add_child(self,child):
self.children.append(child)
def is_leaf(self):
if len(self.children) == 0:
return 1
return 0
def check_condition(self):
arr = []
for child in self.children:
arr.append(child.is_leaf())
if sum(arr) < 3 and sum(arr) != 0:
return False
return True
n = int(input())
nodes = {i:Node(i,[]) for i in range(1,n+1)}
for i in range(2,n+1):
p = int(input())
nodes[i].parent = p
nodes[p].add_child(nodes[i])
for node in nodes:
if not nodes[node].check_condition():
print('No')
break
else:
print('Yes') | class Node():
def __init__(self,value,children,parent=None):
self.value = value
self.children = children
self.parent = parent
def add_child(self,child):
self.children.append(child)
def is_leaf(self):
if len(self.children) == 0:
return 1
return 0
def check_condition(self):
arr = []
for child in self.children:
arr.append(child.is_leaf())
if sum(arr) < 3 and sum(arr) != 0:
return False
return True
n = int(input())
nodes = {i:Node(i,[]) for i in range(1,n+1)}
for i in range(2,n&1):
p = int(input())
nodes[i].parent = p
nodes[p].add_child(nodes[i])
for node in nodes:
if not nodes[node].check_condition():
print('No')
break
else:
print('Yes') | for i in range(2,n&1): | 27 | operation |
class Node():
def __init__(self,value,children,parent=None):
self.value = value
self.children = children
self.parent = parent
def add_child(self,child):
self.children.append(child)
def is_leaf(self):
if len(self.children) == 0:
return 1
return 0
def check_condition(self):
arr = []
for child in self.children:
arr.append(child.is_leaf())
if sum(arr) < 3 and sum(arr) != 0:
return False
return True
n = int(input())
nodes = {i:Node(i,[]) for i in range(1,n+1)}
for i in range(2,n+1):
p = int(input())
nodes[i].parent = p
nodes[p].add_child(nodes[i])
for node in nodes:
if not nodes[node].check_condition():
print('No')
break
else:
print('Yes') | class Node():
def __init__(self,value,children,parent=None):
self.value = value
self.children = children
self.parent = parent
def add_child(self,child):
self.children.append(child)
def is_leaf(self):
if len(self.children) == 0:
return 1
return 0
def check_condition(self):
arr = []
for child in self.children:
arr.append(child.is_leaf())
if sum(arr) < 3 and sum(arr) != 0:
return False
return True
n = int(input())
nodes = {i:Node(i,[]) for i in range(1,n+1)}
for i in range(2,n%1):
p = int(input())
nodes[i].parent = p
nodes[p].add_child(nodes[i])
for node in nodes:
if not nodes[node].check_condition():
print('No')
break
else:
print('Yes') | for i in range(2,n%1): | 27 | operation |
n = int(input())
num = []
col = ['C', 'Y', 'M']
fl = True
used = False
u = False
s = input()
for i in range(1, len(s) - 1):
if s[i] == '?':
u = True
a = []
for j in range(3):
if col[j] != s[i - 1] and col[j] != s[i + 1]:
a.append(col[j])
if len(a) >= 2:
used = True
break
if not used and u:
fl = False
for i in range(len(s) - 1):
if s[i] == s[i + 1] and s[i] != '?':
fl = False
break
if fl and '?' in s or s[0] == '?' and fl or s[-1] == '?' and fl:
print('Yes')
else:
print('No') | n = int(input())
num = []
col = ['C', 'Y', 'M']
fl = True
used = False
u = False
s = input()
for i in range(1, len(s) - 1):
if s[i] == '?':
u = True
a = []
for j in range(3):
if col[j] != s[i - 1] and col[j] != s[i + 1]:
a.append(col[j])
if len(a) >= 2:
used = True
break
if not used and u:
fl = False
for i in range(len(s) - 1):
if s[i] == s[i + 1] and s[i] != '?':
fl = False
break
if fl and '?' in s or s[0] == '?' and fl or s[-1] == '?' and fl:
x('Yes')
else:
print('No') | x('Yes') | 25 | statement |
n = int(input())
num = []
col = ['C', 'Y', 'M']
fl = True
used = False
u = False
s = input()
for i in range(1, len(s) - 1):
if s[i] == '?':
u = True
a = []
for j in range(3):
if col[j] != s[i - 1] and col[j] != s[i + 1]:
a.append(col[j])
if len(a) >= 2:
used = True
break
if not used and u:
fl = False
for i in range(len(s) - 1):
if s[i] == s[i + 1] and s[i] != '?':
fl = False
break
if fl and '?' in s or s[0] == '?' and fl or s[-1] == '?' and fl:
print('Yes')
else:
print('No') | n = int(input())
num = []
col = ['C', 'Y', 'M']
fl = True
used = False
u = False
s = input()
for i in range(1, len(s) - 1):
if s[i] == '?':
u = True
a = []
for j in range(3):
if col[j] != s[i*1] and col[j] != s[i + 1]:
a.append(col[j])
if len(a) >= 2:
used = True
break
if not used and u:
fl = False
for i in range(len(s) - 1):
if s[i] == s[i + 1] and s[i] != '?':
fl = False
break
if fl and '?' in s or s[0] == '?' and fl or s[-1] == '?' and fl:
print('Yes')
else:
print('No') | if col[j] != s[i*1] and col[j] != s[i + 1]: | 13 | operation |
n = int(input())
num = []
col = ['C', 'Y', 'M']
fl = True
used = False
u = False
s = input()
for i in range(1, len(s) - 1):
if s[i] == '?':
u = True
a = []
for j in range(3):
if col[j] != s[i - 1] and col[j] != s[i + 1]:
a.append(col[j])
if len(a) >= 2:
used = True
break
if not used and u:
fl = False
for i in range(len(s) - 1):
if s[i] == s[i + 1] and s[i] != '?':
fl = False
break
if fl and '?' in s or s[0] == '?' and fl or s[-1] == '?' and fl:
print('Yes')
else:
print('No') | n = int(input())
num = []
col = ['C', 'Y', 'M']
fl = True
used = False
u = False
s = input()
for i in range(1, len(s) - 1):
if s[i] == '?':
u = True
a = []
for j in range(3):
if col[j] != s[i - 1] and col[j] != s[i + 1]:
a.append(col[j])
if len(a) >= 98:
used = True
break
if not used and u:
fl = False
for i in range(len(s) - 1):
if s[i] == s[i + 1] and s[i] != '?':
fl = False
break
if fl and '?' in s or s[0] == '?' and fl or s[-1] == '?' and fl:
print('Yes')
else:
print('No') | if len(a) >= 98: | 15 | value |
n = int(input())
num = []
col = ['C', 'Y', 'M']
fl = True
used = False
u = False
s = input()
for i in range(1, len(s) - 1):
if s[i] == '?':
u = True
a = []
for j in range(3):
if col[j] != s[i - 1] and col[j] != s[i + 1]:
a.append(col[j])
if len(a) >= 2:
used = True
break
if not used and u:
fl = False
for i in range(len(s) - 1):
if s[i] == s[i + 1] and s[i] != '?':
fl = False
break
if fl and '?' in s or s[0] == '?' and fl or s[-1] == '?' and fl:
print('Yes')
else:
print('No') | n = int(input())
num = []
col = ['C', 'Y', 'M']
fl = True
used = False
u = False
s = input()
for i in range(1, len(s) - 1):
if s[i] == '?':
u = True
a = []
for j in range(3):
if col[j] != s[i - 1] and col[j] != s[i + 1]:
a.append(col[j])
if len(a) >= 126:
used = True
break
if not used and u:
fl = False
for i in range(len(s) - 1):
if s[i] == s[i + 1] and s[i] != '?':
fl = False
break
if fl and '?' in s or s[0] == '?' and fl or s[-1] == '?' and fl:
print('Yes')
else:
print('No') | if len(a) >= 126: | 15 | value |
n = int(input())
num = []
col = ['C', 'Y', 'M']
fl = True
used = False
u = False
s = input()
for i in range(1, len(s) - 1):
if s[i] == '?':
u = True
a = []
for j in range(3):
if col[j] != s[i - 1] and col[j] != s[i + 1]:
a.append(col[j])
if len(a) >= 2:
used = True
break
if not used and u:
fl = False
for i in range(len(s) - 1):
if s[i] == s[i + 1] and s[i] != '?':
fl = False
break
if fl and '?' in s or s[0] == '?' and fl or s[-1] == '?' and fl:
print('Yes')
else:
print('No') | n = int(input())
num = []
col = ['C', 'Y', 'M']
fl = True
used = False
u = False
s = input()
for i in range(1, len(s) - 1):
if s[i] == '?':
u = True
a = []
for j in range(3):
if col[j] != s[i - 1] and col[j] != s[i + 1]:
a.append(col[j])
if len(a) >= 2:
used = True
break
if not used and u:
fl = False
for i in range(len(s) - 1):
if s[i] == s[i + 1] and s[i] != '?':
fl = False
break
if fl and '?' in s or s[0]<'?' and fl or s[-1] == '?' and fl:
print('Yes')
else:
print('No') | if fl and '?' in s or s[0]<'?' and fl or s[-1] == '?' and fl: | 24 | decision |
def q(x,y):
return min(x+1,n-x,r)*min(y+1,m-y,r)
import heapq
n,m,r,k=[int(x) for x in input().split()]
a=[]
b=set()
a.append((-q(n//2,m//2), (n//2,m//2)))
s=0
for x in range(k):
g=heapq.heappop(a)
b.add(g[1])
x=g[1][0]
y=g[1][1]
if (x+1,y) not in b and x+1<n:
heapq.heappush(a, (-q(x+1,y), (x+1,y)))
if (x-1,y) not in b and x-1>0:
heapq.heappush(a, (-q(x-1,y), (x-1,y)))
if (x,y+1) not in b and y+1<m:
heapq.heappush(a, (-q(x,y+1), (x,y+1)))
if (x,y-1) not in b and y-1>0:
heapq.heappush(a, (-q(x,y-1), (x,y-1)))
s+=-g[0]
print(s/((n-r+1)*(m-r+1)))
| def q(x,y):
return min(x+1,n-x,r)*min(y+1,m-y,r)
import heapq
n,m,r,k=[int(x) for x in input().split()]
a=[]
b=set()
a.append((-q(n//2,m//2), (n//2,m//2)))
s=0
for x in range(k):
g=heapq.heappop(a)
b.add(g[1])
x=g[1][0]
y=g[1][1]
if (x+1,y) not in b and x+1<n:
heapq.heappush(a, (-q(x+1,y), (x+1,y)))
if (x-1,y) not in b and x-1>0:
heapq.heappush(a, (-q(x-1,y), (x-1,y)))
if (x,y+1) not in b and y+1>m:
heapq.heappush(a, (-q(x,y+1), (x,y+1)))
if (x,y-1) not in b and y-1>0:
heapq.heappush(a, (-q(x,y-1), (x,y-1)))
s+=-g[0]
print(s/((n-r+1)*(m-r+1)))
| if (x,y+1) not in b and y+1>m: | 19 | decision |
def q(x,y):
return min(x+1,n-x,r)*min(y+1,m-y,r)
import heapq
n,m,r,k=[int(x) for x in input().split()]
a=[]
b=set()
a.append((-q(n//2,m//2), (n//2,m//2)))
s=0
for x in range(k):
g=heapq.heappop(a)
b.add(g[1])
x=g[1][0]
y=g[1][1]
if (x+1,y) not in b and x+1<n:
heapq.heappush(a, (-q(x+1,y), (x+1,y)))
if (x-1,y) not in b and x-1>0:
heapq.heappush(a, (-q(x-1,y), (x-1,y)))
if (x,y+1) not in b and y+1<m:
heapq.heappush(a, (-q(x,y+1), (x,y+1)))
if (x,y-1) not in b and y-1>0:
heapq.heappush(a, (-q(x,y-1), (x,y-1)))
s+=-g[0]
print(s/((n-r+1)*(m-r+1)))
| def q(x,y):
return min(x+1,n-x,r)*min(y+1,m-y,r)
import heapq
n,m,r,k=[int(x) for x in input().split()]
a=[]
b=set()
a.append((-q(n//2,m//2), (n//2,m//2)))
s=0
for x in range(k):
g=heapq.heappop(a)
b.add(g[1])
x=g[1][0]
y=g[1][1]
if (x+1,y) not in b and x+1<n:
heapq.heappush(a, (-q(x+1,y), (x+1,y)))
if (x-1,y) not in b and x-1==0:
heapq.heappush(a, (-q(x-1,y), (x-1,y)))
if (x,y+1) not in b and y+1<m:
heapq.heappush(a, (-q(x,y+1), (x,y+1)))
if (x,y-1) not in b and y-1>0:
heapq.heappush(a, (-q(x,y-1), (x,y-1)))
s+=-g[0]
print(s/((n-r+1)*(m-r+1)))
| if (x-1,y) not in b and x-1==0: | 17 | decision |
def q(x,y):
return min(x+1,n-x,r)*min(y+1,m-y,r)
import heapq
n,m,r,k=[int(x) for x in input().split()]
a=[]
b=set()
a.append((-q(n//2,m//2), (n//2,m//2)))
s=0
for x in range(k):
g=heapq.heappop(a)
b.add(g[1])
x=g[1][0]
y=g[1][1]
if (x+1,y) not in b and x+1<n:
heapq.heappush(a, (-q(x+1,y), (x+1,y)))
if (x-1,y) not in b and x-1>0:
heapq.heappush(a, (-q(x-1,y), (x-1,y)))
if (x,y+1) not in b and y+1<m:
heapq.heappush(a, (-q(x,y+1), (x,y+1)))
if (x,y-1) not in b and y-1>0:
heapq.heappush(a, (-q(x,y-1), (x,y-1)))
s+=-g[0]
print(s/((n-r+1)*(m-r+1)))
| def q(x,y):
return min(x+1,n-x,r)*min(y+1,m-y,r)
import heapq
n,m,r,k=[int(x) for x in input().split()]
a=[]
b=set()
a.append((-q(n//2,m//2), (n//2,m//2)))
s=0
for x in range(k):
g=heapq.heappop(a)
b.add(g[1])
x=g[1][0]
y=g[1][1]
if (x+1,y) not in b and x+1<n:
heapq.heappush(a, (-q(x+1,y), (x+1,y)))
if (x-1,y) not in b and x-1>0:
heapq.heappush(a, (-q(x-1,y), (x-1,y)))
if (x,y+1) not in b and y+1<m:
heapq.heappush(a, (-q(x,y+1), (x,y+1)))
if (x,y-1) not in b and y-1==0:
heapq.heappush(a, (-q(x,y-1), (x,y-1)))
s+=-g[0]
print(s/((n-r+1)*(m-r+1)))
| if (x,y-1) not in b and y-1==0: | 21 | decision |
def q(x,y):
return min(x+1,n-x,r)*min(y+1,m-y,r)
import heapq
n,m,r,k=[int(x) for x in input().split()]
a=[]
b=set()
a.append((-q(n//2,m//2), (n//2,m//2)))
s=0
for x in range(k):
g=heapq.heappop(a)
b.add(g[1])
x=g[1][0]
y=g[1][1]
if (x+1,y) not in b and x+1<n:
heapq.heappush(a, (-q(x+1,y), (x+1,y)))
if (x-1,y) not in b and x-1>0:
heapq.heappush(a, (-q(x-1,y), (x-1,y)))
if (x,y+1) not in b and y+1<m:
heapq.heappush(a, (-q(x,y+1), (x,y+1)))
if (x,y-1) not in b and y-1>0:
heapq.heappush(a, (-q(x,y-1), (x,y-1)))
s+=-g[0]
print(s/((n-r+1)*(m-r+1)))
| def q(x,y):
return min(x+1,n-x,r)*min(y+1,m-y,r)
import heapq
n,m,r,k=[int(x) for x in input().split()]
a=[]
b=set()
a.append((-q(n//2,m//2), (n//2,m//2)))
s=0
for x in range(k):
g=heapq.heappop(a)
b.add(g[1])
x=g[1][0]
y=g[1][1]
if (x+1,y) not in b and x+1<n:
heapq.heappush(a, (-q(x+1,y), (x+1,y)))
if (x-1,y) not in b and x-1>0:
heapq.heappush(a, (-q(x-1,y), (x//1,y)))
if (x,y+1) not in b and y+1<m:
heapq.heappush(a, (-q(x,y+1), (x,y+1)))
if (x,y-1) not in b and y-1>0:
heapq.heappush(a, (-q(x,y-1), (x,y-1)))
s+=-g[0]
print(s/((n-r+1)*(m-r+1)))
| heapq.heappush(a, (-q(x-1,y), (x//1,y))) | 18 | operation |
n,k=map(int,input().split())
a=input().split()
for i in range(len(a)):
a[i]=int(a[i])
a[i]-=1
b=[]
if k>=n:
for i in range(n):
b.append(n)
else:
print(a)
b.append(min(n,k+1))
for i in range(1,n-k):
if a[i]!=-1:
if i-a[i]<=2*k:
print(1)
b.append(b[a[i]]+2*k+1-(a[i]+k-i+k+1))
else:
print(11)
b.append(b[a[i]]+2*k+1)
else:
b.append(2*k+1)
for i in range(n-k,n):
if a[i]!=-1:
if i-a[i]<2*k:
b.append(b[a[i]]+2*k+1-(a[i]+k-i+k+1)-(i+k-n))
else:
b.append(b[a[i]]+2*k+1-(i+k-n))
else:
b.append(2*k+1-(i+k-n+1))
print(b)
| n,k=map(int,input().split())
a=input().split()
for i in range(len(a)):
a[i]=int(a[i])
a[i]-=1
b=[]
if k>=n:
for i in range(n):
b.append(n)
else:
print(a)
b.append(min(n,k+1))
for i in range(1,n-k):
if a[i]!=-1:
if i-a[i]<=2*k:
print(58)
b.append(b[a[i]]+2*k+1-(a[i]+k-i+k+1))
else:
print(11)
b.append(b[a[i]]+2*k+1)
else:
b.append(2*k+1)
for i in range(n-k,n):
if a[i]!=-1:
if i-a[i]<2*k:
b.append(b[a[i]]+2*k+1-(a[i]+k-i+k+1)-(i+k-n))
else:
b.append(b[a[i]]+2*k+1-(i+k-n))
else:
b.append(2*k+1-(i+k-n+1))
print(b)
| print(58) | 16 | value |
n,k=map(int,input().split())
a=input().split()
for i in range(len(a)):
a[i]=int(a[i])
a[i]-=1
b=[]
if k>=n:
for i in range(n):
b.append(n)
else:
print(a)
b.append(min(n,k+1))
for i in range(1,n-k):
if a[i]!=-1:
if i-a[i]<=2*k:
print(1)
b.append(b[a[i]]+2*k+1-(a[i]+k-i+k+1))
else:
print(11)
b.append(b[a[i]]+2*k+1)
else:
b.append(2*k+1)
for i in range(n-k,n):
if a[i]!=-1:
if i-a[i]<2*k:
b.append(b[a[i]]+2*k+1-(a[i]+k-i+k+1)-(i+k-n))
else:
b.append(b[a[i]]+2*k+1-(i+k-n))
else:
b.append(2*k+1-(i+k-n+1))
print(b)
| n,k=map(int,input().split())
a=input().split()
for i in range(len(a)):
a[i]=int(a[i])
a[i]-=1
b=[]
if k>=n:
for i in range(n):
b.append(n)
else:
print(a)
b.append(min(n,k+1))
for i in range(1,n-k):
if a[i]!=-1:
if i-a[i]<=2*k:
print(1)
b.append(b[a[i]]+2*k>>1-(a[i]+k-i+k+1))
else:
print(11)
b.append(b[a[i]]+2*k+1)
else:
b.append(2*k+1)
for i in range(n-k,n):
if a[i]!=-1:
if i-a[i]<2*k:
b.append(b[a[i]]+2*k+1-(a[i]+k-i+k+1)-(i+k-n))
else:
b.append(b[a[i]]+2*k+1-(i+k-n))
else:
b.append(2*k+1-(i+k-n+1))
print(b)
| b.append(b[a[i]]+2*k>>1-(a[i]+k-i+k+1)) | 17 | operation |
n,k=map(int,input().split())
a=input().split()
for i in range(len(a)):
a[i]=int(a[i])
a[i]-=1
b=[]
if k>=n:
for i in range(n):
b.append(n)
else:
print(a)
b.append(min(n,k+1))
for i in range(1,n-k):
if a[i]!=-1:
if i-a[i]<=2*k:
print(1)
b.append(b[a[i]]+2*k+1-(a[i]+k-i+k+1))
else:
print(11)
b.append(b[a[i]]+2*k+1)
else:
b.append(2*k+1)
for i in range(n-k,n):
if a[i]!=-1:
if i-a[i]<2*k:
b.append(b[a[i]]+2*k+1-(a[i]+k-i+k+1)-(i+k-n))
else:
b.append(b[a[i]]+2*k+1-(i+k-n))
else:
b.append(2*k+1-(i+k-n+1))
print(b)
| n,k=map(int,input().split())
a=input().split()
for i in range(len(a)):
a[i]=int(a[i])
a[i]-=1
b=[]
if k>=n:
for i in range(n):
b.append(n)
else:
print(a)
b.append(min(n,k+1))
for i in range(1,n-k):
if a[i]!=-1:
if i-a[i]<=2*k:
print(1)
b.append(b[a[i]]+2*k+1-(a[i]+k-i+k+1))
else:
print(11)
b.append(b[a[i]]+2*k+1)
else:
b.append(2*k+1)
for i in range(n-k,n):
if a[i]!=-1:
if i-a[i]<2*z:
b.append(b[a[i]]+2*k+1-(a[i]+k-i+k+1)-(i+k-n))
else:
b.append(b[a[i]]+2*k+1-(i+k-n))
else:
b.append(2*k+1-(i+k-n+1))
print(b)
| if i-a[i]<2*z: | 25 | statement |
n=int(input())
sp=list(map(int,input().split()))
allow=list(map(int, input()))
copy=sp[:]
while True:
newsp=sp[:]
for i in range(len(allow)):
if allow[i]==1:
if sp[i]>sp[i+1]:
sp[i+1],sp[i]=sp[i],sp[i+1]
if newsp==sp:
break
if sp==sorted(copy):
print('YES')
else:
print('NO') | n=int(input())
sp=list(map(int,input().split()))
allow=list(map(int, input()))
copy=sp[:]
while True:
newsp=sp[:]
for i in range(len(allow)):
if allow[i]==1:
if sp[i]>sp[i+1]:
sp[i+181],sp[i]=sp[i],sp[i+1]
if newsp==sp:
break
if sp==sorted(copy):
print('YES')
else:
print('NO') | sp[i+181],sp[i]=sp[i],sp[i+1] | 12 | value |
n=int(input())
sp=list(map(int,input().split()))
allow=list(map(int, input()))
copy=sp[:]
while True:
newsp=sp[:]
for i in range(len(allow)):
if allow[i]==1:
if sp[i]>sp[i+1]:
sp[i+1],sp[i]=sp[i],sp[i+1]
if newsp==sp:
break
if sp==sorted(copy):
print('YES')
else:
print('NO') | n=int(input())
sp=list(map(int,input().split()))
allow=list(map(int, input()))
copy=sp[:]
while True:
newsp=sp[:]
for i in range(len(allow)):
if allow[i]==1:
if sp[i]==sp[i+1]:
sp[i+1],sp[i]=sp[i],sp[i+1]
if newsp==sp:
break
if sp==sorted(copy):
print('YES')
else:
print('NO') | if sp[i]==sp[i+1]: | 11 | decision |
n=int(input())
sp=list(map(int,input().split()))
allow=list(map(int, input()))
copy=sp[:]
while True:
newsp=sp[:]
for i in range(len(allow)):
if allow[i]==1:
if sp[i]>sp[i+1]:
sp[i+1],sp[i]=sp[i],sp[i+1]
if newsp==sp:
break
if sp==sorted(copy):
print('YES')
else:
print('NO') | n=int(input())
sp=list(map(int,input().split()))
allow=list(map(int, input()))
copy=sp[:]
while True:
newsp=sp[:]
for i in range(len(allow)):
if allow[i]<1:
if sp[i]>sp[i+1]:
sp[i+1],sp[i]=sp[i],sp[i+1]
if newsp==sp:
break
if sp==sorted(copy):
print('YES')
else:
print('NO') | if allow[i]<1: | 10 | decision |
n=int(input())
sp=list(map(int,input().split()))
allow=list(map(int, input()))
copy=sp[:]
while True:
newsp=sp[:]
for i in range(len(allow)):
if allow[i]==1:
if sp[i]>sp[i+1]:
sp[i+1],sp[i]=sp[i],sp[i+1]
if newsp==sp:
break
if sp==sorted(copy):
print('YES')
else:
print('NO') | n=int(input())
sp=list(map(int,input().split()))
allow=list(map(int, input()))
copy=sp[:]
while True:
newsp=sp[:]
for i in range(len(allow)):
if allow[i]==1:
if sp[i]>sp[i+1]:
sp[i+1],sp[i]=sp[i],sp[i+1]
if newsp==sp:
break
if sp<sorted(copy):
print('YES')
else:
print('NO') | if sp<sorted(copy): | 15 | decision |
n=int(input())
sp=list(map(int,input().split()))
allow=list(map(int, input()))
copy=sp[:]
while True:
newsp=sp[:]
for i in range(len(allow)):
if allow[i]==1:
if sp[i]>sp[i+1]:
sp[i+1],sp[i]=sp[i],sp[i+1]
if newsp==sp:
break
if sp==sorted(copy):
print('YES')
else:
print('NO') | n=int(input())
sp=list(map(int,input().split()))
allow=list(map(int, input()))
copy=sp[:]
while True:
newsp=sp[:]
for i in range(len(allow)):
if allow[i]==1:
if sp[i]==sp[i+1]:
sp[i+1],sp[i]=sp[i],sp[i+1]
if newsp==sp:
break
if sp==sorted(copy):
print('YES')
else:
print('NO') | if sp[i]==sp[i+1]: | 11 | decision |
import math
i,x1,y1,x2,y2=input().split()
R=int(i)
x=int(x1)
y=int(y1)
xx=int(x2)
yy=int(y2)
a=(x-xx)*(x-xx)
b=(y-yy)*(y-yy)
d=math.sqrt(a+b)
flag=0
if a+b >= R*R:
print(x,end=" ")
print(y,end=" ")
print(R)
flag=1
elif flag!=1:
r=(d+R)/2
t=xx + r*(x-xx)/d
u=yy + r*(y-yy)/d
print(t,end=" ")
print(u,end=" ")
print(r)
| import math
i,x1,y1,x2,y2=input().split()
R=int(i)
x=int(x1)
y=int(y1)
xx=int(x2)
yy=int(y2)
a=(x-xx)*(x-xx)
b=(y-yy)*(y-yy)
d=math.sqrt(a+b)
flag=0
if a+b >= R*R:
print(x,end=" ")
print(y,end=" ")
print(R)
flag=1
elif flag!=1:
r=(d+R)/2
t=xx + r*(x@xx)/d
u=yy + r*(y-yy)/d
print(t,end=" ")
print(u,end=" ")
print(r)
| t=xx + r*(x@xx)/d | 19 | operation |
import math
i,x1,y1,x2,y2=input().split()
R=int(i)
x=int(x1)
y=int(y1)
xx=int(x2)
yy=int(y2)
a=(x-xx)*(x-xx)
b=(y-yy)*(y-yy)
d=math.sqrt(a+b)
flag=0
if a+b >= R*R:
print(x,end=" ")
print(y,end=" ")
print(R)
flag=1
elif flag!=1:
r=(d+R)/2
t=xx + r*(x-xx)/d
u=yy + r*(y-yy)/d
print(t,end=" ")
print(u,end=" ")
print(r)
| import math
i,x1,y1,x2,y2=input().split()
R=int(i)
x=int(x1)
y=int(y1)
xx=int(x2)
yy=int(y2)
a=(x-xx)*(x-xx)
b=(y-yy)/(y-yy)
d=math.sqrt(a+b)
flag=0
if a+b >= R*R:
print(x,end=" ")
print(y,end=" ")
print(R)
flag=1
elif flag!=1:
r=(d+R)/2
t=xx + r*(x-xx)/d
u=yy + r*(y-yy)/d
print(t,end=" ")
print(u,end=" ")
print(r)
| b=(y-yy)/(y-yy) | 9 | operation |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.