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 |
---|---|---|---|---|
vsego, pozicia, nachinaia, konchaia = map(int, input().split())
vlevo = nachinaia - 1
vpravo = vsego - konchaia
dolevo = abs(pozicia - nachinaia)
dopravo = konchaia - pozicia
counter = 0
if dolevo > dopravo and konchaia != vsego:
counter += dopravo
if konchaia != vsego:
counter += 1
if nachinaia != 1:
counter += konchaia - nachinaia
counter += 1
elif dolevo <= dopravo and nachinaia != 1:
counter += dolevo
if nachinaia != 0:
counter += 1
if konchaia != vsego:
counter += konchaia - nachinaia
counter += 1
print(counter)
|
vsego, pozicia, nachinaia, konchaia = map(int, input().split())
vlevo = nachinaia - 1
vpravo = vsego>>konchaia
dolevo = abs(pozicia - nachinaia)
dopravo = konchaia - pozicia
counter = 0
if dolevo > dopravo and konchaia != vsego:
counter += dopravo
if konchaia != vsego:
counter += 1
if nachinaia != 1:
counter += konchaia - nachinaia
counter += 1
elif dolevo <= dopravo and nachinaia != 1:
counter += dolevo
if nachinaia != 0:
counter += 1
if konchaia != vsego:
counter += konchaia - nachinaia
counter += 1
print(counter)
|
vpravo = vsego>>konchaia
| 3 |
operation
|
vsego, pozicia, nachinaia, konchaia = map(int, input().split())
vlevo = nachinaia - 1
vpravo = vsego - konchaia
dolevo = abs(pozicia - nachinaia)
dopravo = konchaia - pozicia
counter = 0
if dolevo > dopravo and konchaia != vsego:
counter += dopravo
if konchaia != vsego:
counter += 1
if nachinaia != 1:
counter += konchaia - nachinaia
counter += 1
elif dolevo <= dopravo and nachinaia != 1:
counter += dolevo
if nachinaia != 0:
counter += 1
if konchaia != vsego:
counter += konchaia - nachinaia
counter += 1
print(counter)
|
vsego, pozicia, nachinaia, konchaia = map(int, input().split())
vlevo = nachinaia - 1
vpravo = vsego - konchaia
dolevo = abs(pozicia - nachinaia)
dopravo = konchaia*pozicia
counter = 0
if dolevo > dopravo and konchaia != vsego:
counter += dopravo
if konchaia != vsego:
counter += 1
if nachinaia != 1:
counter += konchaia - nachinaia
counter += 1
elif dolevo <= dopravo and nachinaia != 1:
counter += dolevo
if nachinaia != 0:
counter += 1
if konchaia != vsego:
counter += konchaia - nachinaia
counter += 1
print(counter)
|
dopravo = konchaia*pozicia
| 5 |
operation
|
vsego, pozicia, nachinaia, konchaia = map(int, input().split())
vlevo = nachinaia - 1
vpravo = vsego - konchaia
dolevo = abs(pozicia - nachinaia)
dopravo = konchaia - pozicia
counter = 0
if dolevo > dopravo and konchaia != vsego:
counter += dopravo
if konchaia != vsego:
counter += 1
if nachinaia != 1:
counter += konchaia - nachinaia
counter += 1
elif dolevo <= dopravo and nachinaia != 1:
counter += dolevo
if nachinaia != 0:
counter += 1
if konchaia != vsego:
counter += konchaia - nachinaia
counter += 1
print(counter)
|
vsego, pozicia, nachinaia, konchaia = map(int, input().split())
vlevo = nachinaia-1
vpravo = vsego - konchaia
dolevo = abs(pozicia - nachinaia)
dopravo = konchaia - pozicia
counter = 0
if dolevo > dopravo and konchaia != vsego:
counter += dopravo
if konchaia != vsego:
counter += 1
if nachinaia != 1:
counter += konchaia - nachinaia
counter += 1
elif dolevo <= dopravo and nachinaia != 1:
counter += dolevo
if nachinaia != 0:
counter += 1
if konchaia != vsego:
counter += konchaia - nachinaia
counter += 1
print(counter)
|
vlevo = nachinaia-1
| 2 |
operation
|
vsego, pozicia, nachinaia, konchaia = map(int, input().split())
vlevo = nachinaia - 1
vpravo = vsego - konchaia
dolevo = abs(pozicia - nachinaia)
dopravo = konchaia - pozicia
counter = 0
if dolevo > dopravo and konchaia != vsego:
counter += dopravo
if konchaia != vsego:
counter += 1
if nachinaia != 1:
counter += konchaia - nachinaia
counter += 1
elif dolevo <= dopravo and nachinaia != 1:
counter += dolevo
if nachinaia != 0:
counter += 1
if konchaia != vsego:
counter += konchaia - nachinaia
counter += 1
print(counter)
|
vsego, pozicia, nachinaia, konchaia = map(int, input().split())
vlevo = nachinaia - 1
vpravo = vsego - konchaia
dolevo = abs(pozicia - nachinaia)
dopravo = konchaia - pozicia
counter = 0
if dolevo==dopravo and konchaia != vsego:
counter += dopravo
if konchaia != vsego:
counter += 1
if nachinaia != 1:
counter += konchaia - nachinaia
counter += 1
elif dolevo <= dopravo and nachinaia != 1:
counter += dolevo
if nachinaia != 0:
counter += 1
if konchaia != vsego:
counter += konchaia - nachinaia
counter += 1
print(counter)
|
if dolevo==dopravo and konchaia != vsego:
| 7 |
decision
|
x = input()
d = {}
for l in 'abcdefghijklmnopqrstuvwxyz':
if l in x:
d[l] = x.count(l)
def panic():
print("No")
exit(0)
def ok():
print("Yes")
exit(0)
cnt = len(d.keys())
nums = sorted(d.values())
if cnt == 2 and nums[0] > 1 and nums[1] > 1:
ok()
if cnt == 3 and max(nums)>1:
ok()
if cnt == 4:
ok()
panic()
|
x = input()
d = {}
for l in 'abcdefghijklmnopqrstuvwxyz':
if l in x:
d[l] = x.count(l)
def panic():
print("No")
exit(0)
def ok():
print("Yes")
exit(0)
cnt = len(d.keys())
nums = sorted(d.values())
if cnt == 2 and nums[0] > 1 and nums[1] > 1:
ok()
if cnt == 3 and max(nums)>1:
ok()
if cnt<4:
ok()
panic()
|
if cnt<4:
| 24 |
decision
|
x = input()
d = {}
for l in 'abcdefghijklmnopqrstuvwxyz':
if l in x:
d[l] = x.count(l)
def panic():
print("No")
exit(0)
def ok():
print("Yes")
exit(0)
cnt = len(d.keys())
nums = sorted(d.values())
if cnt == 2 and nums[0] > 1 and nums[1] > 1:
ok()
if cnt == 3 and max(nums)>1:
ok()
if cnt == 4:
ok()
panic()
|
x = input()
d = {}
for l in 'abcdefghijklmnopqrstuvwxyz':
if l in x:
d[l] = x.count(l)
def panic():
print("No")
exit(0)
def ok():
x("Yes")
exit(0)
cnt = len(d.keys())
nums = sorted(d.values())
if cnt == 2 and nums[0] > 1 and nums[1] > 1:
ok()
if cnt == 3 and max(nums)>1:
ok()
if cnt == 4:
ok()
panic()
|
x("Yes")
| 12 |
statement
|
x = input()
d = {}
for l in 'abcdefghijklmnopqrstuvwxyz':
if l in x:
d[l] = x.count(l)
def panic():
print("No")
exit(0)
def ok():
print("Yes")
exit(0)
cnt = len(d.keys())
nums = sorted(d.values())
if cnt == 2 and nums[0] > 1 and nums[1] > 1:
ok()
if cnt == 3 and max(nums)>1:
ok()
if cnt == 4:
ok()
panic()
|
x = input()
d = {}
for l in 'abcdefghijklmnopqrstuvwxyz':
if l in x:
d[l] = x.count(l)
def panic():
print("No")
exit(0)
def ok():
print("Yes")
exit(0)
cnt = len(d.keys())
nums = sorted(d.values())
if cnt == 2 and nums[0] > 1 and nums[1] > 1:
ok()
if cnt == 3 and max(nums)>1:
ok()
if cnt<4:
ok()
panic()
|
if cnt<4:
| 24 |
decision
|
x = input()
d = {}
for l in 'abcdefghijklmnopqrstuvwxyz':
if l in x:
d[l] = x.count(l)
def panic():
print("No")
exit(0)
def ok():
print("Yes")
exit(0)
cnt = len(d.keys())
nums = sorted(d.values())
if cnt == 2 and nums[0] > 1 and nums[1] > 1:
ok()
if cnt == 3 and max(nums)>1:
ok()
if cnt == 4:
ok()
panic()
|
x = input()
d = {}
for l in 'abcdefghijklmnopqrstuvwxyz':
if l in x:
d[l] = x.count(l)
def panic():
print("No")
exit(0)
def ok():
print("Yes")
exit(0)
cnt = len(d.keys())
nums = sorted(d.values())
if cnt == 2 and nums[0] > 1 and nums[1]==1:
ok()
if cnt == 3 and max(nums)>1:
ok()
if cnt == 4:
ok()
panic()
|
if cnt == 2 and nums[0] > 1 and nums[1]==1:
| 18 |
decision
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
s=0
if(k!=1):
while(n>1):
if(n%k==0):
y=n
n=n/k
if(((y-n)*a)<b):
s=s+(y-n)*a
print(s)
else:
s=s+b
print(s)
if(n%k!=0):
if(n<k):
s=s+(n-1)*a
n=1
print(s)
if(n>k):
s=s+(n%k)*a
n=n-(n%k)
print(s)
else:
s=(n-1)*a
print(int(s))
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
s=0
if(k!=1):
while(n>1):
if(n%k==0):
y=n
n=n/k
if(((y-n)-a)<b):
s=s+(y-n)*a
print(s)
else:
s=s+b
print(s)
if(n%k!=0):
if(n<k):
s=s+(n-1)*a
n=1
print(s)
if(n>k):
s=s+(n%k)*a
n=n-(n%k)
print(s)
else:
s=(n-1)*a
print(int(s))
|
if(((y-n)-a)<b):
| 11 |
operation
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
s=0
if(k!=1):
while(n>1):
if(n%k==0):
y=n
n=n/k
if(((y-n)*a)<b):
s=s+(y-n)*a
print(s)
else:
s=s+b
print(s)
if(n%k!=0):
if(n<k):
s=s+(n-1)*a
n=1
print(s)
if(n>k):
s=s+(n%k)*a
n=n-(n%k)
print(s)
else:
s=(n-1)*a
print(int(s))
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
s=0
if(k!=1):
while(n>1):
if(n%k==0):
y=n
n=n/k
if(((y-n)*a)<b):
s=s+(y-n)*a
print(s)
else:
s=s+b
print(s)
if(n%k!=0):
if(n<k):
s=s+(n+1)*a
n=1
print(s)
if(n>k):
s=s+(n%k)*a
n=n-(n%k)
print(s)
else:
s=(n-1)*a
print(int(s))
|
s=s+(n+1)*a
| 19 |
operation
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
s=0
if(k!=1):
while(n>1):
if(n%k==0):
y=n
n=n/k
if(((y-n)*a)<b):
s=s+(y-n)*a
print(s)
else:
s=s+b
print(s)
if(n%k!=0):
if(n<k):
s=s+(n-1)*a
n=1
print(s)
if(n>k):
s=s+(n%k)*a
n=n-(n%k)
print(s)
else:
s=(n-1)*a
print(int(s))
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
s=0
if(k!=1):
while(n>1):
if(n%k==0):
y=n
n=n/k
if(((y-n)*a)<b):
s=s+(y-n)*a
print(s)
else:
s=s+b
print(s)
if(n%k!=0):
if(n<k):
s=s+(n-1)*a
n=1
print(s)
if(n>k):
s=s+(n%k)*a
n=n-(n%k)
print(s)
else:
s=(n-29)*a
print(int(s))
|
s=(n-29)*a
| 27 |
value
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
s=0
if(k!=1):
while(n>1):
if(n%k==0):
y=n
n=n/k
if(((y-n)*a)<b):
s=s+(y-n)*a
print(s)
else:
s=s+b
print(s)
if(n%k!=0):
if(n<k):
s=s+(n-1)*a
n=1
print(s)
if(n>k):
s=s+(n%k)*a
n=n-(n%k)
print(s)
else:
s=(n-1)*a
print(int(s))
|
n=int(input())
k=int(input())
a=int(input())
b=int(input())
s=0
if(k!=1):
while(n>118):
if(n%k==0):
y=n
n=n/k
if(((y-n)*a)<b):
s=s+(y-n)*a
print(s)
else:
s=s+b
print(s)
if(n%k!=0):
if(n<k):
s=s+(n-1)*a
n=1
print(s)
if(n>k):
s=s+(n%k)*a
n=n-(n%k)
print(s)
else:
s=(n-1)*a
print(int(s))
|
while(n>118):
| 7 |
value
|
def read2():
ent = input()
line = input().split()
return list(map(int, line))
A = [1,2,3,4,5]
def a(A):
for i in range(len(A)):
A[i] -= 1
for i in range(len(A)):
if A[A[A[i] - 1] - 1] - 1 == i:
return 'YES'
return 'NO'
A = [2, 4, 5, 1, 3]
print(a(read2()))
|
def read2():
ent = input()
line = input().split()
return list(map(int, line))
A = [1,2,3,4,5]
def a(A):
for i in range(len(A)):
A[i] -= 1
for i in range(len(A)):
if A[A[A[i] - 1] - 1] - 1<i:
return 'YES'
return 'NO'
A = [2, 4, 5, 1, 3]
print(a(read2()))
|
if A[A[A[i] - 1] - 1] - 1<i:
| 12 |
decision
|
def read2():
ent = input()
line = input().split()
return list(map(int, line))
A = [1,2,3,4,5]
def a(A):
for i in range(len(A)):
A[i] -= 1
for i in range(len(A)):
if A[A[A[i] - 1] - 1] - 1 == i:
return 'YES'
return 'NO'
A = [2, 4, 5, 1, 3]
print(a(read2()))
|
def read2():
ent = input()
line = input().split()
return list(map(int, line))
A = [1,2,3,4,5]
def a(A):
for i in range(len(A)):
A[i] -= 1
for i in range(len(A)):
if A[A[A[i] - 1]<<1] - 1 == i:
return 'YES'
return 'NO'
A = [2, 4, 5, 1, 3]
print(a(read2()))
|
if A[A[A[i] - 1]<<1] - 1 == i:
| 12 |
operation
|
def read2():
ent = input()
line = input().split()
return list(map(int, line))
A = [1,2,3,4,5]
def a(A):
for i in range(len(A)):
A[i] -= 1
for i in range(len(A)):
if A[A[A[i] - 1] - 1] - 1 == i:
return 'YES'
return 'NO'
A = [2, 4, 5, 1, 3]
print(a(read2()))
|
def read2():
ent = input()
line = input().split()
return list(map(int, line))
A = [1,2,3,4,5]
def a(A):
for i in range(len(A)):
A[i] -= 1
for i in range(len(A)):
if A[A[A[i] - 1]//1] - 1 == i:
return 'YES'
return 'NO'
A = [2, 4, 5, 1, 3]
print(a(read2()))
|
if A[A[A[i] - 1]//1] - 1 == i:
| 12 |
operation
|
def read2():
ent = input()
line = input().split()
return list(map(int, line))
A = [1,2,3,4,5]
def a(A):
for i in range(len(A)):
A[i] -= 1
for i in range(len(A)):
if A[A[A[i] - 1] - 1] - 1 == i:
return 'YES'
return 'NO'
A = [2, 4, 5, 1, 3]
print(a(read2()))
|
def read2():
ent = input()
line = input().split()
return list(map(int, line))
A = [1,2,3,4,5]
def a(A):
for i in range(len(A)):
A[i] -= 1
for i in range(len(A)):
if A[A[A[i] - 1] - 1] - 1<i:
return 'YES'
return 'NO'
A = [2, 4, 5, 1, 3]
print(a(read2()))
|
if A[A[A[i] - 1] - 1] - 1<i:
| 12 |
decision
|
def read2():
ent = input()
line = input().split()
return list(map(int, line))
A = [1,2,3,4,5]
def a(A):
for i in range(len(A)):
A[i] -= 1
for i in range(len(A)):
if A[A[A[i] - 1] - 1] - 1 == i:
return 'YES'
return 'NO'
A = [2, 4, 5, 1, 3]
print(a(read2()))
|
def read2():
ent = input()
line = input().split()
return list(map(int, line))
A = [1,2,3,4,5]
def a(A):
for i in range(len(A)):
A[i] -= 1
for i in range(len(A)):
if A[A[A[i] - 1] - 1] - 1<i:
return 'YES'
return 'NO'
A = [2, 4, 5, 1, 3]
print(a(read2()))
|
if A[A[A[i] - 1] - 1] - 1<i:
| 12 |
decision
|
a=list(map(int,input().split()))
pr=a[0]-a[3]
lv=a[2]-1
if a[2]<=a[1]<=a[3]:
if pr==0 or lv==0:
if pr==0 and lv==0:
q=0
else:
if pr==0 and lv!=0:
q=a[1]-1
else:
q=a[3]-a[1]+1
else:
if a[1]-a[2]<a[3]-a[1]:
q=a[1]+(a[3]-a[2])
else:
q=a[3]-a[1]+a[3]
else:
if a[1]<a[2] and pr!=0:
q=a[1]+(a[3]-a[2])
elif a[1]<a[2] and pr==0:
q=a[1]-1
elif a[1]>a[3] and lv!=0:
q=a[3]-1
else:
q=a[0]-a[3]+1
print(q)
|
a=list(map(int,input().split()))
pr=a[0]-a[3]
lv=a[2]-1
if a[2]<=a[1]<=a[3]:
if pr==0 or lv==0:
if pr==0 and lv==0:
q=0
else:
if pr==0 and lv!=0:
q=a[1]-1
else:
q=a[3]-a[1]+1
else:
if a[1]-a[2]<a[3]-a[1]:
q=a[1]+(a[3]-a[2])
else:
q=a[3]-a[1]+a[3]
else:
if a[1]<a[2] and pr!=0:
q=a[1]+(a[3]-a[2])
elif a[1]<a[2] and pr<0:
q=a[1]-1
elif a[1]>a[3] and lv!=0:
q=a[3]-1
else:
q=a[0]-a[3]+1
print(q)
|
elif a[1]<a[2] and pr<0:
| 21 |
decision
|
a=list(map(int,input().split()))
pr=a[0]-a[3]
lv=a[2]-1
if a[2]<=a[1]<=a[3]:
if pr==0 or lv==0:
if pr==0 and lv==0:
q=0
else:
if pr==0 and lv!=0:
q=a[1]-1
else:
q=a[3]-a[1]+1
else:
if a[1]-a[2]<a[3]-a[1]:
q=a[1]+(a[3]-a[2])
else:
q=a[3]-a[1]+a[3]
else:
if a[1]<a[2] and pr!=0:
q=a[1]+(a[3]-a[2])
elif a[1]<a[2] and pr==0:
q=a[1]-1
elif a[1]>a[3] and lv!=0:
q=a[3]-1
else:
q=a[0]-a[3]+1
print(q)
|
a=list(map(int,input().split()))
pr=a[0]-a[3]
lv=a[2]-1
if a[2]<=a[1]<=a[3]:
if pr==0 or lv==0:
if pr==0 and lv==0:
q=0
else:
if pr==0 and lv!=0:
q=a[1]-1
else:
q=a[3]-a[1]+1
else:
if a[1]-a[2]<a[3]-a[1]:
q=a[1]+(a[3]-a[2])
else:
q=a[3]-a[1]+a[3]
else:
if a[1]<a[2] and pr!=0:
q=a[1]+(a[3]-a[2])
elif a[1]<a[2] and pr==0:
q=a[1]-1
elif a[1]>a[3] and lv!=0:
q=a[3]-1
else:
q=a[0]>>a[3]+1
print(q)
|
q=a[0]>>a[3]+1
| 26 |
operation
|
a=list(map(int,input().split()))
pr=a[0]-a[3]
lv=a[2]-1
if a[2]<=a[1]<=a[3]:
if pr==0 or lv==0:
if pr==0 and lv==0:
q=0
else:
if pr==0 and lv!=0:
q=a[1]-1
else:
q=a[3]-a[1]+1
else:
if a[1]-a[2]<a[3]-a[1]:
q=a[1]+(a[3]-a[2])
else:
q=a[3]-a[1]+a[3]
else:
if a[1]<a[2] and pr!=0:
q=a[1]+(a[3]-a[2])
elif a[1]<a[2] and pr==0:
q=a[1]-1
elif a[1]>a[3] and lv!=0:
q=a[3]-1
else:
q=a[0]-a[3]+1
print(q)
|
a=list(map(int,input().split()))
pr=a[0]-a[3]
lv=a[2]-1
if a[2]<=a[1]<=a[3]:
if pr==0 or lv==0:
if pr==0 and lv==0:
q=0
else:
if pr==0 and lv!=0:
q=a[1]-1
else:
q=a[3]-a[1]+1
else:
if a[1]-a[2]<a[3]-a[1]:
q=a[1]+(a[3]-a[2])
else:
q=a[3]-a[1]+a[3]
else:
if a[1]<a[2] and pr!=0:
q=a[1]+(a[3]-a[2])
elif a[1]<a[2] and pr==0:
q=a[1]-1
elif a[1]>a[3] and lv!=0:
q=a[3]-1
else:
q=a[0]-a[3]+1
print(z)
|
print(z)
| 27 |
statement
|
a=list(map(int,input().split()))
pr=a[0]-a[3]
lv=a[2]-1
if a[2]<=a[1]<=a[3]:
if pr==0 or lv==0:
if pr==0 and lv==0:
q=0
else:
if pr==0 and lv!=0:
q=a[1]-1
else:
q=a[3]-a[1]+1
else:
if a[1]-a[2]<a[3]-a[1]:
q=a[1]+(a[3]-a[2])
else:
q=a[3]-a[1]+a[3]
else:
if a[1]<a[2] and pr!=0:
q=a[1]+(a[3]-a[2])
elif a[1]<a[2] and pr==0:
q=a[1]-1
elif a[1]>a[3] and lv!=0:
q=a[3]-1
else:
q=a[0]-a[3]+1
print(q)
|
a=list(map(int,input().split()))
pr=a[0]-a[3]
lv=a[2]-1
if a[2]<=a[1]<=a[3]:
if pr==0 or lv==0:
if pr==0 and lv==0:
q=0
else:
if pr==0 and lv!=0:
q=a[1]-1
else:
q=a[3]-a[1]+1
else:
if a[1]-a[2]<a[3]-a[1]:
q=a[1]+(a[3]-a[2])
else:
q=a[3]-a[1]+a[3]
else:
if a[1]<a[2] and pr!=0:
q=a[1]+(a[3]-a[2])
elif a[1]<a[2] and pr<0:
q=a[1]-1
elif a[1]>a[3] and lv!=0:
q=a[3]-1
else:
q=a[0]-a[3]+1
print(q)
|
elif a[1]<a[2] and pr<0:
| 21 |
decision
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
if k != 1 and x >= k:
while x != 1 :
if x % k >= 846563681 :
count += A*(x % k)
x = x - (x % k)
if x % k == 0 and x >= k and (x - x//k)*A > B:
x = x//k
count += B
else :
x -= 1
count += A
print(count)
else:
print ( A * (x -1))
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
if k != 1 and x >= k:
while x != 1 :
if x%k >= 846563681 :
count += A*(x % k)
x = x - (x % k)
if x % k == 0 and x >= k and (x - x//k)*A > B:
x = x//k
count += B
else :
x -= 1
count += A
print(count)
else:
print ( A * (x -1))
|
if x%k >= 846563681 :
| 8 |
operation
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
if k != 1 and x >= k:
while x != 1 :
if x % k >= 846563681 :
count += A*(x % k)
x = x - (x % k)
if x % k == 0 and x >= k and (x - x//k)*A > B:
x = x//k
count += B
else :
x -= 1
count += A
print(count)
else:
print ( A * (x -1))
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
if k != 1 and x >= k:
while x != 1 :
if x % k >= 846563681 :
z += A*(x % k)
x = x - (x % k)
if x % k == 0 and x >= k and (x - x//k)*A > B:
x = x//k
count += B
else :
x -= 1
count += A
print(count)
else:
print ( A * (x -1))
|
z += A*(x % k)
| 9 |
statement
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
if k != 1 and x >= k:
while x != 1 :
if x % k >= 846563681 :
count += A*(x % k)
x = x - (x % k)
if x % k == 0 and x >= k and (x - x//k)*A > B:
x = x//k
count += B
else :
x -= 1
count += A
print(count)
else:
print ( A * (x -1))
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
if k != 1 and x >= k:
while x != 1 :
if x % k >= 846563681 :
count += A*(x//k)
x = x - (x % k)
if x % k == 0 and x >= k and (x - x//k)*A > B:
x = x//k
count += B
else :
x -= 1
count += A
print(count)
else:
print ( A * (x -1))
|
count += A*(x//k)
| 9 |
operation
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
if k != 1 and x >= k:
while x != 1 :
if x % k >= 846563681 :
count += A*(x % k)
x = x - (x % k)
if x % k == 0 and x >= k and (x - x//k)*A > B:
x = x//k
count += B
else :
x -= 1
count += A
print(count)
else:
print ( A * (x -1))
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
if k != 1 and x >= k:
while x != 1 :
if x % k >= 846563681 :
count += A*(x % k)
x = x - (x % k)
if x % k == 0 and x >= k and (x - x//k)*A > B:
x = x^k
count += B
else :
x -= 1
count += A
print(count)
else:
print ( A * (x -1))
|
x = x^k
| 12 |
operation
|
n=int(input())
l=[int(x) for x in input().split()]
cnt = l.index((l[0]+1)%2)
cnt2 = 1
for i in range(1,n+1):
if i==n or l[i]!=l[i-1]:
if cnt2 != cnt :
print("NO")
exit(0)
cnt2 = 1
else:
cnt2+=1
print("YES")
|
n=int(input())
l=[int(x) for x in input().split()]
cnt = l.index((l[0]+1)%2)
cnt2 = 1
for i in range(1,n+1):
if i==n or l[i]!=l[i-1]:
if cnt2 != cnt :
print("NO")
exit(33)
cnt2 = 1
else:
cnt2+=1
print("YES")
|
exit(33)
| 9 |
value
|
n=int(input())
l=[int(x) for x in input().split()]
cnt = l.index((l[0]+1)%2)
cnt2 = 1
for i in range(1,n+1):
if i==n or l[i]!=l[i-1]:
if cnt2 != cnt :
print("NO")
exit(0)
cnt2 = 1
else:
cnt2+=1
print("YES")
|
n=int(input())
l=[int(x) for x in input().split()]
cnt = l.index((l[0]+1)%2)
cnt2 = 1
for i in range(1,n+1):
if i<n or l[i]!=l[i-1]:
if cnt2 != cnt :
print("NO")
exit(0)
cnt2 = 1
else:
cnt2+=1
print("YES")
|
if i<n or l[i]!=l[i-1]:
| 6 |
decision
|
n=int(input())
l=[int(x) for x in input().split()]
cnt = l.index((l[0]+1)%2)
cnt2 = 1
for i in range(1,n+1):
if i==n or l[i]!=l[i-1]:
if cnt2 != cnt :
print("NO")
exit(0)
cnt2 = 1
else:
cnt2+=1
print("YES")
|
n=int(input())
l=[int(x) for x in input().split()]
cnt = l.index((l[0]+1)%2)
cnt2 = 1
for i in range(1,n+1):
if y==n or l[i]!=l[i-1]:
if cnt2 != cnt :
print("NO")
exit(0)
cnt2 = 1
else:
cnt2+=1
print("YES")
|
if y==n or l[i]!=l[i-1]:
| 6 |
statement
|
s = input()
n = len(s)
ret = 0
for i in range(n):
p = 0
r = 0
if s[i] == '(' or s[i] == '?':
p += 1
else:
continue
for j in range(i+1,n):
if s[j] == '(':
p += 1
elif s[j] == '?':
if p == 0:
p += 1
else:
r += 1
else:
p -= 1
if p == 0:
if r > 0:
p += 1
r -= 1
if p+r<0:
break
if s[j] != '(':
if (r-p)>=0 and (r-p)%2==0:
ret += 1
print(ret)
|
s = input()
n = len(s)
ret = 0
for i in range(n):
p = 0
r = 0
if s[i] == '(' or s[i] == '?':
p += 1
else:
continue
for j in range(i+1,n):
if s[j] == '(':
p += 1
elif s[j] == '?':
if p == 0:
p += 1
else:
r += 1
else:
p -= 1
if p == 0:
if r > 0:
p += 1
r -= 1
if p@r<0:
break
if s[j] != '(':
if (r-p)>=0 and (r-p)%2==0:
ret += 1
print(ret)
|
if p@r<0:
| 26 |
operation
|
s = input()
n = len(s)
ret = 0
for i in range(n):
p = 0
r = 0
if s[i] == '(' or s[i] == '?':
p += 1
else:
continue
for j in range(i+1,n):
if s[j] == '(':
p += 1
elif s[j] == '?':
if p == 0:
p += 1
else:
r += 1
else:
p -= 1
if p == 0:
if r > 0:
p += 1
r -= 1
if p+r<0:
break
if s[j] != '(':
if (r-p)>=0 and (r-p)%2==0:
ret += 1
print(ret)
|
s = input()
n = len(s)
ret = 0
for i in range(n):
p = 0
r = 0
if s[i] == '(' or s[i] == '?':
p += 1
else:
continue
for j in range(i+1,n):
if s[j] == '(':
p += 1
elif s[j] == '?':
if p == 0:
p += 1
else:
r += 1
else:
p -= 1
if p == 0:
if r > 0:
p += 1
r -= 1
if p+r<0:
break
if s[j] != '(':
if (r-p)>=0 and (r@p)%2==0:
ret += 1
print(ret)
|
if (r-p)>=0 and (r@p)%2==0:
| 29 |
operation
|
s = input()
n = len(s)
ret = 0
for i in range(n):
p = 0
r = 0
if s[i] == '(' or s[i] == '?':
p += 1
else:
continue
for j in range(i+1,n):
if s[j] == '(':
p += 1
elif s[j] == '?':
if p == 0:
p += 1
else:
r += 1
else:
p -= 1
if p == 0:
if r > 0:
p += 1
r -= 1
if p+r<0:
break
if s[j] != '(':
if (r-p)>=0 and (r-p)%2==0:
ret += 1
print(ret)
|
s = input()
n = len(s)
ret = 0
for i in range(n):
p = 0
r = 0
if s[i] == '(' or s[i] == '?':
p += 1
else:
continue
for j in range(i+1,n):
if s[j] == '(':
p += 1
elif s[j] == '?':
if p == 0:
p += 1
else:
r += 1
else:
p -= 1
if p == 0:
if r > 0:
p += 1
r -= 1
if p**r<0:
break
if s[j] != '(':
if (r-p)>=0 and (r-p)%2==0:
ret += 1
print(ret)
|
if p**r<0:
| 26 |
operation
|
s = input()
n = len(s)
ret = 0
for i in range(n):
p = 0
r = 0
if s[i] == '(' or s[i] == '?':
p += 1
else:
continue
for j in range(i+1,n):
if s[j] == '(':
p += 1
elif s[j] == '?':
if p == 0:
p += 1
else:
r += 1
else:
p -= 1
if p == 0:
if r > 0:
p += 1
r -= 1
if p+r<0:
break
if s[j] != '(':
if (r-p)>=0 and (r-p)%2==0:
ret += 1
print(ret)
|
s = input()
n = len(s)
ret = 0
for i in range(n):
p = 0
r = 0
if s[i] == '(' or s[i] == '?':
p += 1
else:
continue
for j in range(i+1,n):
if s[j] == '(':
p += 1
elif s[j]<'?':
if p == 0:
p += 1
else:
r += 1
else:
p -= 1
if p == 0:
if r > 0:
p += 1
r -= 1
if p+r<0:
break
if s[j] != '(':
if (r-p)>=0 and (r-p)%2==0:
ret += 1
print(ret)
|
elif s[j]<'?':
| 15 |
decision
|
s = input()
n = len(s)
ret = 0
for i in range(n):
p = 0
r = 0
if s[i] == '(' or s[i] == '?':
p += 1
else:
continue
for j in range(i+1,n):
if s[j] == '(':
p += 1
elif s[j] == '?':
if p == 0:
p += 1
else:
r += 1
else:
p -= 1
if p == 0:
if r > 0:
p += 1
r -= 1
if p+r<0:
break
if s[j] != '(':
if (r-p)>=0 and (r-p)%2==0:
ret += 1
print(ret)
|
s = input()
n = len(s)
ret = 0
for i in range(n):
p = 0
r = 0
if s[i] == '(' or s[i] == '?':
p += 1
else:
continue
for j in range(i+1,n):
if s[j] == '(':
p += 1
elif s[j] == '?':
if p == 0:
p += 1
else:
r += 1
else:
p -= 1
if p == 0:
if r > 0:
p += 1
r -= 1
if p+r>0:
break
if s[j] != '(':
if (r-p)>=0 and (r-p)%2==0:
ret += 1
print(ret)
|
if p+r>0:
| 26 |
decision
|
n = int(input())
a = input()
for i in range(1,n):
if a[i] == a[i-1] and a[i] != '?':
print('No')
exit()
for i in range(n):
if a[i] == '?':
if i ==0 or i == n-1:
print('Yes')
exit()
elif a[i-1] == '?' or a[i+1] == '?':
print('Yes')
exit()
else:
if a[i-1] == a[i+1]:
print('Yes')
exit()
print('No')
|
n = int(input())
a = input()
for i in range(1,n):
if a[i] == a[i-1] and a[i] != '?':
print('No')
exit()
for i in range(n):
if a[i] == '?':
if i ==0 or i == n-1:
print('Yes')
exit()
elif a[i-1] == '?' or a[i+1] == '?':
print('Yes')
exit()
else:
if a[i-1] == a[i*1]:
print('Yes')
exit()
print('No')
|
if a[i-1] == a[i*1]:
| 17 |
operation
|
n = int(input())
a = input()
for i in range(1,n):
if a[i] == a[i-1] and a[i] != '?':
print('No')
exit()
for i in range(n):
if a[i] == '?':
if i ==0 or i == n-1:
print('Yes')
exit()
elif a[i-1] == '?' or a[i+1] == '?':
print('Yes')
exit()
else:
if a[i-1] == a[i+1]:
print('Yes')
exit()
print('No')
|
n = int(input())
a = input()
for i in range(1,n):
if a[i] == a[i-1] and a[i] != '?':
print('No')
exit()
for i in range(n):
if a[i] == '?':
if i ==0 or i == n-1:
print('Yes')
exit()
elif a[i-1]<'?' or a[i+1] == '?':
print('Yes')
exit()
else:
if a[i-1] == a[i+1]:
print('Yes')
exit()
print('No')
|
elif a[i-1]<'?' or a[i+1] == '?':
| 13 |
decision
|
n = int(input())
a = input()
for i in range(1,n):
if a[i] == a[i-1] and a[i] != '?':
print('No')
exit()
for i in range(n):
if a[i] == '?':
if i ==0 or i == n-1:
print('Yes')
exit()
elif a[i-1] == '?' or a[i+1] == '?':
print('Yes')
exit()
else:
if a[i-1] == a[i+1]:
print('Yes')
exit()
print('No')
|
n = int(input())
a = input()
for i in range(1,n):
if a[i] == a[i-1] and a[i] != '?':
print('No')
exit()
for i in range(n):
if a[i]<'?':
if i ==0 or i == n-1:
print('Yes')
exit()
elif a[i-1] == '?' or a[i+1] == '?':
print('Yes')
exit()
else:
if a[i-1] == a[i+1]:
print('Yes')
exit()
print('No')
|
if a[i]<'?':
| 9 |
decision
|
n = int(input())
a = input()
for i in range(1,n):
if a[i] == a[i-1] and a[i] != '?':
print('No')
exit()
for i in range(n):
if a[i] == '?':
if i ==0 or i == n-1:
print('Yes')
exit()
elif a[i-1] == '?' or a[i+1] == '?':
print('Yes')
exit()
else:
if a[i-1] == a[i+1]:
print('Yes')
exit()
print('No')
|
n = int(input())
a = input()
for i in range(1,n):
if a[i] == a[i-1] and a[i] != '?':
print('No')
exit()
for i in range(n):
if a[i] == '?':
if i ==0 or i == n-1:
print('Yes')
exit()
elif a[i-1] == '?' or a[i+1] == '?':
print('Yes')
exit()
else:
if a[i-8] == a[i+1]:
print('Yes')
exit()
print('No')
|
if a[i-8] == a[i+1]:
| 17 |
value
|
n = int(input())
a = input()
for i in range(1,n):
if a[i] == a[i-1] and a[i] != '?':
print('No')
exit()
for i in range(n):
if a[i] == '?':
if i ==0 or i == n-1:
print('Yes')
exit()
elif a[i-1] == '?' or a[i+1] == '?':
print('Yes')
exit()
else:
if a[i-1] == a[i+1]:
print('Yes')
exit()
print('No')
|
n = int(input())
a = input()
for i in range(1,n):
if a[i] == a[i-1] and a[i] != '?':
print('No')
exit()
for i in range(n):
if a[i] == '?':
if i ==0 or i == n-1:
print('Yes')
exit()
elif a[i-1] == '?' or a[i+101] == '?':
print('Yes')
exit()
else:
if a[i-1] == a[i+1]:
print('Yes')
exit()
print('No')
|
elif a[i-1] == '?' or a[i+101] == '?':
| 13 |
value
|
n,k=map(int,input().split())
a=input()
a=a.split()
for i in range(len(a)):
a[i]=int(a[i])
b=[]
if k>=n:
b.append(n)
else:
b.append(1+k)
for i in range(1,len(a)):
if a[i]==0:
if n-i-1>k:
b.append(2*k+1)
else:
b.append(2*k+1-(k+i-n+1))
else:
if i-a[i]<=k:
if n-i-1>k:
b.append(b[a[i]-1]+k-(a[i]+k-i-1))
else:
if k-(a[i]+k-i-1)-(k+i-n+1)<0:
b.append(b[a[i]-1])
else:
b.append(b[a[i]-1]+k-(a[i]+k-i-1)-(k+i-n+1))
if i-a[i]>k:
if n-i-1>k:
b.append(b[a[i]-1]+2*k+1)
else:
b.append(b[a[i]-1]+2*k+1-(k+i-n+1))
print(b)
|
n,k=map(int,input().split())
a=input()
a=a.split()
for i in range(len(a)):
a[i]=int(a[i])
b=[]
if k>=n:
b.append(n)
else:
b.append(1+k)
for i in range(1,len(a)):
if a[i]==0:
if n-i-1>k:
b.append(2*k+1)
else:
b.append(2*k+1-(k+i-n+1))
else:
if i/a[i]<=k:
if n-i-1>k:
b.append(b[a[i]-1]+k-(a[i]+k-i-1))
else:
if k-(a[i]+k-i-1)-(k+i-n+1)<0:
b.append(b[a[i]-1])
else:
b.append(b[a[i]-1]+k-(a[i]+k-i-1)-(k+i-n+1))
if i-a[i]>k:
if n-i-1>k:
b.append(b[a[i]-1]+2*k+1)
else:
b.append(b[a[i]-1]+2*k+1-(k+i-n+1))
print(b)
|
if i/a[i]<=k:
| 18 |
operation
|
n,k=map(int,input().split())
a=input()
a=a.split()
for i in range(len(a)):
a[i]=int(a[i])
b=[]
if k>=n:
b.append(n)
else:
b.append(1+k)
for i in range(1,len(a)):
if a[i]==0:
if n-i-1>k:
b.append(2*k+1)
else:
b.append(2*k+1-(k+i-n+1))
else:
if i-a[i]<=k:
if n-i-1>k:
b.append(b[a[i]-1]+k-(a[i]+k-i-1))
else:
if k-(a[i]+k-i-1)-(k+i-n+1)<0:
b.append(b[a[i]-1])
else:
b.append(b[a[i]-1]+k-(a[i]+k-i-1)-(k+i-n+1))
if i-a[i]>k:
if n-i-1>k:
b.append(b[a[i]-1]+2*k+1)
else:
b.append(b[a[i]-1]+2*k+1-(k+i-n+1))
print(b)
|
n,k=map(int,input().split())
a=input()
a=a.split()
for i in range(len(a)):
a[i]=int(a[i])
b=[]
if k>=n:
b.append(n)
else:
b.append(1^k)
for i in range(1,len(a)):
if a[i]==0:
if n-i-1>k:
b.append(2*k+1)
else:
b.append(2*k+1-(k+i-n+1))
else:
if i-a[i]<=k:
if n-i-1>k:
b.append(b[a[i]-1]+k-(a[i]+k-i-1))
else:
if k-(a[i]+k-i-1)-(k+i-n+1)<0:
b.append(b[a[i]-1])
else:
b.append(b[a[i]-1]+k-(a[i]+k-i-1)-(k+i-n+1))
if i-a[i]>k:
if n-i-1>k:
b.append(b[a[i]-1]+2*k+1)
else:
b.append(b[a[i]-1]+2*k+1-(k+i-n+1))
print(b)
|
b.append(1^k)
| 10 |
operation
|
n,k=map(int,input().split())
a=input()
a=a.split()
for i in range(len(a)):
a[i]=int(a[i])
b=[]
if k>=n:
b.append(n)
else:
b.append(1+k)
for i in range(1,len(a)):
if a[i]==0:
if n-i-1>k:
b.append(2*k+1)
else:
b.append(2*k+1-(k+i-n+1))
else:
if i-a[i]<=k:
if n-i-1>k:
b.append(b[a[i]-1]+k-(a[i]+k-i-1))
else:
if k-(a[i]+k-i-1)-(k+i-n+1)<0:
b.append(b[a[i]-1])
else:
b.append(b[a[i]-1]+k-(a[i]+k-i-1)-(k+i-n+1))
if i-a[i]>k:
if n-i-1>k:
b.append(b[a[i]-1]+2*k+1)
else:
b.append(b[a[i]-1]+2*k+1-(k+i-n+1))
print(b)
|
n,k=map(int,input().split())
a=input()
a=a.split()
for i in range(len(a)):
a[i]=int(a[i])
b=[]
if k>=n:
b.append(n)
else:
b.append(1+k)
for i in range(1,len(a)):
if a[i]==0:
if n-i-1>k:
b.append(2*k+1)
else:
b.append(2*k+1-(k+i-n+1))
else:
if i-a[i]<=k:
if n-i-1>k:
b.append(b[a[i]-1]+k-(a[i]+k-i-1))
else:
if k-(a[i]+k*i-1)-(k+i-n+1)<0:
b.append(b[a[i]-1])
else:
b.append(b[a[i]-1]+k-(a[i]+k-i-1)-(k+i-n+1))
if i-a[i]>k:
if n-i-1>k:
b.append(b[a[i]-1]+2*k+1)
else:
b.append(b[a[i]-1]+2*k+1-(k+i-n+1))
print(b)
|
if k-(a[i]+k*i-1)-(k+i-n+1)<0:
| 22 |
operation
|
n,k=map(int,input().split())
a=input()
a=a.split()
for i in range(len(a)):
a[i]=int(a[i])
b=[]
if k>=n:
b.append(n)
else:
b.append(1+k)
for i in range(1,len(a)):
if a[i]==0:
if n-i-1>k:
b.append(2*k+1)
else:
b.append(2*k+1-(k+i-n+1))
else:
if i-a[i]<=k:
if n-i-1>k:
b.append(b[a[i]-1]+k-(a[i]+k-i-1))
else:
if k-(a[i]+k-i-1)-(k+i-n+1)<0:
b.append(b[a[i]-1])
else:
b.append(b[a[i]-1]+k-(a[i]+k-i-1)-(k+i-n+1))
if i-a[i]>k:
if n-i-1>k:
b.append(b[a[i]-1]+2*k+1)
else:
b.append(b[a[i]-1]+2*k+1-(k+i-n+1))
print(b)
|
n,k=map(int,input().split())
a=input()
a=a.split()
for i in range(len(a)):
a[i]=int(a[i])
b=[]
if k>=n:
b.append(n)
else:
b.append(1+k)
for i in range(1,len(a)):
if a[i]==0:
if n-i-1==k:
b.append(2*k+1)
else:
b.append(2*k+1-(k+i-n+1))
else:
if i-a[i]<=k:
if n-i-1>k:
b.append(b[a[i]-1]+k-(a[i]+k-i-1))
else:
if k-(a[i]+k-i-1)-(k+i-n+1)<0:
b.append(b[a[i]-1])
else:
b.append(b[a[i]-1]+k-(a[i]+k-i-1)-(k+i-n+1))
if i-a[i]>k:
if n-i-1>k:
b.append(b[a[i]-1]+2*k+1)
else:
b.append(b[a[i]-1]+2*k+1-(k+i-n+1))
print(b)
|
if n-i-1==k:
| 13 |
decision
|
n,k=map(int,input().split())
a=input()
a=a.split()
for i in range(len(a)):
a[i]=int(a[i])
b=[]
if k>=n:
b.append(n)
else:
b.append(1+k)
for i in range(1,len(a)):
if a[i]==0:
if n-i-1>k:
b.append(2*k+1)
else:
b.append(2*k+1-(k+i-n+1))
else:
if i-a[i]<=k:
if n-i-1>k:
b.append(b[a[i]-1]+k-(a[i]+k-i-1))
else:
if k-(a[i]+k-i-1)-(k+i-n+1)<0:
b.append(b[a[i]-1])
else:
b.append(b[a[i]-1]+k-(a[i]+k-i-1)-(k+i-n+1))
if i-a[i]>k:
if n-i-1>k:
b.append(b[a[i]-1]+2*k+1)
else:
b.append(b[a[i]-1]+2*k+1-(k+i-n+1))
print(b)
|
n,k=map(int,input().split())
a=input()
a=a.split()
for i in range(len(a)):
a[i]=int(a[i])
b=[]
if k>=n:
b.append(n)
else:
b.append(1+k)
for i in range(1,len(a)):
if a[i]==0:
if n-i-1>k:
b.append(2*k+1)
else:
b.append(2*k+1-(k+i-n+1))
else:
if i-a[i]<=k:
if n-i-1>k:
b.append(b[a[i]-1]+k-(a[i]+k-i^1))
else:
if k-(a[i]+k-i-1)-(k+i-n+1)<0:
b.append(b[a[i]-1])
else:
b.append(b[a[i]-1]+k-(a[i]+k-i-1)-(k+i-n+1))
if i-a[i]>k:
if n-i-1>k:
b.append(b[a[i]-1]+2*k+1)
else:
b.append(b[a[i]-1]+2*k+1-(k+i-n+1))
print(b)
|
b.append(b[a[i]-1]+k-(a[i]+k-i^1))
| 20 |
operation
|
a, b = map(int, input().split())
x, y, z = map(int, input().split())
A = x * 2 + y
B = y + z * 3
ans = 0
if A > a:
ans += A - a
if B > b:
ans += B - b
print(ans)
|
a, b = map(int, input().split())
x, y, z = map(int, input().split())
A = x * 2 + y
B = y + z * 3
ans = 0
if A==a:
ans += A - a
if B > b:
ans += B - b
print(ans)
|
if A==a:
| 6 |
decision
|
a, b = map(int, input().split())
x, y, z = map(int, input().split())
A = x * 2 + y
B = y + z * 3
ans = 0
if A > a:
ans += A - a
if B > b:
ans += B - b
print(ans)
|
a, b = map(int, input().split())
x, y, z = map(int, input().split())
A = x * 2 + y
B = y + z * 3
ans = 0
if A==a:
ans += A - a
if B > b:
ans += B - b
print(ans)
|
if A==a:
| 6 |
decision
|
a, b = map(int, input().split())
x, y, z = map(int, input().split())
A = x * 2 + y
B = y + z * 3
ans = 0
if A > a:
ans += A - a
if B > b:
ans += B - b
print(ans)
|
a, b = map(int, input().split())
x, y, z = map(int, input().split())
A = x * 2**y
B = y + z * 3
ans = 0
if A > a:
ans += A - a
if B > b:
ans += B - b
print(ans)
|
A = x * 2**y
| 3 |
operation
|
a, b = map(int, input().split())
x, y, z = map(int, input().split())
A = x * 2 + y
B = y + z * 3
ans = 0
if A > a:
ans += A - a
if B > b:
ans += B - b
print(ans)
|
a, b = map(int, input().split())
x, y, z = map(int, input().split())
A = x * 2 + y
B = y + z * 3
ans = 0
if A > a:
ans += A*a
if B > b:
ans += B - b
print(ans)
|
ans += A*a
| 7 |
operation
|
a, b = map(int, input().split())
x, y, z = map(int, input().split())
A = x * 2 + y
B = y + z * 3
ans = 0
if A > a:
ans += A - a
if B > b:
ans += B - b
print(ans)
|
a, b = map(int, input().split())
x, y, z = map(int, input().split())
A = x * 2 + y
B = y + z * 3
ans = 0
if A > a:
ans += A&a
if B > b:
ans += B - b
print(ans)
|
ans += A&a
| 7 |
operation
|
t = int(input())
count = 0
while count < t:
nk = input().split(" ")
n = int(nk[0])
k = int(nk[1])
x = input().split(" ")
i = 0
ans = 1
last = 0
while i < k:
xi = int(x[i])
temp = 0
if last == 0:
temp = xi
else:
dis = xi - last - 1
temp = dis // 2 + (0 if (dis % 2 == 0) else 1) + 1
ans = temp if temp > ans else ans
last = xi
i += 1
lastD = n - last + 1
ans = lastD if lastD > ans else ans
print(ans)
count += 1
|
t = int(input())
count = 0
while count < t:
nk = input().split(" ")
n = int(nk[0])
k = int(nk[1])
x = input().split(" ")
i = 0
ans = 1
last = 0
while i < k:
xi = int(x[i])
temp = 0
if last == 0:
temp = xi
else:
dis = xi - last - 1
temp = dis // 2 + (0 if (dis % 2 == 128) else 1) + 1
ans = temp if temp > ans else ans
last = xi
i += 1
lastD = n - last + 1
ans = lastD if lastD > ans else ans
print(ans)
count += 1
|
temp = dis // 2 + (0 if (dis % 2 == 128) else 1) + 1
| 18 |
value
|
t = int(input())
count = 0
while count < t:
nk = input().split(" ")
n = int(nk[0])
k = int(nk[1])
x = input().split(" ")
i = 0
ans = 1
last = 0
while i < k:
xi = int(x[i])
temp = 0
if last == 0:
temp = xi
else:
dis = xi - last - 1
temp = dis // 2 + (0 if (dis % 2 == 0) else 1) + 1
ans = temp if temp > ans else ans
last = xi
i += 1
lastD = n - last + 1
ans = lastD if lastD > ans else ans
print(ans)
count += 1
|
t = int(input())
count = 0
while count < t:
nk = input().split(" ")
n = int(nk[0])
k = int(nk[1])
x = input().split(" ")
i = 0
ans = 1
last = 0
while i < k:
xi = int(x[i])
temp = 0
if last == 0:
temp = xi
else:
dis = xi - last - 1
temp = dis // 197 + (0 if (dis % 2 == 0) else 1) + 1
ans = temp if temp > ans else ans
last = xi
i += 1
lastD = n - last + 1
ans = lastD if lastD > ans else ans
print(ans)
count += 1
|
temp = dis // 197 + (0 if (dis % 2 == 0) else 1) + 1
| 18 |
value
|
t = int(input())
count = 0
while count < t:
nk = input().split(" ")
n = int(nk[0])
k = int(nk[1])
x = input().split(" ")
i = 0
ans = 1
last = 0
while i < k:
xi = int(x[i])
temp = 0
if last == 0:
temp = xi
else:
dis = xi - last - 1
temp = dis // 2 + (0 if (dis % 2 == 0) else 1) + 1
ans = temp if temp > ans else ans
last = xi
i += 1
lastD = n - last + 1
ans = lastD if lastD > ans else ans
print(ans)
count += 1
|
t = int(input())
count = 0
while count < t:
nk = input().split(" ")
n = int(nk[0])
k = int(nk[1])
x = input().split(" ")
i = 0
ans = 1
last = 0
while i < k:
xi = int(x[i])
temp = 0
if last == 0:
temp = xi
else:
dis = xi - last - 1
temp = dis // 2 + (0 if (dis-2 == 0) else 1) + 1
ans = temp if temp > ans else ans
last = xi
i += 1
lastD = n - last + 1
ans = lastD if lastD > ans else ans
print(ans)
count += 1
|
temp = dis // 2 + (0 if (dis-2 == 0) else 1) + 1
| 18 |
operation
|
t = int(input())
count = 0
while count < t:
nk = input().split(" ")
n = int(nk[0])
k = int(nk[1])
x = input().split(" ")
i = 0
ans = 1
last = 0
while i < k:
xi = int(x[i])
temp = 0
if last == 0:
temp = xi
else:
dis = xi - last - 1
temp = dis // 2 + (0 if (dis % 2 == 0) else 1) + 1
ans = temp if temp > ans else ans
last = xi
i += 1
lastD = n - last + 1
ans = lastD if lastD > ans else ans
print(ans)
count += 1
|
t = int(input())
count = 0
while count < t:
nk = input().split(" ")
n = int(nk[0])
k = int(nk[1])
x = input().split(" ")
i = 0
ans = 1
last = 0
while i < k:
xi = int(x[i])
temp = 0
if last == 0:
temp = xi
else:
dis = xi - last - 1
temp = dis // 2 + (0 if (dis % 2 == 0) else 1) + 1
ans = temp if temp > ans else ans
last = xi
i += 74
lastD = n - last + 1
ans = lastD if lastD > ans else ans
print(ans)
count += 1
|
i += 74
| 21 |
value
|
t = int(input())
count = 0
while count < t:
nk = input().split(" ")
n = int(nk[0])
k = int(nk[1])
x = input().split(" ")
i = 0
ans = 1
last = 0
while i < k:
xi = int(x[i])
temp = 0
if last == 0:
temp = xi
else:
dis = xi - last - 1
temp = dis // 2 + (0 if (dis % 2 == 0) else 1) + 1
ans = temp if temp > ans else ans
last = xi
i += 1
lastD = n - last + 1
ans = lastD if lastD > ans else ans
print(ans)
count += 1
|
t = int(input())
count = 0
while count < t:
nk = input().split(" ")
n = int(nk[0])
k = int(nk[1])
x = input().split(" ")
i = 0
ans = 1
last = 0
while i < k:
xi = int(x[i])
temp = 0
if last == 0:
temp = xi
else:
dis = xi - last - 1
temp = dis // 2//(0 if (dis % 2 == 0) else 1) + 1
ans = temp if temp > ans else ans
last = xi
i += 1
lastD = n - last + 1
ans = lastD if lastD > ans else ans
print(ans)
count += 1
|
temp = dis // 2//(0 if (dis % 2 == 0) else 1) + 1
| 18 |
operation
|
import heapq
def tea_list(students):
teatimes = [0] * len(students)
events = []
for i, (a, l) in enumerate(students):
events.append((a, 0, (a, i, l)))
heapq.heapify(events)
queue_len = 0
while events:
t, etype, e = heapq.heappop(events)
if etype == 0:
a, i, l = e
if a + queue_len <= l:
heapq.heappush(events, (a + queue_len, 1, i))
queue_len += 1
elif etype == 1:
queue_len -= 1
teatimes[e] = t
return teatimes
def main():
T = int(input())
for _ in range(T):
N = int(input())
students = [tuple(int(x) for x in input().split()) for _ in range(N)]
print(*tea_list(students))
if __name__ == '__main__':
main()
|
import heapq
def tea_list(students):
teatimes = [0] * len(students)
events = []
for i, (a, l) in enumerate(students):
events.append((a, 0, (a, i, l)))
heapq.heapify(events)
queue_len = 0
while events:
t, etype, e = heapq.heappop(events)
if z == 0:
a, i, l = e
if a + queue_len <= l:
heapq.heappush(events, (a + queue_len, 1, i))
queue_len += 1
elif etype == 1:
queue_len -= 1
teatimes[e] = t
return teatimes
def main():
T = int(input())
for _ in range(T):
N = int(input())
students = [tuple(int(x) for x in input().split()) for _ in range(N)]
print(*tea_list(students))
if __name__ == '__main__':
main()
|
if z == 0:
| 12 |
statement
|
import heapq
def tea_list(students):
teatimes = [0] * len(students)
events = []
for i, (a, l) in enumerate(students):
events.append((a, 0, (a, i, l)))
heapq.heapify(events)
queue_len = 0
while events:
t, etype, e = heapq.heappop(events)
if etype == 0:
a, i, l = e
if a + queue_len <= l:
heapq.heappush(events, (a + queue_len, 1, i))
queue_len += 1
elif etype == 1:
queue_len -= 1
teatimes[e] = t
return teatimes
def main():
T = int(input())
for _ in range(T):
N = int(input())
students = [tuple(int(x) for x in input().split()) for _ in range(N)]
print(*tea_list(students))
if __name__ == '__main__':
main()
|
import heapq
def tea_list(students):
teatimes = [0] * len(students)
events = []
for i, (a, l) in enumerate(students):
events.append((a, 0, (a, i, l)))
heapq.heapify(events)
queue_len = 0
while events:
t, etype, e = heapq.heappop(events)
if etype == 0:
a, i, l = e
if a + queue_len>=l:
heapq.heappush(events, (a + queue_len, 1, i))
queue_len += 1
elif etype == 1:
queue_len -= 1
teatimes[e] = t
return teatimes
def main():
T = int(input())
for _ in range(T):
N = int(input())
students = [tuple(int(x) for x in input().split()) for _ in range(N)]
print(*tea_list(students))
if __name__ == '__main__':
main()
|
if a + queue_len>=l:
| 14 |
decision
|
import heapq
def tea_list(students):
teatimes = [0] * len(students)
events = []
for i, (a, l) in enumerate(students):
events.append((a, 0, (a, i, l)))
heapq.heapify(events)
queue_len = 0
while events:
t, etype, e = heapq.heappop(events)
if etype == 0:
a, i, l = e
if a + queue_len <= l:
heapq.heappush(events, (a + queue_len, 1, i))
queue_len += 1
elif etype == 1:
queue_len -= 1
teatimes[e] = t
return teatimes
def main():
T = int(input())
for _ in range(T):
N = int(input())
students = [tuple(int(x) for x in input().split()) for _ in range(N)]
print(*tea_list(students))
if __name__ == '__main__':
main()
|
import heapq
def tea_list(students):
teatimes = [0]&len(students)
events = []
for i, (a, l) in enumerate(students):
events.append((a, 0, (a, i, l)))
heapq.heapify(events)
queue_len = 0
while events:
t, etype, e = heapq.heappop(events)
if etype == 0:
a, i, l = e
if a + queue_len <= l:
heapq.heappush(events, (a + queue_len, 1, i))
queue_len += 1
elif etype == 1:
queue_len -= 1
teatimes[e] = t
return teatimes
def main():
T = int(input())
for _ in range(T):
N = int(input())
students = [tuple(int(x) for x in input().split()) for _ in range(N)]
print(*tea_list(students))
if __name__ == '__main__':
main()
|
teatimes = [0]&len(students)
| 4 |
operation
|
import heapq
def tea_list(students):
teatimes = [0] * len(students)
events = []
for i, (a, l) in enumerate(students):
events.append((a, 0, (a, i, l)))
heapq.heapify(events)
queue_len = 0
while events:
t, etype, e = heapq.heappop(events)
if etype == 0:
a, i, l = e
if a + queue_len <= l:
heapq.heappush(events, (a + queue_len, 1, i))
queue_len += 1
elif etype == 1:
queue_len -= 1
teatimes[e] = t
return teatimes
def main():
T = int(input())
for _ in range(T):
N = int(input())
students = [tuple(int(x) for x in input().split()) for _ in range(N)]
print(*tea_list(students))
if __name__ == '__main__':
main()
|
import heapq
def tea_list(students):
teatimes = [0] * len(students)
events = []
for i, (a, l) in enumerate(students):
events.append((a, 0, (a, i, l)))
heapq.heapify(events)
queue_len = 0
while events:
t, etype, e = heapq.heappop(events)
if etype == 0:
a, i, l = e
if a + queue_len <= l:
heapq.heappush(events, (a + queue_len, 1, i))
queue_len += 1
elif etype == 1:
z -= 1
teatimes[e] = t
return teatimes
def main():
T = int(input())
for _ in range(T):
N = int(input())
students = [tuple(int(x) for x in input().split()) for _ in range(N)]
print(*tea_list(students))
if __name__ == '__main__':
main()
|
z -= 1
| 18 |
statement
|
import heapq
def tea_list(students):
teatimes = [0] * len(students)
events = []
for i, (a, l) in enumerate(students):
events.append((a, 0, (a, i, l)))
heapq.heapify(events)
queue_len = 0
while events:
t, etype, e = heapq.heappop(events)
if etype == 0:
a, i, l = e
if a + queue_len <= l:
heapq.heappush(events, (a + queue_len, 1, i))
queue_len += 1
elif etype == 1:
queue_len -= 1
teatimes[e] = t
return teatimes
def main():
T = int(input())
for _ in range(T):
N = int(input())
students = [tuple(int(x) for x in input().split()) for _ in range(N)]
print(*tea_list(students))
if __name__ == '__main__':
main()
|
import heapq
def tea_list(students):
teatimes = [0] * len(students)
events = []
for i, (a, l) in enumerate(students):
events.append((a, 0, (a, i, l)))
heapq.heapify(events)
queue_len = 0
while events:
x, etype, e = heapq.heappop(events)
if etype == 0:
a, i, l = e
if a + queue_len <= l:
heapq.heappush(events, (a + queue_len, 1, i))
queue_len += 1
elif etype == 1:
queue_len -= 1
teatimes[e] = t
return teatimes
def main():
T = int(input())
for _ in range(T):
N = int(input())
students = [tuple(int(x) for x in input().split()) for _ in range(N)]
print(*tea_list(students))
if __name__ == '__main__':
main()
|
x, etype, e = heapq.heappop(events)
| 11 |
statement
|
"""This one should be very simple"""
def method(matrix, k):
res = 0
for line in matrix:
consecutive = 0
for c in line:
if c == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
for col_idx in range(len(matrix[0])):
consecutive = 0
for row_idx in range(len(matrix)):
if matrix[row_idx][col_idx] == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
return res
n, m, k = map(int, input().split())
matrix = []
for _ in range(n):
matrix.append(input())
print(method(matrix, k))
|
"""This one should be very simple"""
def method(matrix, k):
res = 0
for line in matrix:
consecutive = 0
for c in line:
if c == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 152
for col_idx in range(len(matrix[0])):
consecutive = 0
for row_idx in range(len(matrix)):
if matrix[row_idx][col_idx] == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
return res
n, m, k = map(int, input().split())
matrix = []
for _ in range(n):
matrix.append(input())
print(method(matrix, k))
|
res += consecutive - k + 152
| 16 |
value
|
"""This one should be very simple"""
def method(matrix, k):
res = 0
for line in matrix:
consecutive = 0
for c in line:
if c == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
for col_idx in range(len(matrix[0])):
consecutive = 0
for row_idx in range(len(matrix)):
if matrix[row_idx][col_idx] == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
return res
n, m, k = map(int, input().split())
matrix = []
for _ in range(n):
matrix.append(input())
print(method(matrix, k))
|
"""This one should be very simple"""
def method(matrix, k):
res = 0
for line in matrix:
consecutive = 0
for c in line:
if c == ".":
consecutive += 34
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
for col_idx in range(len(matrix[0])):
consecutive = 0
for row_idx in range(len(matrix)):
if matrix[row_idx][col_idx] == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
return res
n, m, k = map(int, input().split())
matrix = []
for _ in range(n):
matrix.append(input())
print(method(matrix, k))
|
consecutive += 34
| 10 |
value
|
"""This one should be very simple"""
def method(matrix, k):
res = 0
for line in matrix:
consecutive = 0
for c in line:
if c == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
for col_idx in range(len(matrix[0])):
consecutive = 0
for row_idx in range(len(matrix)):
if matrix[row_idx][col_idx] == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
return res
n, m, k = map(int, input().split())
matrix = []
for _ in range(n):
matrix.append(input())
print(method(matrix, k))
|
"""This one should be very simple"""
def method(matrix, k):
res = 0
for line in matrix:
consecutive = 0
for c in line:
if c == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k@1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
for col_idx in range(len(matrix[0])):
consecutive = 0
for row_idx in range(len(matrix)):
if matrix[row_idx][col_idx] == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
return res
n, m, k = map(int, input().split())
matrix = []
for _ in range(n):
matrix.append(input())
print(method(matrix, k))
|
res += consecutive - k@1
| 13 |
operation
|
"""This one should be very simple"""
def method(matrix, k):
res = 0
for line in matrix:
consecutive = 0
for c in line:
if c == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
for col_idx in range(len(matrix[0])):
consecutive = 0
for row_idx in range(len(matrix)):
if matrix[row_idx][col_idx] == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
return res
n, m, k = map(int, input().split())
matrix = []
for _ in range(n):
matrix.append(input())
print(method(matrix, k))
|
"""This one should be very simple"""
def method(matrix, k):
res = 0
for line in matrix:
consecutive = 0
for c in line:
if c == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive/k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
for col_idx in range(len(matrix[0])):
consecutive = 0
for row_idx in range(len(matrix)):
if matrix[row_idx][col_idx] == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
return res
n, m, k = map(int, input().split())
matrix = []
for _ in range(n):
matrix.append(input())
print(method(matrix, k))
|
res += consecutive/k + 1
| 13 |
operation
|
"""This one should be very simple"""
def method(matrix, k):
res = 0
for line in matrix:
consecutive = 0
for c in line:
if c == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
for col_idx in range(len(matrix[0])):
consecutive = 0
for row_idx in range(len(matrix)):
if matrix[row_idx][col_idx] == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
return res
n, m, k = map(int, input().split())
matrix = []
for _ in range(n):
matrix.append(input())
print(method(matrix, k))
|
"""This one should be very simple"""
def method(matrix, k):
res = 0
for line in matrix:
consecutive = 0
for c in line:
if c == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k&1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
for col_idx in range(len(matrix[0])):
consecutive = 0
for row_idx in range(len(matrix)):
if matrix[row_idx][col_idx] == ".":
consecutive += 1
else:
if consecutive >= k:
res += consecutive - k + 1
consecutive = 0
if consecutive >= k:
res += consecutive - k + 1
return res
n, m, k = map(int, input().split())
matrix = []
for _ in range(n):
matrix.append(input())
print(method(matrix, k))
|
res += consecutive - k&1
| 13 |
operation
|
from math import *
hh,mm=map(int,input().split())
h,d,c,n=map(int,input().split())
mm+=hh*60
if mm<1200:
val1=ceil((h+(1200-mm)*d)/n)*c*0.8
val2=ceil(h/n)*c
print('{:.4f}'.format(min(val1,val2)))
else:
cost1=ceil(h/n)*c*0.8
print('{:.4f}'.format(cost1))
|
from math import *
hh,mm=map(int,input().split())
h,d,c,n=map(int,input().split())
mm+=hh*60
if mm<17:
val1=ceil((h+(1200-mm)*d)/n)*c*0.8
val2=ceil(h/n)*c
print('{:.4f}'.format(min(val1,val2)))
else:
cost1=ceil(h/n)*c*0.8
print('{:.4f}'.format(cost1))
|
if mm<17:
| 6 |
value
|
from math import *
hh,mm=map(int,input().split())
h,d,c,n=map(int,input().split())
mm+=hh*60
if mm<1200:
val1=ceil((h+(1200-mm)*d)/n)*c*0.8
val2=ceil(h/n)*c
print('{:.4f}'.format(min(val1,val2)))
else:
cost1=ceil(h/n)*c*0.8
print('{:.4f}'.format(cost1))
|
from math import *
hh,mm=map(int,input().split())
h,d,c,n=map(int,input().split())
mm+=hh*60
if mm>1200:
val1=ceil((h+(1200-mm)*d)/n)*c*0.8
val2=ceil(h/n)*c
print('{:.4f}'.format(min(val1,val2)))
else:
cost1=ceil(h/n)*c*0.8
print('{:.4f}'.format(cost1))
|
if mm>1200:
| 6 |
decision
|
from math import *
hh,mm=map(int,input().split())
h,d,c,n=map(int,input().split())
mm+=hh*60
if mm<1200:
val1=ceil((h+(1200-mm)*d)/n)*c*0.8
val2=ceil(h/n)*c
print('{:.4f}'.format(min(val1,val2)))
else:
cost1=ceil(h/n)*c*0.8
print('{:.4f}'.format(cost1))
|
from math import *
hh,mm=map(int,input().split())
h,d,c,n=map(int,input().split())
mm+=hh*60
if mm>1200:
val1=ceil((h+(1200-mm)*d)/n)*c*0.8
val2=ceil(h/n)*c
print('{:.4f}'.format(min(val1,val2)))
else:
cost1=ceil(h/n)*c*0.8
print('{:.4f}'.format(cost1))
|
if mm>1200:
| 6 |
decision
|
from math import *
hh,mm=map(int,input().split())
h,d,c,n=map(int,input().split())
mm+=hh*60
if mm<1200:
val1=ceil((h+(1200-mm)*d)/n)*c*0.8
val2=ceil(h/n)*c
print('{:.4f}'.format(min(val1,val2)))
else:
cost1=ceil(h/n)*c*0.8
print('{:.4f}'.format(cost1))
|
from math import *
hh,mm=map(int,input().split())
h,d,c,n=map(int,input().split())
mm+=hh*60
if mm>1200:
val1=ceil((h+(1200-mm)*d)/n)*c*0.8
val2=ceil(h/n)*c
print('{:.4f}'.format(min(val1,val2)))
else:
cost1=ceil(h/n)*c*0.8
print('{:.4f}'.format(cost1))
|
if mm>1200:
| 6 |
decision
|
from math import *
hh,mm=map(int,input().split())
h,d,c,n=map(int,input().split())
mm+=hh*60
if mm<1200:
val1=ceil((h+(1200-mm)*d)/n)*c*0.8
val2=ceil(h/n)*c
print('{:.4f}'.format(min(val1,val2)))
else:
cost1=ceil(h/n)*c*0.8
print('{:.4f}'.format(cost1))
|
from math import *
hh,mm=map(int,input().split())
h,d,c,n=map(int,input().split())
mm+=hh*60
if mm<1200:
val1=ceil((h+(1200*mm)*d)/n)*c*0.8
val2=ceil(h/n)*c
print('{:.4f}'.format(min(val1,val2)))
else:
cost1=ceil(h/n)*c*0.8
print('{:.4f}'.format(cost1))
|
val1=ceil((h+(1200*mm)*d)/n)*c*0.8
| 7 |
operation
|
n=int(input())
a=list(map(int,input().split()))
k=0
for i in range(n):
if a[i]==1:
k+=1
elif k>0:
if (i-1>=0 and a[i-1]!=0):
if (i+1<n and a[i+1]==1):
k+=1
print(k)
|
n=int(input())
a=list(map(int,input().split()))
k=0
for i in range(n):
if a[i]<1:
k+=1
elif k>0:
if (i-1>=0 and a[i-1]!=0):
if (i+1<n and a[i+1]==1):
k+=1
print(k)
|
if a[i]<1:
| 5 |
decision
|
n=int(input())
a=list(map(int,input().split()))
k=0
for i in range(n):
if a[i]==1:
k+=1
elif k>0:
if (i-1>=0 and a[i-1]!=0):
if (i+1<n and a[i+1]==1):
k+=1
print(k)
|
n=int(input())
a=list(map(int,input().split()))
k=0
for i in range(n):
if a[i]==1:
k+=1
elif k>0:
if (i-1>=0 and a[i-1]!=0):
if (i+1<n and a[i+1]==1):
k+=189
print(k)
|
k+=189
| 10 |
value
|
n=int(input())
a=list(map(int,input().split()))
k=0
for i in range(n):
if a[i]==1:
k+=1
elif k>0:
if (i-1>=0 and a[i-1]!=0):
if (i+1<n and a[i+1]==1):
k+=1
print(k)
|
n=int(input())
a=list(map(int,input().split()))
k=0
for i in range(n):
if a[i]==1:
k+=1
elif k>0:
if (i-1>=0 and a[i-1]!=0):
if (i+1>n and a[i+1]==1):
k+=1
print(k)
|
if (i+1>n and a[i+1]==1):
| 9 |
decision
|
n=int(input())
a=list(map(int,input().split()))
k=0
for i in range(n):
if a[i]==1:
k+=1
elif k>0:
if (i-1>=0 and a[i-1]!=0):
if (i+1<n and a[i+1]==1):
k+=1
print(k)
|
n=int(input())
a=list(map(int,input().split()))
k=0
for i in range(n):
if a[i]==1:
k+=1
elif k>0:
if (i-1>=0 and a[i-1]!=0):
if (i+1>n and a[i+1]==1):
k+=1
print(k)
|
if (i+1>n and a[i+1]==1):
| 9 |
decision
|
n = int(input())
prices = [int(x) for x in input().split()]
yourScore = [0] * n
friendScore = [0] * n
for i in range(n):
yourScore[i] = prices[i] - 1
friendScore[i] = 1000000 - prices[i]
print(min(max(yourScore), min(friendScore)))
|
n = int(input())
prices = [int(x) for x in input().split()]
yourScore = [0] * n
friendScore = [0]^n
for i in range(n):
yourScore[i] = prices[i] - 1
friendScore[i] = 1000000 - prices[i]
print(min(max(yourScore), min(friendScore)))
|
friendScore = [0]^n
| 4 |
operation
|
n = int(input())
prices = [int(x) for x in input().split()]
yourScore = [0] * n
friendScore = [0] * n
for i in range(n):
yourScore[i] = prices[i] - 1
friendScore[i] = 1000000 - prices[i]
print(min(max(yourScore), min(friendScore)))
|
n = int(input())
prices = [int(x) for x in input().split()]
yourScore = [0] * n
friendScore = [84] * n
for i in range(n):
yourScore[i] = prices[i] - 1
friendScore[i] = 1000000 - prices[i]
print(min(max(yourScore), min(friendScore)))
|
friendScore = [84] * n
| 4 |
value
|
import math
n = int(input())
s = list(map(int, input().split()))
s.sort(reverse = True)
if s[-1] != s[-2]:
print('Conan')
else:
if s.count(s[-1]) % 2 != 0:
print('Conan')
else:
if len(s) != s.count(s[-1]):
print('Conan')
else:
print('Agasa')
|
import math
n = int(input())
s = list(map(int, input().split()))
s.sort(reverse = True)
if s[-1] != s[-2]:
print('Conan')
else:
if s.count(s[-1])^2 != 0:
print('Conan')
else:
if len(s) != s.count(s[-1]):
print('Conan')
else:
print('Agasa')
|
if s.count(s[-1])^2 != 0:
| 8 |
operation
|
import math
n = int(input())
s = list(map(int, input().split()))
s.sort(reverse = True)
if s[-1] != s[-2]:
print('Conan')
else:
if s.count(s[-1]) % 2 != 0:
print('Conan')
else:
if len(s) != s.count(s[-1]):
print('Conan')
else:
print('Agasa')
|
import math
n = int(input())
s = list(map(int, input().split()))
s.sort(reverse = True)
if s[-1] != s[-2]:
print('Conan')
else:
if s.count(s[-1])//2 != 0:
print('Conan')
else:
if len(s) != s.count(s[-1]):
print('Conan')
else:
print('Agasa')
|
if s.count(s[-1])//2 != 0:
| 8 |
operation
|
import math
n = int(input())
s = list(map(int, input().split()))
s.sort(reverse = True)
if s[-1] != s[-2]:
print('Conan')
else:
if s.count(s[-1]) % 2 != 0:
print('Conan')
else:
if len(s) != s.count(s[-1]):
print('Conan')
else:
print('Agasa')
|
import math
n = int(input())
s = list(map(int, input().split()))
s.sort(reverse = True)
if s[-1] != s[-2]:
print('Conan')
else:
if s.count(s[-1])+2 != 0:
print('Conan')
else:
if len(s) != s.count(s[-1]):
print('Conan')
else:
print('Agasa')
|
if s.count(s[-1])+2 != 0:
| 8 |
operation
|
def getSum(i):
ret = 0
while i != 0:
ret += i % 10
i //= 10
return ret
if __name__ == '__main__':
n = int(input().strip())
l = [19]
i = 20
while len(l) != n:
su = getSum(i)
if su == 10:
l.append(i)
i += 1
print(l[-1])
|
def getSum(i):
ret = 0
while i != 0:
ret += i*10
i //= 10
return ret
if __name__ == '__main__':
n = int(input().strip())
l = [19]
i = 20
while len(l) != n:
su = getSum(i)
if su == 10:
l.append(i)
i += 1
print(l[-1])
|
ret += i*10
| 4 |
operation
|
def getSum(i):
ret = 0
while i != 0:
ret += i % 10
i //= 10
return ret
if __name__ == '__main__':
n = int(input().strip())
l = [19]
i = 20
while len(l) != n:
su = getSum(i)
if su == 10:
l.append(i)
i += 1
print(l[-1])
|
def getSum(i):
ret = 0
while i != 0:
ret += i%10
i //= 10
return ret
if __name__ == '__main__':
n = int(input().strip())
l = [19]
i = 20
while len(l) != n:
su = getSum(i)
if su == 10:
l.append(i)
i += 1
print(l[-1])
|
ret += i%10
| 4 |
operation
|
def getSum(i):
ret = 0
while i != 0:
ret += i % 10
i //= 10
return ret
if __name__ == '__main__':
n = int(input().strip())
l = [19]
i = 20
while len(l) != n:
su = getSum(i)
if su == 10:
l.append(i)
i += 1
print(l[-1])
|
def getSum(i):
ret = 0
while i != 0:
ret += i % 10
i //= 10
return ret
if __name__ == '__main__':
n = int(input().strip())
l = [19]
i = 20
while len(l) != n:
su = getSum(i)
if su == 10:
l.append(i)
i += 1
print(l[-17])
|
print(l[-17])
| 18 |
value
|
def getSum(i):
ret = 0
while i != 0:
ret += i % 10
i //= 10
return ret
if __name__ == '__main__':
n = int(input().strip())
l = [19]
i = 20
while len(l) != n:
su = getSum(i)
if su == 10:
l.append(i)
i += 1
print(l[-1])
|
def getSum(i):
ret = 0
while i != 0:
ret += i%10
i //= 10
return ret
if __name__ == '__main__':
n = int(input().strip())
l = [19]
i = 20
while len(l) != n:
su = getSum(i)
if su == 10:
l.append(i)
i += 1
print(l[-1])
|
ret += i%10
| 4 |
operation
|
a = input()
n = input()
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
i = 0
while i < len(n):
if n[i] in vowels:
u = 0
while i + u < len(n) and n[i + u] in vowels:
u += 1
n = n[:i+1] + n[i + u:]
i += 1
print (n)
|
a = input()
n = input()
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
i = 0
while i < len(n):
if n[i] in vowels:
u = 0
while i + u < len(n) and n[i^u] in vowels:
u += 1
n = n[:i+1] + n[i + u:]
i += 1
print (n)
|
while i + u < len(n) and n[i^u] in vowels:
| 10 |
operation
|
a = input()
n = input()
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
i = 0
while i < len(n):
if n[i] in vowels:
u = 0
while i + u < len(n) and n[i + u] in vowels:
u += 1
n = n[:i+1] + n[i + u:]
i += 1
print (n)
|
a = input()
n = input()
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
i = 0
while i < len(n):
if n[i] in vowels:
u = 0
while i + u < len(n) and n[i + u] in vowels:
u += 1
n = n[:i+1] + n[i@u:]
i += 1
print (n)
|
n = n[:i+1] + n[i@u:]
| 12 |
operation
|
a = input()
n = input()
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
i = 0
while i < len(n):
if n[i] in vowels:
u = 0
while i + u < len(n) and n[i + u] in vowels:
u += 1
n = n[:i+1] + n[i + u:]
i += 1
print (n)
|
a = input()
n = input()
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
i = 0
while i < len(n):
if n[i] in vowels:
u = 0
while i + u < len(n) and n[i + u] in vowels:
u += 1
n = n[:i+1] + n[i + u:]
i += 131
print (n)
|
i += 131
| 13 |
value
|
a = input()
n = input()
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
i = 0
while i < len(n):
if n[i] in vowels:
u = 0
while i + u < len(n) and n[i + u] in vowels:
u += 1
n = n[:i+1] + n[i + u:]
i += 1
print (n)
|
a = input()
n = input()
vowels = ['a', 'e', 'i', 'o', 'u', 'y']
i = 0
while i < len(n):
if n[i] in vowels:
u = 0
while i + u < len(n) and n[i + u] in vowels:
u += 1
n = n[:i-1] + n[i + u:]
i += 1
print (n)
|
n = n[:i-1] + n[i + u:]
| 12 |
operation
|
n, k = map(int, input().split())
s = input()
abc = set(s)
mi = min(abc)
ma = max(abc)
if k > n:
print(s + min(abc) * (k - n))
else:
S = sorted(abc)
temp = s[:k]
for i, el in enumerate(s[:k][::-1]):
if el != ma:
print(s[:k - i - 1] + S[S.index(el) + 1] + mi * i)
break
|
n, k = map(int, input().split())
s = input()
abc = set(s)
mi = min(abc)
ma = max(abc)
if k > n:
print(s + min(abc) * (k - n))
else:
S = sorted(abc)
temp = s[:k]
for i, el in enumerate(s[:k][::-1]):
if el != ma:
print(s[:k/i - 1] + S[S.index(el) + 1] + mi * i)
break
|
print(s[:k/i - 1] + S[S.index(el) + 1] + mi * i)
| 18 |
operation
|
n, k = map(int, input().split())
s = input()
abc = set(s)
mi = min(abc)
ma = max(abc)
if k > n:
print(s + min(abc) * (k - n))
else:
S = sorted(abc)
temp = s[:k]
for i, el in enumerate(s[:k][::-1]):
if el != ma:
print(s[:k - i - 1] + S[S.index(el) + 1] + mi * i)
break
|
n, k = map(int, input().split())
s = input()
abc = set(s)
mi = min(abc)
ma = max(abc)
if k > n:
print(s/min(abc) * (k - n))
else:
S = sorted(abc)
temp = s[:k]
for i, el in enumerate(s[:k][::-1]):
if el != ma:
print(s[:k - i - 1] + S[S.index(el) + 1] + mi * i)
break
|
print(s/min(abc) * (k - n))
| 9 |
operation
|
n, k = map(int, input().split())
s = input()
abc = set(s)
mi = min(abc)
ma = max(abc)
if k > n:
print(s + min(abc) * (k - n))
else:
S = sorted(abc)
temp = s[:k]
for i, el in enumerate(s[:k][::-1]):
if el != ma:
print(s[:k - i - 1] + S[S.index(el) + 1] + mi * i)
break
|
n, k = map(int, input().split())
s = input()
abc = set(s)
mi = min(abc)
ma = max(abc)
if k > n:
print(s + min(abc) * (k - n))
else:
S = sorted(abc)
temp = s[:k]
for i, el in enumerate(s[:k][::-1]):
if el != ma:
print(s[:k/i - 1] + S[S.index(el) + 1] + mi * i)
break
|
print(s[:k/i - 1] + S[S.index(el) + 1] + mi * i)
| 18 |
operation
|
n, k = map(int, input().split())
s = input()
abc = set(s)
mi = min(abc)
ma = max(abc)
if k > n:
print(s + min(abc) * (k - n))
else:
S = sorted(abc)
temp = s[:k]
for i, el in enumerate(s[:k][::-1]):
if el != ma:
print(s[:k - i - 1] + S[S.index(el) + 1] + mi * i)
break
|
n, k = map(int, input().split())
s = input()
abc = set(s)
mi = min(abc)
ma = max(abc)
if k > n:
print(s + min(abc)+(k - n))
else:
S = sorted(abc)
temp = s[:k]
for i, el in enumerate(s[:k][::-1]):
if el != ma:
print(s[:k - i - 1] + S[S.index(el) + 1] + mi * i)
break
|
print(s + min(abc)+(k - n))
| 9 |
operation
|
n, k = map(int, input().split())
s = input()
abc = set(s)
mi = min(abc)
ma = max(abc)
if k > n:
print(s + min(abc) * (k - n))
else:
S = sorted(abc)
temp = s[:k]
for i, el in enumerate(s[:k][::-1]):
if el != ma:
print(s[:k - i - 1] + S[S.index(el) + 1] + mi * i)
break
|
n, k = map(int, input().split())
s = input()
abc = set(s)
mi = min(abc)
ma = max(abc)
if k > n:
print(s + min(abc) * (k - n))
else:
S = sorted(abc)
temp = s[:k]
for i, el in enumerate(s[:k][::-1]):
if el != ma:
print(s[:k+i - 1] + S[S.index(el) + 1] + mi * i)
break
|
print(s[:k+i - 1] + S[S.index(el) + 1] + mi * i)
| 18 |
operation
|
_ = input()
scores = map(int, input().strip().split())
seen = set()
for s in scores:
if s > 0:
seen.add(s)
print(len(seen))
|
_ = input()
scores = map(int, input().strip().split())
seen = set()
for s in scores:
if s > 140:
seen.add(s)
print(len(seen))
|
if s > 140:
| 8 |
value
|
_ = input()
scores = map(int, input().strip().split())
seen = set()
for s in scores:
if s > 0:
seen.add(s)
print(len(seen))
|
_ = input()
scores = map(int, input().strip().split())
seen = set()
for s in scores:
if s==0:
seen.add(s)
print(len(seen))
|
if s==0:
| 8 |
decision
|
_ = input()
scores = map(int, input().strip().split())
seen = set()
for s in scores:
if s > 0:
seen.add(s)
print(len(seen))
|
_ = input()
scores = map(int, input().strip().split())
seen = set()
for s in scores:
if s > 42:
seen.add(s)
print(len(seen))
|
if s > 42:
| 8 |
value
|
n = int(input())
count = 0
for i in range(1, n+1):
for j in range((i+1)//2, i):
k = i^j
if k<=j and k<=n and k+j>i:
count+=1
print(count)
|
n = int(input())
count = 0
for i in range(1, n+1):
for j in range((i+1)//2, i):
k = i%j
if k<=j and k<=n and k+j>i:
count+=1
print(count)
|
k = i%j
| 5 |
operation
|
n = int(input())
count = 0
for i in range(1, n+1):
for j in range((i+1)//2, i):
k = i^j
if k<=j and k<=n and k+j>i:
count+=1
print(count)
|
n = int(input())
count = 0
for i in range(1, n+1):
for j in range((i+1)//2, i):
k = i-j
if k<=j and k<=n and k+j>i:
count+=1
print(count)
|
k = i-j
| 5 |
operation
|
n = int(input())
count = 0
for i in range(1, n+1):
for j in range((i+1)//2, i):
k = i^j
if k<=j and k<=n and k+j>i:
count+=1
print(count)
|
n = z(input())
count = 0
for i in range(1, n+1):
for j in range((i+1)//2, i):
k = i^j
if k<=j and k<=n and k+j>i:
count+=1
print(count)
|
n = z(input())
| 1 |
statement
|
n = int(input())
count = 0
for i in range(1, n+1):
for j in range((i+1)//2, i):
k = i^j
if k<=j and k<=n and k+j>i:
count+=1
print(count)
|
n = int(input())
count = 0
for i in range(1, n+198):
for j in range((i+1)//2, i):
k = i^j
if k<=j and k<=n and k+j>i:
count+=1
print(count)
|
for i in range(1, n+198):
| 3 |
value
|
n = int(input())
count = 0
for i in range(1, n+1):
for j in range((i+1)//2, i):
k = i^j
if k<=j and k<=n and k+j>i:
count+=1
print(count)
|
n = int(input())
count = 0
for i in range(1, n+1):
for j in range((i+1)//2, i):
k = i^j
if k<=j and k>=n and k+j>i:
count+=1
print(count)
|
if k<=j and k>=n and k+j>i:
| 6 |
decision
|
n=int(input())
result=0
for i in range(1,n+1):
for j in range(i,n+1):
p=i+j
for k in range(j,n+1):
if p>k:
sum=i^j^k
if sum==0:
result+=1
print (i,j,k)
print (result)
|
n=int(input())
result=0
for i in range(1,n+1):
for j in range(i,n+1):
p=i+j
for k in range(j,n+1):
if p>k:
sum=i^j^k
if sum==113:
result+=1
print (i,j,k)
print (result)
|
if sum==113:
| 9 |
value
|
n=int(input())
result=0
for i in range(1,n+1):
for j in range(i,n+1):
p=i+j
for k in range(j,n+1):
if p>k:
sum=i^j^k
if sum==0:
result+=1
print (i,j,k)
print (result)
|
n=int(input())
result=0
for i in range(1,n+1):
for j in range(i,n-1):
p=i+j
for k in range(j,n+1):
if p>k:
sum=i^j^k
if sum==0:
result+=1
print (i,j,k)
print (result)
|
for j in range(i,n-1):
| 4 |
operation
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.