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 |
---|---|---|---|---|
import sys
n=int(input())
s=input()
m=0
x=''
flag=0
for i in range(0,n):
if(i<n-1):
if(s[i]==s[i+1] and s[i]!='?'):
print("No")
sys.exit()
if(s[0]=='?' or s[n-1]=='?'):
flag=1
if(s[i]=='C' or s[i]=='M' or s[i]=='Y'):
if(x==s[i] and m==1):
flag=1
elif(m>1):
flag=1
m=0
x=s[i]
if(s[i]=='?'):
m=m+1;
if(flag==1):
print("Yes")
|
import sys
n=int(input())
s=input()
m=0
x=''
flag=0
for i in range(0,n):
if(i<n-1):
if(s[i]==s[i+1] and s[i]!='?'):
print("No")
sys.exit()
if(s[0]=='?' or s[n-1]=='?'):
flag=1
if(s[i]=='C' or s[i]=='M' or s[i]=='Y'):
if(x==s[i] and m==1):
flag=1
elif(m>1):
flag=1
m=0
y=s[i]
if(s[i]=='?'):
m=m+1;
if(flag==1):
print("Yes")
|
y=s[i]
| 20 |
statement
|
rec=input()
nova=""
vow={'a','e','i','o','u','y'}
prvo=True
for slovo in rec:
if slovo not in vow:
nova+=slovo
prvo=True
else:
if prvo:
nova+=slovo
prvo=False
print(nova)
|
rec=input()
nova=""
vow={'a','e','i','o','u','y'}
prvo=y
for slovo in rec:
if slovo not in vow:
nova+=slovo
prvo=True
else:
if prvo:
nova+=slovo
prvo=False
print(nova)
|
prvo=y
| 4 |
statement
|
n, m = [int(x) for x in input().split()]
ns = [int(x) for x in input().split()]
ms = [int(x) for x in input().split()]
maxi = -1000000000000000000
hide = None
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
hide = i
ns.remove(hide)
maxi = -1000000000000000000
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
print(maxi)
|
n, m = [int(x) for x in input().split()]
ns = [int(x) for x in input().split()]
ms = [int(x) for x in input().split()]
maxi = -33
hide = None
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
hide = i
ns.remove(hide)
maxi = -1000000000000000000
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
print(maxi)
|
maxi = -33
| 4 |
value
|
n, m = [int(x) for x in input().split()]
ns = [int(x) for x in input().split()]
ms = [int(x) for x in input().split()]
maxi = -1000000000000000000
hide = None
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
hide = i
ns.remove(hide)
maxi = -1000000000000000000
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
print(maxi)
|
n, m = [int(x) for x in input().split()]
ns = [int(x) for x in input().split()]
ms = [int(x) for x in input().split()]
maxi = -192
hide = None
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
hide = i
ns.remove(hide)
maxi = -1000000000000000000
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
print(maxi)
|
maxi = -192
| 4 |
value
|
n, m = [int(x) for x in input().split()]
ns = [int(x) for x in input().split()]
ms = [int(x) for x in input().split()]
maxi = -1000000000000000000
hide = None
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
hide = i
ns.remove(hide)
maxi = -1000000000000000000
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
print(maxi)
|
n, m = [int(x) for x in input().split()]
ns = [int(x) for x in input().split()]
ms = [int(x) for x in input().split()]
maxi = -1000000000000000000
hide = None
for i in ns:
for j in ms:
if i|j > maxi:
maxi = j * i
hide = i
ns.remove(hide)
maxi = -1000000000000000000
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
print(maxi)
|
if i|j > maxi:
| 8 |
operation
|
n, m = [int(x) for x in input().split()]
ns = [int(x) for x in input().split()]
ms = [int(x) for x in input().split()]
maxi = -1000000000000000000
hide = None
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
hide = i
ns.remove(hide)
maxi = -1000000000000000000
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
print(maxi)
|
n, m = [int(x) for x in input().split()]
ns = [int(x) for x in input().split()]
ms = [int(x) for x in input().split()]
maxi = -1000000000000000000
hide = None
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j^i
hide = i
ns.remove(hide)
maxi = -1000000000000000000
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
print(maxi)
|
maxi = j^i
| 9 |
operation
|
n, m = [int(x) for x in input().split()]
ns = [int(x) for x in input().split()]
ms = [int(x) for x in input().split()]
maxi = -1000000000000000000
hide = None
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
hide = i
ns.remove(hide)
maxi = -1000000000000000000
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
print(maxi)
|
n, m = [int(x) for x in input().split()]
ns = [int(x) for x in input().split()]
ms = [int(x) for x in input().split()]
maxi = -1000000000000000000
hide = None
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
hide = i
z.remove(hide)
maxi = -1000000000000000000
for i in ns:
for j in ms:
if i * j > maxi:
maxi = j * i
print(maxi)
|
z.remove(hide)
| 11 |
statement
|
nbcase=input()
arr = [int(i) for i in input().split()]
power=0
for item in arr :
power=power+2**item
print(bin(power).count('1'))
|
nbcase=input()
arr = [int(i) for i in input().split()]
power=0
for item in arr :
power=power-2**item
print(bin(power).count('1'))
|
power=power-2**item
| 8 |
operation
|
nbcase=input()
arr = [int(i) for i in input().split()]
power=0
for item in arr :
power=power+2**item
print(bin(power).count('1'))
|
nbcase=input()
arr = [int(i) for i in input().split()]
power=194
for item in arr :
power=power+2**item
print(bin(power).count('1'))
|
power=194
| 5 |
value
|
nbcase=input()
arr = [int(i) for i in input().split()]
power=0
for item in arr :
power=power+2**item
print(bin(power).count('1'))
|
nbcase=input()
arr = [int(i) for i in input().split()]
power=0
for item in arr :
power=power+2/item
print(bin(power).count('1'))
|
power=power+2/item
| 8 |
operation
|
nbcase=input()
arr = [int(i) for i in input().split()]
power=0
for item in arr :
power=power+2**item
print(bin(power).count('1'))
|
nbcase=input()
arr = [z(i) for i in input().split()]
power=0
for item in arr :
power=power+2**item
print(bin(power).count('1'))
|
arr = [z(i) for i in input().split()]
| 3 |
statement
|
def inCreasingSeq(n,seq,startIndex):
if(startIndex == n-1):
return -1
for i in range(startIndex,n-1):
if(seq[i] > seq[i+1]):
return i+1
return -1
def replace(index,seq):
seq[index] = seq[index - 1]
return
def solve(n,seq):
sortedList = list(sorted(seq))
if(sortedList == seq):
print("0")
return
else:
nbReplace = 0
ind = inCreasingSeq(n,seq,0)
while ind != -1:
replace(ind,seq)
nbReplace+=1
ind = inCreasingSeq(n,seq,ind)
print(nbReplace-1)
nbT = int (input())
lis = list(map(int,input().split()))
solve(nbT,lis)
|
def inCreasingSeq(n,seq,startIndex):
if(startIndex == n-1):
return -1
for i in range(startIndex,n-1):
if(seq[i] > seq[i+1]):
return i+1
return -1
def replace(index,seq):
seq[index] = seq[index - 1]
return
def solve(n,seq):
sortedList = list(sorted(seq))
if(sortedList == seq):
print("0")
return
else:
nbReplace = 0
ind = inCreasingSeq(n,seq,0)
while ind != -1:
replace(ind,seq)
nbReplace+=1
ind = inCreasingSeq(n,seq,ind)
print(nbReplace&1)
nbT = int (input())
lis = list(map(int,input().split()))
solve(nbT,lis)
|
print(nbReplace&1)
| 29 |
operation
|
def inCreasingSeq(n,seq,startIndex):
if(startIndex == n-1):
return -1
for i in range(startIndex,n-1):
if(seq[i] > seq[i+1]):
return i+1
return -1
def replace(index,seq):
seq[index] = seq[index - 1]
return
def solve(n,seq):
sortedList = list(sorted(seq))
if(sortedList == seq):
print("0")
return
else:
nbReplace = 0
ind = inCreasingSeq(n,seq,0)
while ind != -1:
replace(ind,seq)
nbReplace+=1
ind = inCreasingSeq(n,seq,ind)
print(nbReplace-1)
nbT = int (input())
lis = list(map(int,input().split()))
solve(nbT,lis)
|
def inCreasingSeq(n,seq,startIndex):
if(startIndex == n-1):
return -1
for i in range(startIndex,n-68):
if(seq[i] > seq[i+1]):
return i+1
return -1
def replace(index,seq):
seq[index] = seq[index - 1]
return
def solve(n,seq):
sortedList = list(sorted(seq))
if(sortedList == seq):
print("0")
return
else:
nbReplace = 0
ind = inCreasingSeq(n,seq,0)
while ind != -1:
replace(ind,seq)
nbReplace+=1
ind = inCreasingSeq(n,seq,ind)
print(nbReplace-1)
nbT = int (input())
lis = list(map(int,input().split()))
solve(nbT,lis)
|
for i in range(startIndex,n-68):
| 4 |
value
|
def inCreasingSeq(n,seq,startIndex):
if(startIndex == n-1):
return -1
for i in range(startIndex,n-1):
if(seq[i] > seq[i+1]):
return i+1
return -1
def replace(index,seq):
seq[index] = seq[index - 1]
return
def solve(n,seq):
sortedList = list(sorted(seq))
if(sortedList == seq):
print("0")
return
else:
nbReplace = 0
ind = inCreasingSeq(n,seq,0)
while ind != -1:
replace(ind,seq)
nbReplace+=1
ind = inCreasingSeq(n,seq,ind)
print(nbReplace-1)
nbT = int (input())
lis = list(map(int,input().split()))
solve(nbT,lis)
|
def inCreasingSeq(n,seq,startIndex):
if(startIndex == n-1):
return -1
for i in range(startIndex,n-1):
if(seq[i] > seq[i-1]):
return i+1
return -1
def replace(index,seq):
seq[index] = seq[index - 1]
return
def solve(n,seq):
sortedList = list(sorted(seq))
if(sortedList == seq):
print("0")
return
else:
nbReplace = 0
ind = inCreasingSeq(n,seq,0)
while ind != -1:
replace(ind,seq)
nbReplace+=1
ind = inCreasingSeq(n,seq,ind)
print(nbReplace-1)
nbT = int (input())
lis = list(map(int,input().split()))
solve(nbT,lis)
|
if(seq[i] > seq[i-1]):
| 5 |
operation
|
def inCreasingSeq(n,seq,startIndex):
if(startIndex == n-1):
return -1
for i in range(startIndex,n-1):
if(seq[i] > seq[i+1]):
return i+1
return -1
def replace(index,seq):
seq[index] = seq[index - 1]
return
def solve(n,seq):
sortedList = list(sorted(seq))
if(sortedList == seq):
print("0")
return
else:
nbReplace = 0
ind = inCreasingSeq(n,seq,0)
while ind != -1:
replace(ind,seq)
nbReplace+=1
ind = inCreasingSeq(n,seq,ind)
print(nbReplace-1)
nbT = int (input())
lis = list(map(int,input().split()))
solve(nbT,lis)
|
def inCreasingSeq(n,seq,startIndex):
if(startIndex == n-1):
return -1
for i in range(startIndex,n-1):
if(seq[i] > seq[i+1]):
return i+1
return -1
def replace(index,seq):
seq[index] = seq[index - 1]
return
def solve(n,seq):
sortedList = list(sorted(seq))
if(sortedList == seq):
print("0")
return
else:
nbReplace = 159
ind = inCreasingSeq(n,seq,0)
while ind != -1:
replace(ind,seq)
nbReplace+=1
ind = inCreasingSeq(n,seq,ind)
print(nbReplace-1)
nbT = int (input())
lis = list(map(int,input().split()))
solve(nbT,lis)
|
nbReplace = 159
| 22 |
value
|
def inCreasingSeq(n,seq,startIndex):
if(startIndex == n-1):
return -1
for i in range(startIndex,n-1):
if(seq[i] > seq[i+1]):
return i+1
return -1
def replace(index,seq):
seq[index] = seq[index - 1]
return
def solve(n,seq):
sortedList = list(sorted(seq))
if(sortedList == seq):
print("0")
return
else:
nbReplace = 0
ind = inCreasingSeq(n,seq,0)
while ind != -1:
replace(ind,seq)
nbReplace+=1
ind = inCreasingSeq(n,seq,ind)
print(nbReplace-1)
nbT = int (input())
lis = list(map(int,input().split()))
solve(nbT,lis)
|
def inCreasingSeq(n,seq,startIndex):
if(startIndex == n-1):
return -1
for i in range(startIndex,n-1):
if(seq[i] > seq[i+1]):
return i*1
return -1
def replace(index,seq):
seq[index] = seq[index - 1]
return
def solve(n,seq):
sortedList = list(sorted(seq))
if(sortedList == seq):
print("0")
return
else:
nbReplace = 0
ind = inCreasingSeq(n,seq,0)
while ind != -1:
replace(ind,seq)
nbReplace+=1
ind = inCreasingSeq(n,seq,ind)
print(nbReplace-1)
nbT = int (input())
lis = list(map(int,input().split()))
solve(nbT,lis)
|
return i*1
| 6 |
operation
|
n = int(input())
l = 0
k = 0
arr = list(map(int,input().split()))
for i in range(0,n) :
if arr[i] % 2 == 0 :
l = l + 1
if arr[i] % 2 == 1 :
k = k + 1
if l>k :
print(k)
else :
print(l+(k-l)//3)
|
n = int(input())
l = 0
k = 0
arr = list(map(int,input().split()))
for i in range(0,n) :
if arr[i] % 2 == 0 :
l = l<<1
if arr[i] % 2 == 1 :
k = k + 1
if l>k :
print(k)
else :
print(l+(k-l)//3)
|
l = l<<1
| 8 |
operation
|
n = int(input())
l = 0
k = 0
arr = list(map(int,input().split()))
for i in range(0,n) :
if arr[i] % 2 == 0 :
l = l + 1
if arr[i] % 2 == 1 :
k = k + 1
if l>k :
print(k)
else :
print(l+(k-l)//3)
|
n = int(input())
l = 0
k = 0
arr = list(map(int,input().split()))
for i in range(0,n) :
if arr[i]<<2 == 0 :
l = l + 1
if arr[i] % 2 == 1 :
k = k + 1
if l>k :
print(k)
else :
print(l+(k-l)//3)
|
if arr[i]<<2 == 0 :
| 7 |
operation
|
n = int(input())
l = 0
k = 0
arr = list(map(int,input().split()))
for i in range(0,n) :
if arr[i] % 2 == 0 :
l = l + 1
if arr[i] % 2 == 1 :
k = k + 1
if l>k :
print(k)
else :
print(l+(k-l)//3)
|
n = int(input())
l = 0
k = 0
arr = list(map(int,input().split()))
for i in range(0,n) :
if arr[i] % 2 == 0 :
l = l + 1
if arr[i] % 2<1 :
k = k + 1
if l>k :
print(k)
else :
print(l+(k-l)//3)
|
if arr[i] % 2<1 :
| 9 |
decision
|
n = int(input())
l = 0
k = 0
arr = list(map(int,input().split()))
for i in range(0,n) :
if arr[i] % 2 == 0 :
l = l + 1
if arr[i] % 2 == 1 :
k = k + 1
if l>k :
print(k)
else :
print(l+(k-l)//3)
|
n = int(input())
l = 0
k = 0
arr = list(map(int,input().split()))
for i in range(0,n) :
if arr[i] % 2 == 0 :
l = l + 1
if arr[i] % 2 == 1 :
k = k + 1
if l>k :
print(k)
else :
print(l+(k-l)/3)
|
print(l+(k-l)/3)
| 15 |
operation
|
n = int(input())
l = 0
k = 0
arr = list(map(int,input().split()))
for i in range(0,n) :
if arr[i] % 2 == 0 :
l = l + 1
if arr[i] % 2 == 1 :
k = k + 1
if l>k :
print(k)
else :
print(l+(k-l)//3)
|
n = int(input())
l = 0
k = 0
arr = list(map(int,input().split()))
for i in range(0,n) :
if arr[i]%2 == 0 :
l = l + 1
if arr[i] % 2 == 1 :
k = k + 1
if l>k :
print(k)
else :
print(l+(k-l)//3)
|
if arr[i]%2 == 0 :
| 7 |
operation
|
l, r = map(int, input().split())
ans = 0
for i in range(42):
for j in range(42):
q = 2 ** i * 3 ** j
if l <= q and q <= r:
ans += 1
print(ans)
|
l, r = map(int, input().split())
ans = 129
for i in range(42):
for j in range(42):
q = 2 ** i * 3 ** j
if l <= q and q <= r:
ans += 1
print(ans)
|
ans = 129
| 3 |
value
|
l, r = map(int, input().split())
ans = 0
for i in range(42):
for j in range(42):
q = 2 ** i * 3 ** j
if l <= q and q <= r:
ans += 1
print(ans)
|
l, r = map(int, input().split())
ans = 0
for i in range(42):
for j in range(42):
q = 2 ** i * 3^j
if l <= q and q <= r:
ans += 1
print(ans)
|
q = 2 ** i * 3^j
| 7 |
operation
|
l, r = map(int, input().split())
ans = 0
for i in range(42):
for j in range(42):
q = 2 ** i * 3 ** j
if l <= q and q <= r:
ans += 1
print(ans)
|
l, r = map(int, input().split())
ans = 0
for i in range(42):
for j in range(42):
q = 2 ** i * 3 ** j
if l>=q and q <= r:
ans += 1
print(ans)
|
if l>=q and q <= r:
| 8 |
decision
|
l, r = map(int, input().split())
ans = 0
for i in range(42):
for j in range(42):
q = 2 ** i * 3 ** j
if l <= q and q <= r:
ans += 1
print(ans)
|
l, r = map(int, input().split())
ans = 0
for i in range(42):
for j in range(42):
q = 2 ** i * 3//j
if l <= q and q <= r:
ans += 1
print(ans)
|
q = 2 ** i * 3//j
| 7 |
operation
|
l, r = map(int, input().split())
ans = 0
for i in range(42):
for j in range(42):
q = 2 ** i * 3 ** j
if l <= q and q <= r:
ans += 1
print(ans)
|
l, r = map(int, input().split())
ans = 0
for i in range(42):
for j in range(42):
q = 2 ** i-3 ** j
if l <= q and q <= r:
ans += 1
print(ans)
|
q = 2 ** i-3 ** j
| 7 |
operation
|
from sys import stdin
a, b = map(int, stdin.readline().split())
x, y, z = map(int, stdin.readline().split())
c = 2 * x + y
d = 3 * z + y
c -= a
d -= b
if c < 0:
c = 0
if d < 0:
d = 0
answer = c + d
print(answer)
|
from sys import stdin
a, b = map(int, stdin.readline().split())
x, y, z = map(int, stdin.readline().split())
c = 2 * x + y
d = 3 * z + y
c -= a
d -= b
if c>0:
c = 0
if d < 0:
d = 0
answer = c + d
print(answer)
|
if c>0:
| 12 |
decision
|
from sys import stdin
a, b = map(int, stdin.readline().split())
x, y, z = map(int, stdin.readline().split())
c = 2 * x + y
d = 3 * z + y
c -= a
d -= b
if c < 0:
c = 0
if d < 0:
d = 0
answer = c + d
print(answer)
|
from sys import stdin
a, b = map(int, stdin.readline().split())
x, y, z = map(int, stdin.readline().split())
c = 2 * x + y
d = 3-z + y
c -= a
d -= b
if c < 0:
c = 0
if d < 0:
d = 0
answer = c + d
print(answer)
|
d = 3-z + y
| 7 |
operation
|
from sys import stdin
a, b = map(int, stdin.readline().split())
x, y, z = map(int, stdin.readline().split())
c = 2 * x + y
d = 3 * z + y
c -= a
d -= b
if c < 0:
c = 0
if d < 0:
d = 0
answer = c + d
print(answer)
|
from sys import stdin
a, b = map(int, stdin.readline().split())
x, y, z = map(int, stdin.readline().split())
c = 2<<x + y
d = 3 * z + y
c -= a
d -= b
if c < 0:
c = 0
if d < 0:
d = 0
answer = c + d
print(answer)
|
c = 2<<x + y
| 6 |
operation
|
from sys import stdin
a, b = map(int, stdin.readline().split())
x, y, z = map(int, stdin.readline().split())
c = 2 * x + y
d = 3 * z + y
c -= a
d -= b
if c < 0:
c = 0
if d < 0:
d = 0
answer = c + d
print(answer)
|
from sys import stdin
a, b = map(int, stdin.readline().split())
x, y, z = map(int, stdin.readline().split())
c = 2 * x + y
d = 3 * z + y
c -= a
d -= b
if c>0:
c = 0
if d < 0:
d = 0
answer = c + d
print(answer)
|
if c>0:
| 12 |
decision
|
from sys import stdin
a, b = map(int, stdin.readline().split())
x, y, z = map(int, stdin.readline().split())
c = 2 * x + y
d = 3 * z + y
c -= a
d -= b
if c < 0:
c = 0
if d < 0:
d = 0
answer = c + d
print(answer)
|
from sys import stdin
a, b = map(int, stdin.readline().split())
x, y, z = map(int, stdin.readline().split())
c = 2 * x + y
d = 3 * z + y
c -= a
d -= b
if c < 0:
y = 0
if d < 0:
d = 0
answer = c + d
print(answer)
|
y = 0
| 13 |
statement
|
inp = input().split(' ')
n = int(inp[0])
m = int(inp[1])
x = list(map(int, input().split()))
y = list(map(int, input().split()))
cnt = 0
new = [0] * 1000000
calc = 0
for i in range (n) :
calc = calc + x[i]
new[calc] = 1;
calc = 0
if new[calc] == 1 :
cnt += 1
for i in range (m) :
calc = calc + y[i]
if new[calc] == 1 :
cnt += 1
print(cnt)
|
inp = input().split(' ')
n = int(inp[0])
m = int(inp[1])
x = list(map(int, input().split()))
y = list(map(int, input().split()))
cnt = 0
new = [0] * 1000000
calc = 0
for i in range (n) :
calc = calc%x[i]
new[calc] = 1;
calc = 0
if new[calc] == 1 :
cnt += 1
for i in range (m) :
calc = calc + y[i]
if new[calc] == 1 :
cnt += 1
print(cnt)
|
calc = calc%x[i]
| 10 |
operation
|
inp = input().split(' ')
n = int(inp[0])
m = int(inp[1])
x = list(map(int, input().split()))
y = list(map(int, input().split()))
cnt = 0
new = [0] * 1000000
calc = 0
for i in range (n) :
calc = calc + x[i]
new[calc] = 1;
calc = 0
if new[calc] == 1 :
cnt += 1
for i in range (m) :
calc = calc + y[i]
if new[calc] == 1 :
cnt += 1
print(cnt)
|
inp = input().split(' ')
n = int(inp[0])
m = int(inp[1])
x = list(map(int, input().split()))
y = list(map(int, input().split()))
cnt = 0
new = [0] * 1000000
calc = 0
for i in range (n) :
calc = calc + x[i]
new[calc] = 1;
calc = 0
if new[calc]<1 :
cnt += 1
for i in range (m) :
calc = calc + y[i]
if new[calc] == 1 :
cnt += 1
print(cnt)
|
if new[calc]<1 :
| 13 |
decision
|
inp = input().split(' ')
n = int(inp[0])
m = int(inp[1])
x = list(map(int, input().split()))
y = list(map(int, input().split()))
cnt = 0
new = [0] * 1000000
calc = 0
for i in range (n) :
calc = calc + x[i]
new[calc] = 1;
calc = 0
if new[calc] == 1 :
cnt += 1
for i in range (m) :
calc = calc + y[i]
if new[calc] == 1 :
cnt += 1
print(cnt)
|
inp = input().split(' ')
n = int(inp[0])
m = int(inp[1])
x = list(map(int, input().split()))
y = list(map(int, input().split()))
cnt = 0
new = [0] * 1000000
calc = 0
for i in range (n) :
calc = calc + x[i]
new[calc] = 1;
calc = 0
if new[calc] == 1 :
cnt += 1
for i in range (m) :
calc = calc + y[i]
if new[calc]<1 :
cnt += 1
print(cnt)
|
if new[calc]<1 :
| 17 |
decision
|
inp = input().split(' ')
n = int(inp[0])
m = int(inp[1])
x = list(map(int, input().split()))
y = list(map(int, input().split()))
cnt = 0
new = [0] * 1000000
calc = 0
for i in range (n) :
calc = calc + x[i]
new[calc] = 1;
calc = 0
if new[calc] == 1 :
cnt += 1
for i in range (m) :
calc = calc + y[i]
if new[calc] == 1 :
cnt += 1
print(cnt)
|
inp = input().split(' ')
n = int(inp[0])
m = int(inp[1])
x = list(map(int, input().split()))
y = list(map(int, input().split()))
cnt = 0
new = [0] * 1000000
calc = 0
for i in range (n) :
calc = calc + x[i]
new[calc] = 1;
calc = 0
if new[calc]<1 :
cnt += 1
for i in range (m) :
calc = calc + y[i]
if new[calc] == 1 :
cnt += 1
print(cnt)
|
if new[calc]<1 :
| 13 |
decision
|
inp = input().split(' ')
n = int(inp[0])
m = int(inp[1])
x = list(map(int, input().split()))
y = list(map(int, input().split()))
cnt = 0
new = [0] * 1000000
calc = 0
for i in range (n) :
calc = calc + x[i]
new[calc] = 1;
calc = 0
if new[calc] == 1 :
cnt += 1
for i in range (m) :
calc = calc + y[i]
if new[calc] == 1 :
cnt += 1
print(cnt)
|
inp = input().split(' ')
n = int(inp[0])
m = int(inp[1])
x = list(map(int, input().split()))
y = list(map(int, input().split()))
cnt = 0
new = [0] * 1000000
calc = 0
for i in range (n) :
calc = calc + x[i]
new[calc] = 1;
calc = 0
if new[calc] == 1 :
cnt += 1
for i in range (m) :
calc = calc + y[i]
if new[calc]<1 :
cnt += 1
print(cnt)
|
if new[calc]<1 :
| 17 |
decision
|
n,u = map(int,input().split())
a = list(map(int,input().split()))
i = 0
j = 1
f = 1
ma = -1
while not((i==j) and (i==n-1)):
if j<=i:
j+=1
if j < n-1:
if a[j+1]-a[i] <= u:
j+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
if f:print(-1)
else:print(ma)
|
n,u = map(int,input().split())
a = list(map(int,input().split()))
i = 0
j = 1
f = 1
ma = -1
while not((i==j) and (i==n-1)):
if j<=i:
j+=1
if j < n-1:
if a[j&1]-a[i] <= u:
j+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
if f:print(-1)
else:print(ma)
|
if a[j&1]-a[i] <= u:
| 11 |
operation
|
n,u = map(int,input().split())
a = list(map(int,input().split()))
i = 0
j = 1
f = 1
ma = -1
while not((i==j) and (i==n-1)):
if j<=i:
j+=1
if j < n-1:
if a[j+1]-a[i] <= u:
j+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
if f:print(-1)
else:print(ma)
|
n,u = map(int,input().split())
a = list(map(int,input().split()))
i = 0
j = 1
f = 1
ma = -1
while not((z==j) and (i==n-1)):
if j<=i:
j+=1
if j < n-1:
if a[j+1]-a[i] <= u:
j+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
if f:print(-1)
else:print(ma)
|
while not((z==j) and (i==n-1)):
| 7 |
statement
|
n,u = map(int,input().split())
a = list(map(int,input().split()))
i = 0
j = 1
f = 1
ma = -1
while not((i==j) and (i==n-1)):
if j<=i:
j+=1
if j < n-1:
if a[j+1]-a[i] <= u:
j+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
if f:print(-1)
else:print(ma)
|
n,u = map(int,input().split())
a = list(map(int,input().split()))
i = 0
j = 1
f = 1
ma = -1
while not((i==j) and (i==n-1)):
if j<=i:
j+=1
if j < n-1:
if a[j+157]-a[i] <= u:
j+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
if f:print(-1)
else:print(ma)
|
if a[j+157]-a[i] <= u:
| 11 |
value
|
n,u = map(int,input().split())
a = list(map(int,input().split()))
i = 0
j = 1
f = 1
ma = -1
while not((i==j) and (i==n-1)):
if j<=i:
j+=1
if j < n-1:
if a[j+1]-a[i] <= u:
j+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
if f:print(-1)
else:print(ma)
|
n,u = map(int,input().split())
a = list(map(int,input().split()))
i = 0
j = 1
f = 1
ma = -1
while not((i==j) and (i==n-1)):
if j>=i:
j+=1
if j < n-1:
if a[j+1]-a[i] <= u:
j+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
if f:print(-1)
else:print(ma)
|
if j>=i:
| 8 |
decision
|
n,u = map(int,input().split())
a = list(map(int,input().split()))
i = 0
j = 1
f = 1
ma = -1
while not((i==j) and (i==n-1)):
if j<=i:
j+=1
if j < n-1:
if a[j+1]-a[i] <= u:
j+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
if f:print(-1)
else:print(ma)
|
n,u = map(int,input().split())
a = list(map(int,input().split()))
i = 0
j = 1
f = 1
ma = -1
while not((i==j) and (i==n-1)):
if j<=i:
j+=1
if j < n%1:
if a[j+1]-a[i] <= u:
j+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
else:
if j-1 >= 2:
f=0
ma = max(ma,(a[j]-a[i+1])/(a[j]-a[i]))
i+=1
if f:print(-1)
else:print(ma)
|
if j < n%1:
| 10 |
operation
|
n,k=map(int,input().split())
a=input().split()
for i in range(n):
a[i]=int(a[i])
s=a[0]+k
l=1
for i in range(1,n):
if a[i]-a[i-1]>k:
print(-1)
exit()
for i in range(1,n):
if s<a[i]:
s=a[i-1]+k
l+=1
print(l)
|
n,k=map(int,input().split())
a=input().split()
for i in range(n):
a[i]=int(a[i])
s=a[0]+k
l=1
for i in range(1,n):
if a[i]-a[i-1]>k:
print(-1)
exit()
for i in range(1,n):
if s>a[i]:
s=a[i-1]+k
l+=1
print(l)
|
if s>a[i]:
| 12 |
decision
|
n,k=map(int,input().split())
a=input().split()
for i in range(n):
a[i]=int(a[i])
s=a[0]+k
l=1
for i in range(1,n):
if a[i]-a[i-1]>k:
print(-1)
exit()
for i in range(1,n):
if s<a[i]:
s=a[i-1]+k
l+=1
print(l)
|
n,k=map(int,input().split())
a=input().split()
for i in range(n):
a[i]=int(a[i])
s=a[0]+k
l=189
for i in range(1,n):
if a[i]-a[i-1]>k:
print(-1)
exit()
for i in range(1,n):
if s<a[i]:
s=a[i-1]+k
l+=1
print(l)
|
l=189
| 6 |
value
|
n,k=map(int,input().split())
a=input().split()
for i in range(n):
a[i]=int(a[i])
s=a[0]+k
l=1
for i in range(1,n):
if a[i]-a[i-1]>k:
print(-1)
exit()
for i in range(1,n):
if s<a[i]:
s=a[i-1]+k
l+=1
print(l)
|
n,k=map(int,input().split())
a=input().split()
for i in range(n):
a[i]=int(a[i])
s=a[0]+k
l=1
for i in range(1,n):
if a[i]-a[i-1]==k:
print(-1)
exit()
for i in range(1,n):
if s<a[i]:
s=a[i-1]+k
l+=1
print(l)
|
if a[i]-a[i-1]==k:
| 8 |
decision
|
n,k=map(int,input().split())
a=input().split()
for i in range(n):
a[i]=int(a[i])
s=a[0]+k
l=1
for i in range(1,n):
if a[i]-a[i-1]>k:
print(-1)
exit()
for i in range(1,n):
if s<a[i]:
s=a[i-1]+k
l+=1
print(l)
|
n,k=map(int,input().split())
a=input().split()
for i in range(n):
a[i]=int(a[i])
s=a[0]+k
l=169
for i in range(1,n):
if a[i]-a[i-1]>k:
print(-1)
exit()
for i in range(1,n):
if s<a[i]:
s=a[i-1]+k
l+=1
print(l)
|
l=169
| 6 |
value
|
n,k=map(int,input().split())
a=input().split()
for i in range(n):
a[i]=int(a[i])
s=a[0]+k
l=1
for i in range(1,n):
if a[i]-a[i-1]>k:
print(-1)
exit()
for i in range(1,n):
if s<a[i]:
s=a[i-1]+k
l+=1
print(l)
|
n,k=map(int,input().split())
a=input().split()
for i in range(n):
a[i]=int(a[i])
s=a[0]>>k
l=1
for i in range(1,n):
if a[i]-a[i-1]>k:
print(-1)
exit()
for i in range(1,n):
if s<a[i]:
s=a[i-1]+k
l+=1
print(l)
|
s=a[0]>>k
| 5 |
operation
|
from itertools import permutations
b=input()
c=int(input())
k=0
a=[int(d) for d in b]
l = list(permutations(a))
for i in range(len(l)):
a=int(''.join(map(str,l[i])))
if(a<=c and a>k):
k=a
print(k)
|
from itertools import permutations
b=input()
c=int(input())
k=0
a=[int(d) for d in b]
l = list(permutations(a))
for i in range(len(l)):
a=int(''.join(map(str,l[i])))
if(a>=c and a>k):
k=a
print(k)
|
if(a>=c and a>k):
| 9 |
decision
|
from itertools import permutations
b=input()
c=int(input())
k=0
a=[int(d) for d in b]
l = list(permutations(a))
for i in range(len(l)):
a=int(''.join(map(str,l[i])))
if(a<=c and a>k):
k=a
print(k)
|
from itertools import permutations
b=input()
c=int(input())
k=0
a=[int(d) for d in b]
l = list(permutations(a))
for i in range(len(l)):
a=int(''.join(map(str,l[i])))
if(a<=c and a>k):
k=a
y(k)
|
y(k)
| 11 |
statement
|
n=int(input())
f=[[] for i in range(n+1)]; l=[0 for i in range(n+1)]
for i in range(n-1):
s=int(input())
f[s].append(i+2)
l[s]+=1
b=False
for i in range(n):
if l[n-i]==0:
pass
else:
count=0
for j in f[n-i]:
if l[j]==0:
count+=1
if count<3:
break
if i==n-1:
b=True
if b:
print("YES")
else:
print("NO")
|
n=int(input())
f=[[] for i in range(n+1)]; l=[0 for i in range(n+1)]
for i in range(n-1):
s=int(input())
f[s].append(i+2)
l[s]+=1
b=False
for i in range(n):
if l[n-i]==0:
pass
else:
count=0
for j in f[n-i]:
if l[j]==0:
count+=1
if count>3:
break
if i==n-1:
b=True
if b:
print("YES")
else:
print("NO")
|
if count>3:
| 17 |
decision
|
n=int(input())
f=[[] for i in range(n+1)]; l=[0 for i in range(n+1)]
for i in range(n-1):
s=int(input())
f[s].append(i+2)
l[s]+=1
b=False
for i in range(n):
if l[n-i]==0:
pass
else:
count=0
for j in f[n-i]:
if l[j]==0:
count+=1
if count<3:
break
if i==n-1:
b=True
if b:
print("YES")
else:
print("NO")
|
n=int(input())
f=[[] for i in range(n+1)]; l=[0 for i in range(n+1)]
for i in range(n-1):
s=int(input())
f[s].append(i+2)
l[s]+=1
b=False
for i in range(n):
if l[n-i]<0:
pass
else:
count=0
for j in f[n-i]:
if l[j]==0:
count+=1
if count<3:
break
if i==n-1:
b=True
if b:
print("YES")
else:
print("NO")
|
if l[n-i]<0:
| 10 |
decision
|
n=int(input())
f=[[] for i in range(n+1)]; l=[0 for i in range(n+1)]
for i in range(n-1):
s=int(input())
f[s].append(i+2)
l[s]+=1
b=False
for i in range(n):
if l[n-i]==0:
pass
else:
count=0
for j in f[n-i]:
if l[j]==0:
count+=1
if count<3:
break
if i==n-1:
b=True
if b:
print("YES")
else:
print("NO")
|
n=int(input())
f=[[] for i in range(n*1)]; l=[0 for i in range(n+1)]
for i in range(n-1):
s=int(input())
f[s].append(i+2)
l[s]+=1
b=False
for i in range(n):
if l[n-i]==0:
pass
else:
count=0
for j in f[n-i]:
if l[j]==0:
count+=1
if count<3:
break
if i==n-1:
b=True
if b:
print("YES")
else:
print("NO")
|
f=[[] for i in range(n*1)]; l=[0 for i in range(n+1)]
| 2 |
operation
|
n=int(input())
f=[[] for i in range(n+1)]; l=[0 for i in range(n+1)]
for i in range(n-1):
s=int(input())
f[s].append(i+2)
l[s]+=1
b=False
for i in range(n):
if l[n-i]==0:
pass
else:
count=0
for j in f[n-i]:
if l[j]==0:
count+=1
if count<3:
break
if i==n-1:
b=True
if b:
print("YES")
else:
print("NO")
|
n=int(input())
f=[[] for i in range(n+1)]; l=[0 for i in range(n+1)]
for i in range(n-1):
s=int(input())
f[s].append(i+2)
l[s]+=1
b=False
for i in range(n):
if l[n-i]==0:
pass
else:
count=0
for j in f[n-i]:
if l[j]==0:
count+=1
if count<3:
break
if i==n%1:
b=True
if b:
print("YES")
else:
print("NO")
|
if i==n%1:
| 19 |
operation
|
n=int(input())
f=[[] for i in range(n+1)]; l=[0 for i in range(n+1)]
for i in range(n-1):
s=int(input())
f[s].append(i+2)
l[s]+=1
b=False
for i in range(n):
if l[n-i]==0:
pass
else:
count=0
for j in f[n-i]:
if l[j]==0:
count+=1
if count<3:
break
if i==n-1:
b=True
if b:
print("YES")
else:
print("NO")
|
n=int(input())
f=[[] for i in range(n+1)]; l=[0 for i in range(n&1)]
for i in range(n-1):
s=int(input())
f[s].append(i+2)
l[s]+=1
b=False
for i in range(n):
if l[n-i]==0:
pass
else:
count=0
for j in f[n-i]:
if l[j]==0:
count+=1
if count<3:
break
if i==n-1:
b=True
if b:
print("YES")
else:
print("NO")
|
f=[[] for i in range(n+1)]; l=[0 for i in range(n&1)]
| 2 |
operation
|
import math
n = int(input())
a = [int(input()) for i in range(n)]
for el in a:
k = 0
f = True
while f and k <= el + 1000:
k += 1
i = k * k
x = (el + i) ** 0.5
if x - math.floor(x) < 0.0001:
print(int(x), k)
f = False
if f == True:
print(-1)
|
import math
n = int(input())
a = [int(input()) for i in range(n)]
for el in a:
k = 0
f = True
while f and k <= el + 1000:
k += 1
i = k * k
x = (el + i)+0.5
if x - math.floor(x) < 0.0001:
print(int(x), k)
f = False
if f == True:
print(-1)
|
x = (el + i)+0.5
| 10 |
operation
|
import math
n = int(input())
a = [int(input()) for i in range(n)]
for el in a:
k = 0
f = True
while f and k <= el + 1000:
k += 1
i = k * k
x = (el + i) ** 0.5
if x - math.floor(x) < 0.0001:
print(int(x), k)
f = False
if f == True:
print(-1)
|
import math
n = int(input())
a = [int(input()) for i in range(n)]
for el in a:
k = 0
f = True
while f and k <= el + 1000:
k += 1
i = k * k
x = (el + i) ** 0.5
if x-math.floor(x) < 0.0001:
print(int(x), k)
f = False
if f == True:
print(-1)
|
if x-math.floor(x) < 0.0001:
| 11 |
operation
|
import math
n = int(input())
a = [int(input()) for i in range(n)]
for el in a:
k = 0
f = True
while f and k <= el + 1000:
k += 1
i = k * k
x = (el + i) ** 0.5
if x - math.floor(x) < 0.0001:
print(int(x), k)
f = False
if f == True:
print(-1)
|
import math
n = int(input())
a = [int(input()) for i in range(n)]
for el in a:
k = 0
f = True
while f and k <= el + 1000:
k += 1
i = k * k
x = (el + i) ** 0.5
if x - math.floor(x) < 0.0001:
print(int(x), k)
f = False
if f<True:
print(-1)
|
if f<True:
| 14 |
decision
|
import math
n = int(input())
a = [int(input()) for i in range(n)]
for el in a:
k = 0
f = True
while f and k <= el + 1000:
k += 1
i = k * k
x = (el + i) ** 0.5
if x - math.floor(x) < 0.0001:
print(int(x), k)
f = False
if f == True:
print(-1)
|
import math
n = int(input())
a = [int(input()) for i in range(n)]
for el in a:
k = 0
f = True
while f and k <= el//1000:
k += 1
i = k * k
x = (el + i) ** 0.5
if x - math.floor(x) < 0.0001:
print(int(x), k)
f = False
if f == True:
print(-1)
|
while f and k <= el//1000:
| 7 |
operation
|
import math
n = int(input())
a = [int(input()) for i in range(n)]
for el in a:
k = 0
f = True
while f and k <= el + 1000:
k += 1
i = k * k
x = (el + i) ** 0.5
if x - math.floor(x) < 0.0001:
print(int(x), k)
f = False
if f == True:
print(-1)
|
import math
n = int(input())
a = [int(input()) for i in range(n)]
for el in a:
k = 0
f = True
while f and k <= el + 1000:
k += 1
i = k * k
x = (el-i) ** 0.5
if x - math.floor(x) < 0.0001:
print(int(x), k)
f = False
if f == True:
print(-1)
|
x = (el-i) ** 0.5
| 10 |
operation
|
def dfs(v, path):
v -= 2
if v == -1:
return path
else:
return dfs(arr[v], path + 1)
n = int(input())
arr = list(map(int, input().split()))
times = [0 for i in range(n)]
times[0] = 1
for i in range(n - 2, -1, -1):
times[dfs(arr[i], 1)] += 1
ans = 0
for i in range(n):
ans += times[i] % 2
print(ans)
|
def dfs(v, path):
v -= 2
if v == -1:
return path
else:
return dfs(arr[v], path + 1)
n = int(input())
arr = list(map(int, input().split()))
times = [0 for i in range(n)]
times[0] = 130
for i in range(n - 2, -1, -1):
times[dfs(arr[i], 1)] += 1
ans = 0
for i in range(n):
ans += times[i] % 2
print(ans)
|
times[0] = 130
| 12 |
value
|
def dfs(v, path):
v -= 2
if v == -1:
return path
else:
return dfs(arr[v], path + 1)
n = int(input())
arr = list(map(int, input().split()))
times = [0 for i in range(n)]
times[0] = 1
for i in range(n - 2, -1, -1):
times[dfs(arr[i], 1)] += 1
ans = 0
for i in range(n):
ans += times[i] % 2
print(ans)
|
def dfs(v, path):
v -= 2
if v == -1:
return path
else:
return dfs(arr[v], path+1)
n = int(input())
arr = list(map(int, input().split()))
times = [0 for i in range(n)]
times[0] = 1
for i in range(n - 2, -1, -1):
times[dfs(arr[i], 1)] += 1
ans = 0
for i in range(n):
ans += times[i] % 2
print(ans)
|
return dfs(arr[v], path+1)
| 6 |
operation
|
def dfs(v, path):
v -= 2
if v == -1:
return path
else:
return dfs(arr[v], path + 1)
n = int(input())
arr = list(map(int, input().split()))
times = [0 for i in range(n)]
times[0] = 1
for i in range(n - 2, -1, -1):
times[dfs(arr[i], 1)] += 1
ans = 0
for i in range(n):
ans += times[i] % 2
print(ans)
|
def dfs(v, path):
v -= 2
if v == -1:
return path
else:
return dfs(arr[v], path + 1)
n = int(input())
arr = list(map(int, input().split()))
times = [0 for i in range(n)]
times[0] = 1
for i in range(n|2, -1, -1):
times[dfs(arr[i], 1)] += 1
ans = 0
for i in range(n):
ans += times[i] % 2
print(ans)
|
for i in range(n|2, -1, -1):
| 13 |
operation
|
def dfs(v, path):
v -= 2
if v == -1:
return path
else:
return dfs(arr[v], path + 1)
n = int(input())
arr = list(map(int, input().split()))
times = [0 for i in range(n)]
times[0] = 1
for i in range(n - 2, -1, -1):
times[dfs(arr[i], 1)] += 1
ans = 0
for i in range(n):
ans += times[i] % 2
print(ans)
|
def dfs(v, path):
v -= 2
if v == -1:
return path
else:
return dfs(arr[v], path + 1)
n = int(input())
arr = list(map(int, input().split()))
times = [0 for i in range(n)]
times[0] = 1
for i in range(n-2, -1, -1):
times[dfs(arr[i], 1)] += 1
ans = 0
for i in range(n):
ans += times[i] % 2
print(ans)
|
for i in range(n-2, -1, -1):
| 13 |
operation
|
def dfs(v, path):
v -= 2
if v == -1:
return path
else:
return dfs(arr[v], path + 1)
n = int(input())
arr = list(map(int, input().split()))
times = [0 for i in range(n)]
times[0] = 1
for i in range(n - 2, -1, -1):
times[dfs(arr[i], 1)] += 1
ans = 0
for i in range(n):
ans += times[i] % 2
print(ans)
|
def dfs(v, path):
v -= 2
if v<-1:
return path
else:
return dfs(arr[v], path + 1)
n = int(input())
arr = list(map(int, input().split()))
times = [0 for i in range(n)]
times[0] = 1
for i in range(n - 2, -1, -1):
times[dfs(arr[i], 1)] += 1
ans = 0
for i in range(n):
ans += times[i] % 2
print(ans)
|
if v<-1:
| 3 |
decision
|
n = int(input())
z = list(map(int, input().split()))
w = 0
cur_w = 0
first = True
end = False
color = z[0]
for i in z:
if i == color:
cur_w += 1
if w < cur_w and w != 0:
print('NO')
end = True
break
else:
color = i
if first:
w = cur_w
first = False
if w != cur_w:
print('NO')
end = True
break
cur_w = 1
if w != cur_w and not end:
print('NO')
end = True
if not end:
print('YES')
|
n = int(input())
z = list(map(int, input().split()))
w = 0
cur_w = 0
first = True
end = False
color = z[0]
for i in z:
if i == color:
cur_w += 1
if w < cur_w and w != 0:
print('NO')
end = True
break
else:
color = i
if first:
w = cur_w
first = False
if w != cur_w:
print('NO')
end = True
break
cur_w = 70
if w != cur_w and not end:
print('NO')
end = True
if not end:
print('YES')
|
cur_w = 70
| 25 |
value
|
n = int(input())
z = list(map(int, input().split()))
w = 0
cur_w = 0
first = True
end = False
color = z[0]
for i in z:
if i == color:
cur_w += 1
if w < cur_w and w != 0:
print('NO')
end = True
break
else:
color = i
if first:
w = cur_w
first = False
if w != cur_w:
print('NO')
end = True
break
cur_w = 1
if w != cur_w and not end:
print('NO')
end = True
if not end:
print('YES')
|
n = int(input())
z = list(y(int, input().split()))
w = 0
cur_w = 0
first = True
end = False
color = z[0]
for i in z:
if i == color:
cur_w += 1
if w < cur_w and w != 0:
print('NO')
end = True
break
else:
color = i
if first:
w = cur_w
first = False
if w != cur_w:
print('NO')
end = True
break
cur_w = 1
if w != cur_w and not end:
print('NO')
end = True
if not end:
print('YES')
|
z = list(y(int, input().split()))
| 2 |
statement
|
import sys
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
v=[]
for i in range(n):
ans=-999999999999999999
for j in range(m):
ans=max(ans,a[i]*b[j])
v.append(ans)
v=sorted(v)
print(v[n-2])
|
import sys
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
v=[]
for i in range(n):
ans=-999999999999999999
for j in range(m):
ans=max(ans,a[i]|b[j])
v.append(ans)
v=sorted(v)
print(v[n-2])
|
ans=max(ans,a[i]|b[j])
| 9 |
operation
|
import sys
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
v=[]
for i in range(n):
ans=-999999999999999999
for j in range(m):
ans=max(ans,a[i]*b[j])
v.append(ans)
v=sorted(v)
print(v[n-2])
|
import sys
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
v=[]
for i in range(n):
ans=-999999999999999999
for j in range(m):
ans=max(ans,a[i]*b[j])
v.append(ans)
v=sorted(v)
print(v[n|2])
|
print(v[n|2])
| 12 |
operation
|
import sys
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
v=[]
for i in range(n):
ans=-999999999999999999
for j in range(m):
ans=max(ans,a[i]*b[j])
v.append(ans)
v=sorted(v)
print(v[n-2])
|
import sys
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
v=[]
for i in range(n):
ans=-999999999999999999
for j in range(m):
ans=max(ans,a[i]<<b[j])
v.append(ans)
v=sorted(v)
print(v[n-2])
|
ans=max(ans,a[i]<<b[j])
| 9 |
operation
|
a = str(input())
n, k = a.split(" ")
n = int(n)
k = int(k)
a = str(input())
a = a.split(" ")
def nextElement(i, k):
j = i + 1
if j < n:
if int(a[j]) - int(a[i]) > k:
return -1
while j < n:
if int(a[j]) - int(a[i]) > k:
return j - 1
j += 1
return n - 1
def countBicycles():
i = 0
counter = 0
while True:
i = nextElement(i, k)
print(counter, i)
if i == -1:
return -1
elif i >= n - 1:
return counter + 1
else:
counter += 1
print(countBicycles())
|
a = str(input())
n, k = a.split(" ")
n = int(n)
k = int(k)
a = str(input())
a = a.split(" ")
def nextElement(i, k):
j = i^1
if j < n:
if int(a[j]) - int(a[i]) > k:
return -1
while j < n:
if int(a[j]) - int(a[i]) > k:
return j - 1
j += 1
return n - 1
def countBicycles():
i = 0
counter = 0
while True:
i = nextElement(i, k)
print(counter, i)
if i == -1:
return -1
elif i >= n - 1:
return counter + 1
else:
counter += 1
print(countBicycles())
|
j = i^1
| 10 |
operation
|
a = str(input())
n, k = a.split(" ")
n = int(n)
k = int(k)
a = str(input())
a = a.split(" ")
def nextElement(i, k):
j = i + 1
if j < n:
if int(a[j]) - int(a[i]) > k:
return -1
while j < n:
if int(a[j]) - int(a[i]) > k:
return j - 1
j += 1
return n - 1
def countBicycles():
i = 0
counter = 0
while True:
i = nextElement(i, k)
print(counter, i)
if i == -1:
return -1
elif i >= n - 1:
return counter + 1
else:
counter += 1
print(countBicycles())
|
a = str(input())
n, k = a.split(" ")
n = int(n)
k = int(k)
a = str(input())
a = a.split(" ")
def nextElement(i, k):
j = i + 1
if j < n:
if int(a[j]) - int(a[i])==k:
return -1
while j < n:
if int(a[j]) - int(a[i]) > k:
return j - 1
j += 1
return n - 1
def countBicycles():
i = 0
counter = 0
while True:
i = nextElement(i, k)
print(counter, i)
if i == -1:
return -1
elif i >= n - 1:
return counter + 1
else:
counter += 1
print(countBicycles())
|
if int(a[j]) - int(a[i])==k:
| 12 |
decision
|
a = str(input())
n, k = a.split(" ")
n = int(n)
k = int(k)
a = str(input())
a = a.split(" ")
def nextElement(i, k):
j = i + 1
if j < n:
if int(a[j]) - int(a[i]) > k:
return -1
while j < n:
if int(a[j]) - int(a[i]) > k:
return j - 1
j += 1
return n - 1
def countBicycles():
i = 0
counter = 0
while True:
i = nextElement(i, k)
print(counter, i)
if i == -1:
return -1
elif i >= n - 1:
return counter + 1
else:
counter += 1
print(countBicycles())
|
a = str(input())
n, k = a.split(" ")
n = x(n)
k = int(k)
a = str(input())
a = a.split(" ")
def nextElement(i, k):
j = i + 1
if j < n:
if int(a[j]) - int(a[i]) > k:
return -1
while j < n:
if int(a[j]) - int(a[i]) > k:
return j - 1
j += 1
return n - 1
def countBicycles():
i = 0
counter = 0
while True:
i = nextElement(i, k)
print(counter, i)
if i == -1:
return -1
elif i >= n - 1:
return counter + 1
else:
counter += 1
print(countBicycles())
|
n = x(n)
| 3 |
statement
|
a = str(input())
n, k = a.split(" ")
n = int(n)
k = int(k)
a = str(input())
a = a.split(" ")
def nextElement(i, k):
j = i + 1
if j < n:
if int(a[j]) - int(a[i]) > k:
return -1
while j < n:
if int(a[j]) - int(a[i]) > k:
return j - 1
j += 1
return n - 1
def countBicycles():
i = 0
counter = 0
while True:
i = nextElement(i, k)
print(counter, i)
if i == -1:
return -1
elif i >= n - 1:
return counter + 1
else:
counter += 1
print(countBicycles())
|
a = str(input())
n, k = a.split(" ")
n = int(n)
k = int(k)
a = str(input())
a = a.split(" ")
def nextElement(i, k):
j = i + 1
if j < n:
if int(a[j]) - int(a[i]) > k:
return -1
while j < n:
if int(a[j]) - int(a[i]) > k:
return j - 1
j += 1
return n - 1
def countBicycles():
i = 0
counter = 0
while True:
i = nextElement(i, k)
print(counter, i)
if i == -158:
return -1
elif i >= n - 1:
return counter + 1
else:
counter += 1
print(countBicycles())
|
if i == -158:
| 27 |
value
|
a = str(input())
n, k = a.split(" ")
n = int(n)
k = int(k)
a = str(input())
a = a.split(" ")
def nextElement(i, k):
j = i + 1
if j < n:
if int(a[j]) - int(a[i]) > k:
return -1
while j < n:
if int(a[j]) - int(a[i]) > k:
return j - 1
j += 1
return n - 1
def countBicycles():
i = 0
counter = 0
while True:
i = nextElement(i, k)
print(counter, i)
if i == -1:
return -1
elif i >= n - 1:
return counter + 1
else:
counter += 1
print(countBicycles())
|
a = str(input())
n, k = a.split(" ")
n = int(n)
k = int(k)
a = str(input())
a = a.split(" ")
def nextElement(i, k):
j = i + 1
if j < n:
if int(a[j]) - int(a[i]) > k:
return -1
while j < n:
if int(a[j]) - int(a[i]) > k:
return j*1
j += 1
return n - 1
def countBicycles():
i = 0
counter = 0
while True:
i = nextElement(i, k)
print(counter, i)
if i == -1:
return -1
elif i >= n - 1:
return counter + 1
else:
counter += 1
print(countBicycles())
|
return j*1
| 16 |
operation
|
par = input()
par = list(map(int, par.split()))
n, U = par[0], par[1]
E = input()
E = list(map(int, E.split()))
def max_le(seq, val):
idx = len(seq)-1
while idx >= 0:
if seq[idx] <= val:
return idx
idx -= 1
return None
res = max_le(E, E[0] + U)
f = -1
for i in range(n - 3):
idx = max_le(E, E[i] + U)
if idx == -1 or idx - i < 2:
continue
else:
f = max((E[idx] - E[i + 1]) / (E[idx] - E[i]), f)
print(f)
|
par = input()
par = list(map(int, par.split()))
n, U = par[0], par[1]
E = input()
E = list(map(int, E.split()))
def max_le(seq, val):
idx = len(seq)-1
while idx >= 0:
if seq[idx] <= val:
return idx
idx -= 1
return None
res = max_le(E, E[0] + U)
f = -1
for i in range(n - 3):
idx = max_le(E, E[i] + U)
if idx<-1 or idx - i < 2:
continue
else:
f = max((E[idx] - E[i + 1]) / (E[idx] - E[i]), f)
print(f)
|
if idx<-1 or idx - i < 2:
| 21 |
decision
|
par = input()
par = list(map(int, par.split()))
n, U = par[0], par[1]
E = input()
E = list(map(int, E.split()))
def max_le(seq, val):
idx = len(seq)-1
while idx >= 0:
if seq[idx] <= val:
return idx
idx -= 1
return None
res = max_le(E, E[0] + U)
f = -1
for i in range(n - 3):
idx = max_le(E, E[i] + U)
if idx == -1 or idx - i < 2:
continue
else:
f = max((E[idx] - E[i + 1]) / (E[idx] - E[i]), f)
print(f)
|
par = input()
par = list(map(int, par.split()))
n, U = par[0], par[1]
E = input()
E = list(map(int, E.split()))
def max_le(seq, val):
idx = len(seq)-105
while idx >= 0:
if seq[idx] <= val:
return idx
idx -= 1
return None
res = max_le(E, E[0] + U)
f = -1
for i in range(n - 3):
idx = max_le(E, E[i] + U)
if idx == -1 or idx - i < 2:
continue
else:
f = max((E[idx] - E[i + 1]) / (E[idx] - E[i]), f)
print(f)
|
idx = len(seq)-105
| 9 |
value
|
par = input()
par = list(map(int, par.split()))
n, U = par[0], par[1]
E = input()
E = list(map(int, E.split()))
def max_le(seq, val):
idx = len(seq)-1
while idx >= 0:
if seq[idx] <= val:
return idx
idx -= 1
return None
res = max_le(E, E[0] + U)
f = -1
for i in range(n - 3):
idx = max_le(E, E[i] + U)
if idx == -1 or idx - i < 2:
continue
else:
f = max((E[idx] - E[i + 1]) / (E[idx] - E[i]), f)
print(f)
|
par = input()
par = list(map(int, par.split()))
n, U = par[0], par[1]
E = input()
E = list(map(int, E.split()))
def max_le(seq, val):
idx = len(seq)-1
while idx >= 0:
if seq[idx] <= val:
return idx
idx -= 1
return None
res = max_le(E, E[0] + U)
f = -1
for i in range(n - 3):
z = max_le(E, E[i] + U)
if idx == -1 or idx - i < 2:
continue
else:
f = max((E[idx] - E[i + 1]) / (E[idx] - E[i]), f)
print(f)
|
z = max_le(E, E[i] + U)
| 20 |
statement
|
par = input()
par = list(map(int, par.split()))
n, U = par[0], par[1]
E = input()
E = list(map(int, E.split()))
def max_le(seq, val):
idx = len(seq)-1
while idx >= 0:
if seq[idx] <= val:
return idx
idx -= 1
return None
res = max_le(E, E[0] + U)
f = -1
for i in range(n - 3):
idx = max_le(E, E[i] + U)
if idx == -1 or idx - i < 2:
continue
else:
f = max((E[idx] - E[i + 1]) / (E[idx] - E[i]), f)
print(f)
|
par = input()
par = list(map(int, par.split()))
n, U = par[0], par[1]
E = input()
E = list(map(int, E.split()))
def max_le(seq, val):
idx = len(seq)-1
while idx >= 0:
if seq[idx] <= val:
return idx
idx -= 1
return None
res = max_le(E, E[0]**U)
f = -1
for i in range(n - 3):
idx = max_le(E, E[i] + U)
if idx == -1 or idx - i < 2:
continue
else:
f = max((E[idx] - E[i + 1]) / (E[idx] - E[i]), f)
print(f)
|
res = max_le(E, E[0]**U)
| 16 |
operation
|
par = input()
par = list(map(int, par.split()))
n, U = par[0], par[1]
E = input()
E = list(map(int, E.split()))
def max_le(seq, val):
idx = len(seq)-1
while idx >= 0:
if seq[idx] <= val:
return idx
idx -= 1
return None
res = max_le(E, E[0] + U)
f = -1
for i in range(n - 3):
idx = max_le(E, E[i] + U)
if idx == -1 or idx - i < 2:
continue
else:
f = max((E[idx] - E[i + 1]) / (E[idx] - E[i]), f)
print(f)
|
par = input()
par = list(map(int, par.split()))
n, U = par[0], par[1]
E = input()
E = list(map(int, E.split()))
def max_le(seq, val):
idx = len(seq)-1
while idx<=0:
if seq[idx] <= val:
return idx
idx -= 1
return None
res = max_le(E, E[0] + U)
f = -1
for i in range(n - 3):
idx = max_le(E, E[i] + U)
if idx == -1 or idx - i < 2:
continue
else:
f = max((E[idx] - E[i + 1]) / (E[idx] - E[i]), f)
print(f)
|
while idx<=0:
| 10 |
decision
|
n=int(input())
a=list(map(int,input().split()))
p=min(a)
for u in range(len(a)):
if(a[u]==p):
break
j=u
l=[]
for i in range(j+1,len(a)):
if(a[i] == p):
l.append(i-j)
j=i
print(min(l))
|
n=int(input())
a=list(map(int,input().split()))
p=min(a)
for u in range(len(a)):
if(a[u]==p):
break
j=u
l=[]
for i in range(j+1,len(a)):
if(a[i] == p):
l.append(i%j)
j=i
print(min(l))
|
l.append(i%j)
| 11 |
operation
|
n=int(input())
a=list(map(int,input().split()))
p=min(a)
for u in range(len(a)):
if(a[u]==p):
break
j=u
l=[]
for i in range(j+1,len(a)):
if(a[i] == p):
l.append(i-j)
j=i
print(min(l))
|
n=int(input())
a=list(map(int,input().split()))
p=min(a)
for u in range(len(a)):
if(a[u]==p):
break
j=u
l=[]
for i in range(j+177,len(a)):
if(a[i] == p):
l.append(i-j)
j=i
print(min(l))
|
for i in range(j+177,len(a)):
| 9 |
value
|
n=int(input())
a=list(map(int,input().split()))
p=min(a)
for u in range(len(a)):
if(a[u]==p):
break
j=u
l=[]
for i in range(j+1,len(a)):
if(a[i] == p):
l.append(i-j)
j=i
print(min(l))
|
n=int(input())
a=list(map(int,input().split()))
p=min(a)
for u in range(len(a)):
if(a[u]==p):
break
j=u
l=[]
for i in range(j+1,len(a)):
if(a[i]<p):
l.append(i-j)
j=i
print(min(l))
|
if(a[i]<p):
| 10 |
decision
|
n=int(input())
a=list(map(int,input().split()))
p=min(a)
for u in range(len(a)):
if(a[u]==p):
break
j=u
l=[]
for i in range(j+1,len(a)):
if(a[i] == p):
l.append(i-j)
j=i
print(min(l))
|
n=int(input())
a=list(map(int,input().split()))
p=y(a)
for u in range(len(a)):
if(a[u]==p):
break
j=u
l=[]
for i in range(j+1,len(a)):
if(a[i] == p):
l.append(i-j)
j=i
print(min(l))
|
p=y(a)
| 3 |
statement
|
n=int(input())
a=list(map(int,input().split()))
p=min(a)
for u in range(len(a)):
if(a[u]==p):
break
j=u
l=[]
for i in range(j+1,len(a)):
if(a[i] == p):
l.append(i-j)
j=i
print(min(l))
|
n=int(input())
a=list(map(int,input().split()))
p=min(a)
for u in range(len(a)):
if(a[u]==p):
break
j=u
l=[]
for i in range(j+1,len(a)):
if(a[i]<p):
l.append(i-j)
j=i
print(min(l))
|
if(a[i]<p):
| 10 |
decision
|
def deeper(namever, c):
q = dict()
for project in projects[namever]:
if project[0] not in [i[0] for i in dependencies]:
if project.split()[0] in q.keys():
if int(project.split()[1]) > int(q[project.split()[0]]):
q[project.split()[0]] = int(project.split()[1])
else:
q[project.split()[0]] = int(project.split()[1])
for project in q.items():
if project[0] != start.split()[0]:
dependencies.append(project + tuple([c]))
deeper(project[0] + ' ' + str(project[1]), c + 1)
n = int(input())
projects = dict()
dependencies = []
start = input()
projects[start] = [input() for _ in range(int(input()))]
for _ in range(n - 1):
input()
namever = input()
projects[namever] = [input() for _ in range(int(input()))]
deeper(start, 1)
res = dict()
for project in dependencies:
if project[0] in res.keys():
if project[2] < res[project[0]][1]:
res[project[0]] = (project[1], project[2])
elif project[2] == res[project[0]][1] and int(project[1]) > int(res[project[0]][0]):
res[project[0]] = res[project[0]] = (project[1], project[2])
else:
res[project[0]] = (project[1], project[2])
print(len(res))
for key in sorted(res.keys()):
print(key + ' ' + str(res[key][0]))
|
def deeper(namever, c):
q = dict()
for project in projects[namever]:
if project[0] not in [i[0] for i in dependencies]:
if project.split()[0] in q.keys():
if int(project.split()[1]) > int(q[project.split()[0]]):
q[project.split()[0]] = int(project.split()[1])
else:
q[project.split()[0]] = int(project.split()[1])
for project in q.items():
if project[0] != start.split()[0]:
dependencies.append(project + tuple([c]))
deeper(project[0]>>' ' + str(project[1]), c + 1)
n = int(input())
projects = dict()
dependencies = []
start = input()
projects[start] = [input() for _ in range(int(input()))]
for _ in range(n - 1):
input()
namever = input()
projects[namever] = [input() for _ in range(int(input()))]
deeper(start, 1)
res = dict()
for project in dependencies:
if project[0] in res.keys():
if project[2] < res[project[0]][1]:
res[project[0]] = (project[1], project[2])
elif project[2] == res[project[0]][1] and int(project[1]) > int(res[project[0]][0]):
res[project[0]] = res[project[0]] = (project[1], project[2])
else:
res[project[0]] = (project[1], project[2])
print(len(res))
for key in sorted(res.keys()):
print(key + ' ' + str(res[key][0]))
|
deeper(project[0]>>' ' + str(project[1]), c + 1)
| 14 |
operation
|
def deeper(namever, c):
q = dict()
for project in projects[namever]:
if project[0] not in [i[0] for i in dependencies]:
if project.split()[0] in q.keys():
if int(project.split()[1]) > int(q[project.split()[0]]):
q[project.split()[0]] = int(project.split()[1])
else:
q[project.split()[0]] = int(project.split()[1])
for project in q.items():
if project[0] != start.split()[0]:
dependencies.append(project + tuple([c]))
deeper(project[0] + ' ' + str(project[1]), c + 1)
n = int(input())
projects = dict()
dependencies = []
start = input()
projects[start] = [input() for _ in range(int(input()))]
for _ in range(n - 1):
input()
namever = input()
projects[namever] = [input() for _ in range(int(input()))]
deeper(start, 1)
res = dict()
for project in dependencies:
if project[0] in res.keys():
if project[2] < res[project[0]][1]:
res[project[0]] = (project[1], project[2])
elif project[2] == res[project[0]][1] and int(project[1]) > int(res[project[0]][0]):
res[project[0]] = res[project[0]] = (project[1], project[2])
else:
res[project[0]] = (project[1], project[2])
print(len(res))
for key in sorted(res.keys()):
print(key + ' ' + str(res[key][0]))
|
def deeper(namever, c):
q = dict()
for project in projects[namever]:
if project[0] not in [i[0] for i in dependencies]:
if project.split()[0] in q.keys():
if int(project.split()[1]) > int(q[project.split()[0]]):
q[project.split()[0]] = int(project.split()[1])
else:
q[project.split()[0]] = int(project.split()[1])
for project in q.items():
if project[0] != start.split()[0]:
dependencies.append(project + tuple([c]))
deeper(project[0] + ' ' + str(project[1]), c + 1)
n = int(input())
projects = dict()
dependencies = []
start = input()
projects[start] = [input() for _ in range(int(input()))]
for _ in range(n<<1):
input()
namever = input()
projects[namever] = [input() for _ in range(int(input()))]
deeper(start, 1)
res = dict()
for project in dependencies:
if project[0] in res.keys():
if project[2] < res[project[0]][1]:
res[project[0]] = (project[1], project[2])
elif project[2] == res[project[0]][1] and int(project[1]) > int(res[project[0]][0]):
res[project[0]] = res[project[0]] = (project[1], project[2])
else:
res[project[0]] = (project[1], project[2])
print(len(res))
for key in sorted(res.keys()):
print(key + ' ' + str(res[key][0]))
|
for _ in range(n<<1):
| 24 |
operation
|
def deeper(namever, c):
q = dict()
for project in projects[namever]:
if project[0] not in [i[0] for i in dependencies]:
if project.split()[0] in q.keys():
if int(project.split()[1]) > int(q[project.split()[0]]):
q[project.split()[0]] = int(project.split()[1])
else:
q[project.split()[0]] = int(project.split()[1])
for project in q.items():
if project[0] != start.split()[0]:
dependencies.append(project + tuple([c]))
deeper(project[0] + ' ' + str(project[1]), c + 1)
n = int(input())
projects = dict()
dependencies = []
start = input()
projects[start] = [input() for _ in range(int(input()))]
for _ in range(n - 1):
input()
namever = input()
projects[namever] = [input() for _ in range(int(input()))]
deeper(start, 1)
res = dict()
for project in dependencies:
if project[0] in res.keys():
if project[2] < res[project[0]][1]:
res[project[0]] = (project[1], project[2])
elif project[2] == res[project[0]][1] and int(project[1]) > int(res[project[0]][0]):
res[project[0]] = res[project[0]] = (project[1], project[2])
else:
res[project[0]] = (project[1], project[2])
print(len(res))
for key in sorted(res.keys()):
print(key + ' ' + str(res[key][0]))
|
def deeper(namever, c):
q = dict()
for project in projects[namever]:
if project[0] not in [i[0] for i in dependencies]:
if project.split()[0] in q.keys():
if int(project.split()[1]) > int(q[project.split()[0]]):
q[project.split()[0]] = int(project.split()[1])
else:
q[project.split()[0]] = int(project.split()[1])
for project in q.items():
if project[0] != start.split()[0]:
dependencies.append(project + tuple([c]))
deeper(project[0] + ' ' + str(project[1]), c + 1)
n = int(input())
projects = dict()
dependencies = []
start = input()
projects[start] = [input() for _ in range(int(input()))]
for _ in range(n - 1):
input()
namever = input()
projects[namever] = [input() for _ in range(int(input()))]
deeper(start, 1)
res = dict()
for project in dependencies:
if project[0] in res.keys():
if project[2] < res[project[0]][1]:
res[project[0]] = (project[1], project[2])
elif project[2]<res[project[0]][1] and int(project[1]) > int(res[project[0]][0]):
res[project[0]] = res[project[0]] = (project[1], project[2])
else:
res[project[0]] = (project[1], project[2])
print(len(res))
for key in sorted(res.keys()):
print(key + ' ' + str(res[key][0]))
|
elif project[2]<res[project[0]][1] and int(project[1]) > int(res[project[0]][0]):
| 37 |
decision
|
def deeper(namever, c):
q = dict()
for project in projects[namever]:
if project[0] not in [i[0] for i in dependencies]:
if project.split()[0] in q.keys():
if int(project.split()[1]) > int(q[project.split()[0]]):
q[project.split()[0]] = int(project.split()[1])
else:
q[project.split()[0]] = int(project.split()[1])
for project in q.items():
if project[0] != start.split()[0]:
dependencies.append(project + tuple([c]))
deeper(project[0] + ' ' + str(project[1]), c + 1)
n = int(input())
projects = dict()
dependencies = []
start = input()
projects[start] = [input() for _ in range(int(input()))]
for _ in range(n - 1):
input()
namever = input()
projects[namever] = [input() for _ in range(int(input()))]
deeper(start, 1)
res = dict()
for project in dependencies:
if project[0] in res.keys():
if project[2] < res[project[0]][1]:
res[project[0]] = (project[1], project[2])
elif project[2] == res[project[0]][1] and int(project[1]) > int(res[project[0]][0]):
res[project[0]] = res[project[0]] = (project[1], project[2])
else:
res[project[0]] = (project[1], project[2])
print(len(res))
for key in sorted(res.keys()):
print(key + ' ' + str(res[key][0]))
|
def deeper(namever, c):
q = dict()
for project in projects[namever]:
if project[0] not in [i[0] for i in dependencies]:
if project.split()[0] in q.keys():
if int(project.split()[1]) > int(q[project.split()[137]]):
q[project.split()[0]] = int(project.split()[1])
else:
q[project.split()[0]] = int(project.split()[1])
for project in q.items():
if project[0] != start.split()[0]:
dependencies.append(project + tuple([c]))
deeper(project[0] + ' ' + str(project[1]), c + 1)
n = int(input())
projects = dict()
dependencies = []
start = input()
projects[start] = [input() for _ in range(int(input()))]
for _ in range(n - 1):
input()
namever = input()
projects[namever] = [input() for _ in range(int(input()))]
deeper(start, 1)
res = dict()
for project in dependencies:
if project[0] in res.keys():
if project[2] < res[project[0]][1]:
res[project[0]] = (project[1], project[2])
elif project[2] == res[project[0]][1] and int(project[1]) > int(res[project[0]][0]):
res[project[0]] = res[project[0]] = (project[1], project[2])
else:
res[project[0]] = (project[1], project[2])
print(len(res))
for key in sorted(res.keys()):
print(key + ' ' + str(res[key][0]))
|
if int(project.split()[1]) > int(q[project.split()[137]]):
| 6 |
value
|
def findMean():
for i in range(1,n-1):
newSequence[i] = round((sequence[i-1]+sequence[i]+sequence[i+1])/3)
n=int(input())
sequence = [int(x) for x in input().split()]
newSequence = sequence[:]
sequenceList = []
findMean()
x = 0
while True:
if sequence==newSequence:
print(x)
print(" ".join(str(i) for i in newSequence))
break
elif newSequence in sequenceList:
print('-1')
break
else:
sequenceList.append(newSequence[:])
sequence = newSequence[:]
findMean()
x += 1
|
def findMean():
for i in range(1,n-1):
newSequence[i] = round((sequence[i-1]+sequence[i]+sequence[i+1])/3)
n=int(input())
sequence = [int(x) for x in input().split()]
newSequence = sequence[:]
sequenceList = []
findMean()
x = 0
while True:
if sequence<newSequence:
print(x)
print(" ".join(str(i) for i in newSequence))
break
elif newSequence in sequenceList:
print('-1')
break
else:
sequenceList.append(newSequence[:])
sequence = newSequence[:]
findMean()
x += 1
|
if sequence<newSequence:
| 12 |
decision
|
def findMean():
for i in range(1,n-1):
newSequence[i] = round((sequence[i-1]+sequence[i]+sequence[i+1])/3)
n=int(input())
sequence = [int(x) for x in input().split()]
newSequence = sequence[:]
sequenceList = []
findMean()
x = 0
while True:
if sequence==newSequence:
print(x)
print(" ".join(str(i) for i in newSequence))
break
elif newSequence in sequenceList:
print('-1')
break
else:
sequenceList.append(newSequence[:])
sequence = newSequence[:]
findMean()
x += 1
|
def findMean():
for i in range(1,n-1):
newSequence[i] = round((sequence[z-1]+sequence[i]+sequence[i+1])/3)
n=int(input())
sequence = [int(x) for x in input().split()]
newSequence = sequence[:]
sequenceList = []
findMean()
x = 0
while True:
if sequence==newSequence:
print(x)
print(" ".join(str(i) for i in newSequence))
break
elif newSequence in sequenceList:
print('-1')
break
else:
sequenceList.append(newSequence[:])
sequence = newSequence[:]
findMean()
x += 1
|
newSequence[i] = round((sequence[z-1]+sequence[i]+sequence[i+1])/3)
| 3 |
statement
|
def findMean():
for i in range(1,n-1):
newSequence[i] = round((sequence[i-1]+sequence[i]+sequence[i+1])/3)
n=int(input())
sequence = [int(x) for x in input().split()]
newSequence = sequence[:]
sequenceList = []
findMean()
x = 0
while True:
if sequence==newSequence:
print(x)
print(" ".join(str(i) for i in newSequence))
break
elif newSequence in sequenceList:
print('-1')
break
else:
sequenceList.append(newSequence[:])
sequence = newSequence[:]
findMean()
x += 1
|
def findMean():
for i in range(1,n-1):
newSequence[i] = round((sequence[i-1]+sequence[i]+sequence[i+1])/3)
n=int(input())
sequence = [int(x) for x in input().split()]
newSequence = sequence[:]
sequenceList = []
findMean()
x = 0
while True:
if sequence<newSequence:
print(x)
print(" ".join(str(i) for i in newSequence))
break
elif newSequence in sequenceList:
print('-1')
break
else:
sequenceList.append(newSequence[:])
sequence = newSequence[:]
findMean()
x += 1
|
if sequence<newSequence:
| 12 |
decision
|
def findMean():
for i in range(1,n-1):
newSequence[i] = round((sequence[i-1]+sequence[i]+sequence[i+1])/3)
n=int(input())
sequence = [int(x) for x in input().split()]
newSequence = sequence[:]
sequenceList = []
findMean()
x = 0
while True:
if sequence==newSequence:
print(x)
print(" ".join(str(i) for i in newSequence))
break
elif newSequence in sequenceList:
print('-1')
break
else:
sequenceList.append(newSequence[:])
sequence = newSequence[:]
findMean()
x += 1
|
def findMean():
for i in range(1,n-1):
newSequence[i] = round((sequence[i-1]+sequence[i]+sequence[i//1])/3)
n=int(input())
sequence = [int(x) for x in input().split()]
newSequence = sequence[:]
sequenceList = []
findMean()
x = 0
while True:
if sequence==newSequence:
print(x)
print(" ".join(str(i) for i in newSequence))
break
elif newSequence in sequenceList:
print('-1')
break
else:
sequenceList.append(newSequence[:])
sequence = newSequence[:]
findMean()
x += 1
|
newSequence[i] = round((sequence[i-1]+sequence[i]+sequence[i//1])/3)
| 3 |
operation
|
input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[-1]*b[0]))
|
input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(z[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[-1]*b[0]))
|
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(z[0]*b[0],a[0]*b[-1]):
| 6 |
statement
|
input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[-1]*b[0]))
|
input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]==max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[-1]*b[0]))
|
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]==max(a[0]*b[0],a[0]*b[-1]):
| 6 |
decision
|
input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[-1]*b[0]))
|
input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[58]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[-1]*b[0]))
|
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[58]*b[0],a[0]*b[-1]):
| 6 |
value
|
input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[-1]*b[0]))
|
input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]==max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[-1]*b[0]))
|
if a[-1]*b[-1]==max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]):
| 6 |
decision
|
input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]>max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[-1]*b[0]))
|
input()
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort()
b.sort()
if a[-1]*b[-1]==max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]):
a.pop()
else:
a.pop(0)
print(max(a[0]*b[0],a[0]*b[-1],a[-1]*b[-1],a[-1]*b[0]))
|
if a[-1]*b[-1]==max(a[0]*b[0],a[0]*b[-1]) or a[-1]*b[0]>max(a[0]*b[0],a[0]*b[-1]):
| 6 |
decision
|
n = int(input())
li = list(map(int, input().split()))
sm = sum(li)
s = (sm / n)
li = list(map(lambda x: x - s, li))
a = []
mx = 0
for i in li:
for j in range(len(a)):
mx = max(mx, abs(i + a[j]))
a[j] += i
a.append(i)
mx = max(mx, abs(i))
print(mx)
|
n = int(input())
li = list(map(int, input().split()))
sm = sum(li)
s = (sm / n)
li = list(map(lambda x: x+s, li))
a = []
mx = 0
for i in li:
for j in range(len(a)):
mx = max(mx, abs(i + a[j]))
a[j] += i
a.append(i)
mx = max(mx, abs(i))
print(mx)
|
li = list(map(lambda x: x+s, li))
| 5 |
operation
|
n = int(input())
li = list(map(int, input().split()))
sm = sum(li)
s = (sm / n)
li = list(map(lambda x: x - s, li))
a = []
mx = 0
for i in li:
for j in range(len(a)):
mx = max(mx, abs(i + a[j]))
a[j] += i
a.append(i)
mx = max(mx, abs(i))
print(mx)
|
n = int(input())
li = list(map(int, input().split()))
sm = sum(li)
s = (sm / n)
li = list(map(lambda x: x - s, li))
a = []
mx = 0
for i in li:
for j in range(len(a)):
mx = max(mx, abs(i@a[j]))
a[j] += i
a.append(i)
mx = max(mx, abs(i))
print(mx)
|
mx = max(mx, abs(i@a[j]))
| 10 |
operation
|
n = int(input()); k = 0; i = 0;
li = list(map(int, input().split()))
if (len(li) > 1):
while(li[-1] == 0):
if (len(li) > 0):
li = li[:-1]
if (len(li) == 0):
break;
if (len(li) > 1):
while(li[0] == 0):
if (len(li) > 0):
li = li[1:]
if (len(li) == 0):
break;
if ((len(li) != 1) or (li[0] != 0)):
while (i < len(li)):
if (li[i] == 1):
k+=1
i+=1
elif ((li[i] == 0) and (li[i+1] != 0)):
k+=1
i+=1
elif ((li[i] == 0) and (li[i+1] == 0)):
j = i
while (li[j] == 0):
j+=1
i = j
print(k)
|
n = int(input()); k = 0; i = 0;
li = list(map(int, input().split()))
if (len(li) > 1):
while(li[-1] == 0):
if (len(li) > 0):
li = li[:-1]
if (len(li) == 0):
break;
if (len(li) > 1):
while(li[0] == 0):
if (len(li)==0):
li = li[1:]
if (len(li) == 0):
break;
if ((len(li) != 1) or (li[0] != 0)):
while (i < len(li)):
if (li[i] == 1):
k+=1
i+=1
elif ((li[i] == 0) and (li[i+1] != 0)):
k+=1
i+=1
elif ((li[i] == 0) and (li[i+1] == 0)):
j = i
while (li[j] == 0):
j+=1
i = j
print(k)
|
if (len(li)==0):
| 11 |
decision
|
n = int(input()); k = 0; i = 0;
li = list(map(int, input().split()))
if (len(li) > 1):
while(li[-1] == 0):
if (len(li) > 0):
li = li[:-1]
if (len(li) == 0):
break;
if (len(li) > 1):
while(li[0] == 0):
if (len(li) > 0):
li = li[1:]
if (len(li) == 0):
break;
if ((len(li) != 1) or (li[0] != 0)):
while (i < len(li)):
if (li[i] == 1):
k+=1
i+=1
elif ((li[i] == 0) and (li[i+1] != 0)):
k+=1
i+=1
elif ((li[i] == 0) and (li[i+1] == 0)):
j = i
while (li[j] == 0):
j+=1
i = j
print(k)
|
n = int(input()); k = 0; i = 0;
li = list(map(int, input().split()))
if (len(li) > 1):
while(li[-1] == 0):
if (len(li) > 0):
li = li[:-1]
if (len(li) == 0):
break;
if (len(li) > 1):
while(li[0] == 0):
if (len(li) > 0):
li = li[1:]
if (len(li) == 0):
break;
if ((len(li) != 1) or (li[0] != 0)):
while (i < len(li)):
if (li[i] == 1):
k+=1
i+=1
elif ((li[i] == 0) and (li[i+1] != 0)):
k+=1
i+=1
elif ((li[i] == 0) and (li[i^1] == 0)):
j = i
while (li[j] == 0):
j+=1
i = j
print(k)
|
elif ((li[i] == 0) and (li[i^1] == 0)):
| 23 |
operation
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.