problem_id
stringlengths 6
6
| buggy_code
stringlengths 8
526k
| fixed_code
stringlengths 12
526k
| labels
listlengths 0
15
⌀ | buggy_submission_id
int64 1
1.54M
| fixed_submission_id
int64 2
1.54M
| user_id
stringlengths 10
10
| language
stringclasses 8
values |
|---|---|---|---|---|---|---|---|
p02823
|
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from math import gcd
def debug(*args):
if debugmode:
print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = True
n, a, b = MAP()
if (a - b) % 2 == 0:
print(abs(a - b) // 2)
exit()
print(abs(a - b) + min(min(a, b) - 1, n - max(a, b)))
|
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from math import gcd
def debug(*args):
if debugmode:
print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = True
n, a, b = MAP()
if (a - b) % 2 == 0:
print(abs(a - b) // 2)
exit()
print(abs(a - b) // 2 + min(min(a, b) - 1, n - max(a, b)) + 1)
|
[
"expression.operation.binary.add"
] | 627,118
| 627,119
|
u287500079
|
python
|
p02823
|
N, A, B = map(int, input().split())
if A % 2 == B % 2:
print((B - A) // 2)
elif B - A == 1:
print(min(B - 1, N - A))
else:
a = ((B - (A - 1) - 1) - 1) // 2 + (A - 1)
b = (N - (A + (N - B) + 1)) // 2 + (N - B)
#print(a)
#print(b)
print(min(a, b))
|
N, A, B = map(int, input().split())
if A % 2 == B % 2:
print((B - A) // 2)
elif B - A == 1:
print(min(B - 1, N - A))
else:
a = ((B - (A - 1) - 1) - 1) // 2 + (A - 1) + 1
b = (N - (A + (N - B) + 1)) // 2 + (N - B) + 1
#print(a)
#print(b)
print(min(a, b))
|
[
"assignment.change"
] | 627,135
| 627,136
|
u151005508
|
python
|
p02823
|
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
n,a,b=map(int,input().split())
if (b-a)%2==0:print((b-a)//2)
else:print(min((b-a+1)//2,(2*n-b+1-a)//2))
if __name__=='__main__':
main()
|
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
n,a,b=map(int,input().split())
if (b-a)%2==0:print((b-a)//2)
else:print(min((b+a-1)//2,(2*n-b+1-a)//2))
if __name__=='__main__':
main()
|
[
"expression.operation.binary.remove"
] | 627,139
| 627,140
|
u810356688
|
python
|
p02823
|
n, a, b = map(int, input().split())
if (b-a)%2==0:
print((b-a)//2)
else:
print(min(n-b+(n-a)//2,a+(b-a)//2))
|
n, a, b = map(int, input().split())
if (b-a)%2==0:
print((b-a)//2)
else:
print(min(n-b+1+(b-a-1)//2,a+(b-a)//2))
|
[
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,141
| 627,142
|
u413165887
|
python
|
p02823
|
N, A, B = map(int, input().split())
diff = abs(A-B)
if diff%2 == 0:
print(diff//2)
else:
print(min(A, B, N-A, N-B)+diff//2)
|
N, A, B = map(int, input().split())
diff = abs(A-B)
if diff%2 == 0:
print(diff//2)
else:
print(min(A-1, B-1, N-A, N-B) + 1 + diff // 2)
|
[
"expression.operation.binary.add"
] | 627,158
| 627,159
|
u707498674
|
python
|
p02823
|
n,a,b = map(int, input().split())
if (b-a)%2 == 0:
print(((b-a)//2))
else:
print(min(a-1,n-b)+1+(b-a-1//2))
|
n,a,b = map(int, input().split())
if (b-a)%2 == 0:
print(((b-a)//2))
else:
print(min(a-1,n-b)+1+((b-a-1)//2))
|
[
"call.arguments.change"
] | 627,160
| 627,161
|
u394731058
|
python
|
p02823
|
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
return list(map(int,input().split()))
def m(): #複数文字
return map(int,input().split())
def onem(): #Nとかの取得
return int(input())
def s(x): #圧縮
a = []
if len(x) == 0:
return []
aa = x[0]
su = 1
for i in range(len(x)-1):
if aa != x[i+1]:
a.append([aa,su])
aa = x[i+1]
su = 1
else:
su += 1
a.append([aa,su])
return a
def jo(x): #listをスペースごとに分ける
return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
return max(map(max,x))
def In(x,a): #aがリスト(sorted)
k = bs.bisect_left(a,x)
if k != len(a) and a[k] == x:
return True
else:
return False
def pow_k(x, n):
ans = 1
while n:
if n % 2:
ans *= x
x *= x
n >>= 1
return ans
"""
def nibu(x,n,r):
ll = 0
rr = r
while True:
mid = (ll+rr)//2
if rr == mid:
return ll
if (ここに評価入れる):
rr = mid
else:
ll = mid+1
"""
n,a,b = m()
if (a + b) % 2 == 0:
print(abs(a-b)//2)
else:
print(min((a+b)//2,(n+(n-b) - a)//2 ))
|
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
return list(map(int,input().split()))
def m(): #複数文字
return map(int,input().split())
def onem(): #Nとかの取得
return int(input())
def s(x): #圧縮
a = []
if len(x) == 0:
return []
aa = x[0]
su = 1
for i in range(len(x)-1):
if aa != x[i+1]:
a.append([aa,su])
aa = x[i+1]
su = 1
else:
su += 1
a.append([aa,su])
return a
def jo(x): #listをスペースごとに分ける
return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
return max(map(max,x))
def In(x,a): #aがリスト(sorted)
k = bs.bisect_left(a,x)
if k != len(a) and a[k] == x:
return True
else:
return False
def pow_k(x, n):
ans = 1
while n:
if n % 2:
ans *= x
x *= x
n >>= 1
return ans
"""
def nibu(x,n,r):
ll = 0
rr = r
while True:
mid = (ll+rr)//2
if rr == mid:
return ll
if (ここに評価入れる):
rr = mid
else:
ll = mid+1
"""
n,a,b = m()
if (a + b) % 2 == 0:
print(abs(a-b)//2)
else:
print(min((a+b)//2,(n+(n-b+1) - a)//2))
|
[
"expression.operation.binary.add"
] | 627,175
| 627,176
|
u807772568
|
python
|
p02823
|
n,a,b = map(int,input().split())
if (b-a)%2==0:
print((b-a)//2)
else:
ret1 = a+(b-a+1)//2
ret2 = n-b+1+(b-a-1)//2
print(min(ret1, ret2))
|
n,a,b = map(int,input().split())
if (b-a)%2==0:
print((b-a)//2)
else:
ret1 = a+(b-a-1)//2
ret2 = n-b+1+(b-a-1)//2
print(min(ret1, ret2))
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 627,184
| 627,185
|
u672475305
|
python
|
p02823
|
# Function for calc
def match(n, a, b):
if (b - a)% 2 == 0:
print((b-a)/2)
else:
if (n - b) > a:
print((a)+((b-(a+1))/2))
else:
x=(n-b+1)
print(x+((n-(a+x))/2))
# Run match
in_string = input()
#print(in_string)
[N, A, B] = [int(v) for v in in_string.split()]
#N = int(in_string[0])
#A = int(in_string[1])
#B = int(in_string[2])
#print(N)
#print(A)
#print(B)
match(N, A, B)
|
# Function for calc
def match(n, a, b):
if (b - a)% 2 == 0:
print((b-a)/2)
else:
if (n - b) >= a:
print((a)+((b-(a+1))/2))
else:
x=(n-b+1)
print(x+((n-(a+x))/2))
# Run match
in_string = input()
[N, A, B] = [int(v) for v in in_string.split()]
match(N, A, B)
|
[
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 627,197
| 627,198
|
u065785471
|
python
|
p02823
|
def min_steps_v2(n, a, b):
n = np.int64(n)
a = np.int64(a)
b = np.int64(b)
if (b - a) % 2 == 0:
return np.int64(int(b - a) // 2)
# odd case
a_diff = a - 1
b_diff = n - b
if a_diff > b_diff:
steps_to_even = n - b + 1
remain_steps = min_steps_v2(n, a + (n - b) + 1, n)
else:
steps_to_even = a
remain_steps = min_steps_v2(n, 1, b - a)
return steps_to_even + remain_steps
numbers = input().split(' ')
n = int(numbers[0])
a = int(numbers[1])
b = int(numbers[2])
print(min_steps_v2(n, a, b))
|
import numpy as np
def min_steps_v2(n, a, b):
n = np.int64(n)
a = np.int64(a)
b = np.int64(b)
if (b - a) % 2 == 0:
return np.int64(int(b - a) // 2)
# odd case
a_diff = a - 1
b_diff = n - b
if a_diff > b_diff:
steps_to_even = n - b + 1
remain_steps = min_steps_v2(n, a + (n - b) + 1, n)
else:
steps_to_even = a
remain_steps = min_steps_v2(n, 1, b - a)
return steps_to_even + remain_steps
numbers = input().split(' ')
n = int(numbers[0])
a = int(numbers[1])
b = int(numbers[2])
print(min_steps_v2(n, a, b))
|
[] | 627,205
| 627,206
|
u312658812
|
python
|
p02823
|
N, A, B = map(int, input().split())
d = B-A
if d%2 == 1:
d = min((B + (N-B)*2 + 1) - A, B - (1 - (A-1)*2 -1))
ans = d//2
print(ans)
|
N, A, B = map(int, input().split())
d = B-A
if d%2 == 1:
d = min((B + (N-B)*2 + 1) - A, B - (A - (A-1)*2 - 1))
ans = d//2
print(ans)
|
[
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"expression.operation.binary.change"
] | 627,216
| 627,217
|
u316341119
|
python
|
p02823
|
N, A, B = map(int, input().split())
Abs = B - A
if Abs % 2 == 0:
ans = Abs // 2
else:
a, b = A-1, N-B
if a < b:
ans, B = a+1, B-(a+1)
ans += (B-1) // 2
else:
ans, A = b+1, A-(b+1)
ans += (N-A) // 2
print(ans)
|
N, A, B = map(int, input().split())
Abs = B - A
if Abs % 2 == 0:
ans = Abs // 2
else:
a, b = A-1, N-B
if a < b:
ans, B = a+1, B-(a+1)
ans += (B-1) // 2
else:
ans, A = b+1, A+(b+1)
ans += (N-A) // 2
print(ans)
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 627,231
| 627,232
|
u432098488
|
python
|
p02823
|
def main():
N, A, B = map(int, input().split())
if A % 2 == B % 2:
return abs(A - B)//2
else:
x = A + 1 + (B - A - 1)//2
y = (N - B + 1) + (- A + B + 1)//2
return min(x, y)
print(main())
|
def main():
N, A, B = map(int, input().split())
if A % 2 == B % 2:
return abs(A - B)//2
else:
x = A + (B - A - 1)//2
y = (N - B) + (- A + B + 1)//2
return min(x, y)
print(main())
|
[
"expression.operation.binary.remove"
] | 627,243
| 627,244
|
u316464887
|
python
|
p02823
|
def main():
N, A, B = map(int, input().split())
if A % 2 == B % 2:
return abs(A - B)//2
else:
x = A + (B - A - 1)//2
y = (N - B + 1) + (- A + B + 1)//2
return min(x, y)
print(main())
|
def main():
N, A, B = map(int, input().split())
if A % 2 == B % 2:
return abs(A - B)//2
else:
x = A + (B - A - 1)//2
y = (N - B) + (- A + B + 1)//2
return min(x, y)
print(main())
|
[
"expression.operation.binary.remove"
] | 627,245
| 627,244
|
u316464887
|
python
|
p02823
|
N, A, B = map(int, input().split())
number = abs(B - A)
if number % 2 == 0:
print(number // 2)
else:
answer_1 = ((N - A) + (N - B) * 2 + 1) // 2
answer_2 = ((A - 1) * 2 + (B - 1) + 1) // 2
print(min(answer_1, answer_2))
|
N, A, B = map(int, input().split())
number = abs(B - A)
if number % 2 == 0:
print(number // 2)
else:
answer_1 = ((N - A) + (N - B) + 1) // 2
answer_2 = ((A - 1) + (B - 1) + 1) // 2
print(min(answer_1, answer_2))
|
[
"expression.operation.binary.remove"
] | 627,277
| 627,278
|
u977193988
|
python
|
p02823
|
from decimal import *
def resolve():
tn,ta, tb = map(int, input().split())
n=Decimal(tn)
a=Decimal(ta)
b=Decimal(tb)
if (b-a)%2 == 1:
ans=min(a-1,n-b)+1+(b-a-1)/2
else:
ans=(b-a)/2
print(int(ans))
|
from decimal import *
def resolve():
tn,ta, tb = map(int, input().split())
n=Decimal(tn)
a=Decimal(ta)
b=Decimal(tb)
if (b-a)%2 == 1:
ans=min(a-1,n-b)+1+(b-a-1)/2
else:
ans=(b-a)/2
print(int(ans))
resolve()
|
[
"call.add"
] | 627,293
| 627,294
|
u617103038
|
python
|
p02823
|
n,a,b=map(int,input().split())
if abs(a-b)%2==0:
print(abs(a-b)//2)
else:
if n-b>a-1:
print(a+(b-a-1)//2)
else:
print(n-b+1(b-a-1)//2)
|
n,a,b=map(int,input().split())
if abs(a-b)%2==0:
print(abs(a-b)//2)
else:
if n-b>a-1:
print(a+(b-a-1)//2)
else:
print(n-b+1+(b-a-1)//2)
|
[
"call.arguments.change"
] | 627,298
| 627,299
|
u239653493
|
python
|
p02823
|
n,a,b=map(int,input().split())
c=min(a,b)
d=max(a,b)
e=min(2*n-a-b,a+b-2)
f=min(c-1,n-d)
if d-c==1:
print(f+1)
elif d-c%2==0:
print((d-c)//2)
else:
print((e+1)//2)
|
n,a,b=map(int,input().split())
c=min(a,b)
d=max(a,b)
e=min(2*n-a-b,a+b-2)
f=min(c-1,n-d)
if d-c==1:
print(f+1)
elif (d-c)%2==0:
print((d-c)//2)
else:
print((e+1)//2)
|
[
"control_flow.branch.if.condition.change"
] | 627,310
| 627,311
|
u588558668
|
python
|
p02823
|
n,a,b = map(int,input().split())
if (a+b)%2==0:
print(diff//2)
else:
print(min(a-1,n-b)+1+(b-a-1)//2)
|
n,a,b = map(int,input().split())
diff = abs(a-b)
if diff%2==0:
print(diff//2)
else:
print(min(a-1,n-b)+1+(b-a-1)//2)
|
[
"assignment.variable.change",
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"control_flow.branch.if.condition.change",
"control_flow.branch.if.add"
] | 627,315
| 627,316
|
u706433263
|
python
|
p02823
|
N,A,B= map(int,input().split())
if (B-A)%2 == 0:
print((B-A)//2)
else:
print(min(A,N-B)+1+(B-A-1)//2)
|
N,A,B= map(int,input().split())
if (B-A)%2 == 0:
print((B-A)//2)
else:
print(min(A-1,N-B)+1+(B-A-1)//2)
|
[
"expression.operation.binary.add"
] | 627,327
| 627,328
|
u371132735
|
python
|
p02823
|
N,A,B= map(int,input().split())
if (B-A)%2 == 0:
print((B-A)//2)
else:
print(min(A,B-N)+1+(B-A-1)//2)
|
N,A,B= map(int,input().split())
if (B-A)%2 == 0:
print((B-A)//2)
else:
print(min(A-1,N-B)+1+(B-A-1)//2)
|
[
"call.arguments.change",
"call.arguments.add"
] | 627,329
| 627,328
|
u371132735
|
python
|
p02823
|
n, a, b = map(int, input().split())
if (a - b) % 2 == 0:
print((a - b)//2)
exit()
if a > b:
a, b = b, a
print(min(a + (b-a-1)//2, n - b + 1 + (n - (a + (n - b + 1)))//2))
|
n, a, b = map(int, input().split())
if (a - b) % 2 == 0:
print(abs((a - b)//2))
exit()
if a > b:
a, b = b, a
print(min(a + (b-a-1)//2, n - b + 1 + (n - (a + (n - b + 1)))//2))
|
[
"call.arguments.add",
"call.arguments.change"
] | 627,342
| 627,343
|
u955251526
|
python
|
p02823
|
import math
N,A,B = map(int,input().split())
if (A + B)%2 == 0:
print(abs(A - B)//2)
else:
print(min(A-1,N-B)+abs(A-B+1)//2)
|
N,A,B = map(int,input().split())
if (A + B)%2 == 0:
print(abs(A - B)//2)
else:
print(min(A-1,N-B)+1+abs(A-B+1)//2)
|
[
"expression.operation.binary.add"
] | 627,350
| 627,351
|
u278886389
|
python
|
p02823
|
N, A, B = map(int, input().split())
if (B-A) % 2 == 0:
print( (B-A) // 2 )
else:
min([1+N-B+(B-A)//2, A+(B-A)//2])
|
N, A, B = map(int, input().split())
if (B-A) % 2 == 0:
print( (B-A) // 2 )
else:
print(min([1+N-B+(B-A)//2, A+(B-A)//2]))
|
[
"call.add",
"call.arguments.change"
] | 627,364
| 627,365
|
u137913818
|
python
|
p02823
|
n, a, b = list(map(int, input().split()))
if (a-b) % 2 == 0:
print(abs(a-b)//2)
else:
x = ((a-1) + (b-1) + 1)//2
y = ((n-1) + (n-b) + 1)//2
print(min(x, y))
|
n, a, b = list(map(int, input().split()))
if (a-b) % 2 == 0:
print(abs(a-b)//2)
else:
x = ((a-1) + (b-1) + 1)//2
y = ((n-a) + (n-b) + 1)//2
print(min(x, y))
|
[
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"expression.operation.binary.change"
] | 627,393
| 627,394
|
u162612857
|
python
|
p02823
|
n, a, b = list(map(int, input().split()))
if (a-b) % 2 == 0:
print(abs(a-b)/2)
else:
x = ((a-1) + (b-1) + 1)/2
y = ((n-1) + (n-b) + 1)/2
print(min(x, y))
|
n, a, b = list(map(int, input().split()))
if (a-b) % 2 == 0:
print(abs(a-b)//2)
else:
x = ((a-1) + (b-1) + 1)//2
y = ((n-a) + (n-b) + 1)//2
print(min(x, y))
|
[
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change",
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove"
] | 627,395
| 627,394
|
u162612857
|
python
|
p02823
|
n, a, b = list(map(int, input().split()))
k = b - a
if k % 2 == 1:
print(min(a-1, n-b)+1+(z-1)//2)
else:
print(z//2)
|
n, a, b = list(map(int, input().split()))
k = b - a
if k % 2 == 1:
print(min(a-1, n-b)+1+(k-1)//2)
else:
print(k//2)
|
[
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,398
| 627,399
|
u929585607
|
python
|
p02823
|
n,a,b=map(int,input().split())
if (b-a)%2==0:
print((b-a)//2)
else:
print(min(a-1,n-B)+1+(b-a-1)//2)
|
n,a,b=map(int,input().split())
if (b-a)%2==0:
print((b-a)//2)
else:
print(min(a-1,n-b)+1+(b-a-1)//2)
|
[
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,422
| 627,423
|
u723583932
|
python
|
p02823
|
N, A, B = map(int, input().split())
if abs(A-B) % 2 == 0:
print(abs(A-B)//2)
else:
top = (B-A-1)//2 + A-1
low = (B-A-1)//2+N-B
print(min(top, low))
|
N, A, B = map(int, input().split())
if abs(A-B) % 2 == 0:
print(abs(A-B)//2)
else:
top = (B-A-1)//2 + A-1
low = (B-A-1)//2+N-B
print(min(top, low)+1)
|
[
"expression.operation.binary.add"
] | 627,462
| 627,463
|
u375616706
|
python
|
p02823
|
N, A, B = map(int, input().split())
dis = B - A
if dis % 2 == 0:
print(dis // 2)
else:
A_end = A - 1
B_end = N - B
if A_end <= B_end:
ans = A_end
A = 1
B -= A_end
ans += 1
print(ans + (B - A) // 2)
else:
ans = B_end
B = N
A -= B_end
ans += 1
print(ans + (B - A) // 2)
|
N, A, B = map(int, input().split())
dis = B - A
if dis % 2 == 0:
print(dis // 2)
else:
A_end = A - 1
B_end = N - B
if A_end <= B_end:
ans = A_end
A = 1
B -= A_end
ans += 1
print(ans + (B - A) // 2)
else:
ans = B_end
B = N
A += B_end
ans += 1
print(ans + (B - A) // 2)
|
[
"expression.operator.change"
] | 627,470
| 627,471
|
u762420987
|
python
|
p02823
|
n,a,b = map(int,input().split())
diff = abs(a-b)
if diff%2==0:
print(diff//2)
else :
print(min(A - 1, N - B) + 1 + diff // 2)
|
n,a,b = map(int,input().split())
diff = abs(a-b)
if diff%2==0:
print(diff//2)
else :
print(min(a - 1, n - b) + 1 + diff // 2)
|
[
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,475
| 627,474
|
u020962106
|
python
|
p02823
|
N, A, B = tuple(map(int, input().split()))
if (B - A) % 2 == 0:
print((B - A) // 2)
else:
print(min(B - 1, N - A) + 1 + (B - A - 1) // 2)
|
N, A, B = tuple(map(int, input().split()))
if (B - A) % 2 == 0:
print((B - A) // 2)
else:
print(min(A - 1, N - B) + 1 + (B - A - 1) // 2)
|
[
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,500
| 627,501
|
u291766461
|
python
|
p02823
|
n,a,b = [int(i) for i in input().split()]
if (b - a)%2:
print((b-a)//2 + 1 + min(a-1,b-1))
else:
print((b-a)//2)
|
n,a,b = [int(i) for i in input().split()]
if (b - a)%2:
print((b-a)//2 + 1 + min(a-1,n-b))
else:
print((b-a)//2)
|
[
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change",
"identifier.replace.add",
"literal.replace.remove"
] | 627,517
| 627,518
|
u183840468
|
python
|
p02823
|
n,a,b = [int(i) for i in input().split()]
if (b - a)%2:
print((b-a-1)//2 + 1 + min(a-1,b-1))
else:
print((b-a)//2)
|
n,a,b = [int(i) for i in input().split()]
if (b - a)%2:
print((b-a)//2 + 1 + min(a-1,n-b))
else:
print((b-a)//2)
|
[
"expression.operation.binary.remove",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change",
"identifier.replace.add",
"literal.replace.remove"
] | 627,519
| 627,518
|
u183840468
|
python
|
p02823
|
n, a, b = map(int ,input().split())
if (b-a) % 2 == 0:
ans = (b-a) // 2
else:
ans_2_1 = b-1
ans_2_2 = n-a
if b-a == 1:
ans = min(ans_2_1, ans_2_2)
else:
ans_3_1 = (a-1) + (b-a+1-1-1)//2
ans_3_2 = (n-b) + (n-(a+n-b+1))//2
ans = min(ans_2_1,ans_2_2,ans_3_1,ans_3_2)
print(ans)
|
n, a, b = map(int ,input().split())
if (b-a) % 2 == 0:
ans = (b-a) // 2
else:
ans_2_1 = b-1
ans_2_2 = n-a
if b-a == 1:
ans = min(ans_2_1, ans_2_2)
else:
ans_3_1 = (a-1) + 1 + (b-a+1-1-1)//2
ans_3_2 = (n-b) + 1 + (n-(a+n-b+1))//2
ans = min(ans_2_1,ans_2_2,ans_3_1,ans_3_2)
print(ans)
|
[
"assignment.change"
] | 627,541
| 627,542
|
u314050667
|
python
|
p02823
|
n,a,b = map(int,input().split())
if b-a % 2 == 0:
print((b-a)//2)
else:
print(min(a-1,n-b)+1+(b-a-1)//2)
|
n,a,b = map(int,input().split())
if (b-a) % 2 == 0:
print((b-a)//2)
else:
print(min(a-1,n-b)+1+(b-a-1)//2)
|
[
"control_flow.branch.if.condition.change"
] | 627,576
| 627,577
|
u204842730
|
python
|
p02823
|
n,a,b = map(int,input().split())
if not b-a % 2:
print((b-a)//2)
else:
print(min(a-1,n-b)+1+(b-a-1)//2)
|
n,a,b = map(int,input().split())
if (b-a) % 2 == 0:
print((b-a)//2)
else:
print(min(a-1,n-b)+1+(b-a-1)//2)
|
[
"control_flow.branch.if.condition.change"
] | 627,578
| 627,577
|
u204842730
|
python
|
p02823
|
n, a, b = map(int, input().split())
if (a - b) % 2 == 0:
print(abs(a - b) // 2)
else:
print(min(a,b,n-a-1,n-b-1)+1+(abs(a-b)-1)//2)
|
n, a, b = map(int, input().split())
if (a - b) % 2 == 0:
print(abs(a - b) // 2)
else:
print(min(a,b,n-a+1,n-b+1)+(abs(a-b)-1)//2)
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,584
| 627,585
|
u150423122
|
python
|
p02823
|
n,a,b = map(int, input().split())
l = max(a,b)
s = min(a,b)
if (l-s)%2 == 0:
print((l-s)//2)
else:
t = s - 1
b = n - l
pre = min(t-b)
ans = pre + 1 + (l-s-1)//2
print(ans)
|
n,a,b = map(int, input().split())
l = max(a,b)
s = min(a,b)
if (l-s)%2 == 0:
print((l-s)//2)
else:
t = s - 1
b = n - l
pre = min(t,b)
ans = pre + 1 + (l-s-1)//2
print(ans)
|
[
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 627,598
| 627,599
|
u353402627
|
python
|
p02823
|
N,A,B = map(int,input.split())
ans = 0
if (B-A)%2 == 0:
print(int((B-A)//2))
else:
print(min(A-1,N-B)+1+int((B-A-1)//2))
|
N,A,B = map(int,input().split())
ans = 0
if (B-A)%2 == 0:
print(int((B-A)//2))
else:
print(min(A-1,N-B)+1+int((B-A-1)//2))
|
[
"call.add"
] | 627,612
| 627,613
|
u780147002
|
python
|
p02823
|
n, a, b = map(int, input().split())
if (a - b) % 2 == 0:
print(abs(a - b) // 2)
else:
print(min((n - a + n - b + 1) // 2, (a - 1 + b - 1) // 2))
|
n, a, b = map(int, input().split())
if (a - b) % 2 == 0:
print(abs(a - b) // 2)
else:
print(min((n - a + n - b + 1) // 2, (a - 1 + b - 1 + 1) // 2))
|
[
"expression.operation.binary.add"
] | 627,626
| 627,627
|
u902576227
|
python
|
p02823
|
n,a,b=map(int,input().split())
if (a-b)%2==0:
print(abs(a-b)//2)
else:
if (a+b)/2<=n//2:
if abs(a-b)==1:
print(min(a,b)-1+1)
else:
print(min(a,b)-1+1+(abs(a-b)-1)//2)
else:
if abs(a-b)==1:
print(n-max(a,b)+1)
else:
print(n-max(a,b)+1+(abs(a-b)-1)//2)
|
n,a,b=map(int,input().split())
if (a-b)%2==0:
print(abs(a-b)//2)
else:
if (a+b)//2<=n//2:
if abs(a-b)==1:
print(min(a,b)-1+1)
else:
print(min(a,b)-1+1+(abs(a-b)-1)//2)
else:
if abs(a-b)==1:
print(n-max(a,b)+1)
else:
print(n-max(a,b)+1+(abs(a-b)-1)//2)
|
[
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change"
] | 627,641
| 627,640
|
u469953228
|
python
|
p02823
|
N, A, B = [int(n) for n in input().split()]
if (B-A)%2==0:
print((B-A)//2)
else:
if (A-1) < (N-B):
print(A+(B-A)//2)
else:
print((N-B)+(B-A)//2)
|
N, A, B = [int(n) for n in input().split()]
if (B-A)%2==0:
print((B-A)//2)
else:
if (A-1) < (N-B):
print(A+(B-A)//2)
else:
print((N-B+1)+(B-A)//2)
|
[
"expression.operation.binary.add"
] | 627,652
| 627,653
|
u761087127
|
python
|
p02823
|
n, a, b = map(int, input().split())
if (b - a) % 2 == 0:
print(int(abs(a - b)/2), 'faeag')
elif (b - a) % 2 == 1:
print(int(min([a, n - b + 1]) + (b - a - 1)//2))
|
n, a, b = map(int, input().split())
if (b - a) % 2 == 0:
print(int(abs(a - b)//2))
elif (b - a) % 2 == 1:
print(int(min([a, n - b + 1]) + (b - a - 1)//2))
|
[
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,705
| 627,706
|
u712397093
|
python
|
p02823
|
N,A,B = map(int,input().split())
C = B-A
if C % 2 == 0:
print(C//2)
else:
a = min(A-1, N-B) + 1 + (B-A+1)//2
print(a)
|
N,A,B = map(int,input().split())
C = B-A
if C % 2 == 0:
print(C//2)
else:
a = min(A-1, N-B) + 1 + (B-A-1)//2
print(a)
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 627,726
| 627,727
|
u398175819
|
python
|
p02823
|
#A - Table Tennis Training
N,A,B = list(map(int, input().split()))
Lab = B-A
La = A-1
Lb = N-B
if Lab%2==0:
#case Lab is even
ans = Lab/2
else:
#case Lab is odd
ans = min(La,Lb) + 1 + (Lab-1)/2
ans = int(ans)
ans
|
#A - Table Tennis Training
N,A,B = list(map(int, input().split()))
Lab = B-A
La = A-1
Lb = N-B
if Lab%2==0:
#case Lab is even
ans = Lab//2
else:
#case Lab is odd
ans = min(La,Lb) + 1 + (Lab-1)//2
print(ans)
|
[
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 627,739
| 627,740
|
u994034374
|
python
|
p02823
|
n,a,b=map(int,input().split())
b-=a
print(b//2+b%2*min(a,n-b+1))
|
n,a,b=map(int,input().split())
c=b-a
print(c//2+c%2*min(a,n-b+1))
|
[
"assignment.value.change",
"assignment.compound.arithmetic.replace.remove",
"expression.operator.arithmetic.replace.add",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,741
| 627,742
|
u729133443
|
python
|
p02823
|
n,a,b=map(int,input().split())
y=(b-a-1)/2
if (b-a)%2==0:
print(int((b-a)/2))
else:
if (a-1)<(n-b):
print(int(y+a))
else:
print(int(y++n-b))
|
n,a,b=map(int,input().split())
y=(b-a-1)//2
if (b-a)%2==0:
print(int((b-a)//2))
else:
if (a-1)<(n-b):
print(int(y+a))
else:
print(int(y+1+n-b))
|
[
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change",
"call.arguments.change",
"io.output.change"
] | 627,746
| 627,745
|
u017415492
|
python
|
p02823
|
n,a,b=map(int,input().split())
y=(b-a-1)/2
if (b-a)%2==0:
print(int((b-a)/2))
else:
if (a-1)<(n-b):
print(int(y+a+1))
else:
print(int(y+1+n-b))
|
n,a,b=map(int,input().split())
y=(b-a-1)//2
if (b-a)%2==0:
print(int((b-a)//2))
else:
if (a-1)<(n-b):
print(int(y+a))
else:
print(int(y+1+n-b))
|
[
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change",
"call.arguments.change",
"io.output.change",
"expression.operation.binary.remove"
] | 627,748
| 627,745
|
u017415492
|
python
|
p02823
|
n,a,b=map(int,input().split())
y=(b-a-1)/2
if (b-a)%2==0:
print(int((b-a)/2))
else:
if (a-1)<(n-b):
print(int(y+a))
else:
print(int(y+2+n-b))
|
n,a,b=map(int,input().split())
y=(b-a-1)//2
if (b-a)%2==0:
print(int((b-a)//2))
else:
if (a-1)<(n-b):
print(int(y+a))
else:
print(int(y+1+n-b))
|
[
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change",
"call.arguments.change",
"io.output.change",
"literal.number.integer.change"
] | 627,749
| 627,745
|
u017415492
|
python
|
p02823
|
n,a,b=map(int,input().split())
y=(b-a-1)/2
if (b-a)%2==0:
print(int((b-a)/2))
else:
if (a-1)<(n-b):
print(int(y+a))
else:
print(int(y+1+n-b-1))
|
n,a,b=map(int,input().split())
y=(b-a-1)//2
if (b-a)%2==0:
print(int((b-a)//2))
else:
if (a-1)<(n-b):
print(int(y+a))
else:
print(int(y+1+n-b))
|
[
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change",
"call.arguments.change",
"io.output.change",
"expression.operation.binary.remove"
] | 627,750
| 627,745
|
u017415492
|
python
|
p02823
|
n,a,b=map(int,input().split())
y=(b-a-1)/2
if (b-a)%2==0:
print(int((b-a)/2))
else:
if (a-1)<(n-b):
print(int(y+a-1))
else:
print(int(y+1+n-b-1))
|
n,a,b=map(int,input().split())
y=(b-a-1)//2
if (b-a)%2==0:
print(int((b-a)//2))
else:
if (a-1)<(n-b):
print(int(y+a))
else:
print(int(y+1+n-b))
|
[
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change",
"call.arguments.change",
"io.output.change",
"expression.operation.binary.remove"
] | 627,751
| 627,745
|
u017415492
|
python
|
p02823
|
N,A,B=map(int,input().split())
if abs(A-B)%2==0:
print(abs(A-B)//2)
else:
if A-1<=N-B:
ans=A+(B-A-1)//2
f=1
else:
ans=N-B+1+(N-A-(N-B+1))
f=0
print(ans)
|
N,A,B=map(int,input().split())
if abs(A-B)%2==0:
print(abs(A-B)//2)
else:
if A-1<=N-B:
ans=A+(B-A-1)//2
f=1
else:
ans=N-B+1+(N-A-(N-B+1))//2
f=0
print(ans)
|
[
"assignment.change"
] | 627,753
| 627,754
|
u620480037
|
python
|
p02823
|
N, A, B = map(int, input().split())
if abs(A - B) % 2 == 0:
print(abs(A - B) // 2)
else:
left = A + (B - A - 1) // 2
right = N - B + 1 + (N - A - 1) // 2
print(min(right, left))
|
N, A, B = map(int, input().split())
if abs(A - B) % 2 == 0:
print(abs(A - B) // 2)
else:
left = A + (B - A - 1) // 2
right = N - B + 1 + (B - A - 1) // 2
print(min(right, left))
|
[
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 627,788
| 627,789
|
u315078622
|
python
|
p02823
|
N, A, B = map(int, input().split())
Y = int(B-A)
if Y%2 == 0:
print(int(Y//2))
else:
if A-1>=N-B:
print(N-B+int((B-A+1)//2))
else:
print(A-1+int((B-A-1)//2))
|
N, A, B = map(int, input().split())
Y = int(B-A)
if Y%2 == 0:
print(int(Y//2))
else:
if A-1>=N-B:
print(N-B+int((B-A+1)//2))
else:
print(A-1+int((B-A+1)//2))
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,792
| 627,793
|
u906481659
|
python
|
p02823
|
N,A,B = list(map(int,input().split()))
diff = B - A
N2B = N - B
N2A = N - A
sumN = N2A + N2B
sumAB = A + B
if diff % 2 == 0:
print(diff // 2)
else:
if N2B < A - 1:
tmp = (N - (N2A + N2B))//2 + N2B
if (N - N2A - N2B)%2 == 1:
tmp = tmp + 1
if N2A < tmp:
print(N2A)
else:
print(tmp)
else:
tmp = ((B + 1 - A) - 1)//2 + A - 1
if ((B + 1 - A) - 1)%2 == 1:
tmp = tmp + 1
if B-1 < tmp:
print(B - 1)
else:
print(tmp)
|
N,A,B = list(map(int,input().split()))
diff = B - A
N2B = N - B
N2A = N - A
sumN = N2A + N2B
sumAB = A + B
if diff % 2 == 0:
print(diff // 2)
else:
if N2B < A - 1:
tmp = (N - (A + N2B))//2 + N2B
if (N - (A + N2B))%2 == 1:
tmp = tmp + 1
if N2A < tmp:
print(N2A)
else:
print(tmp)
else:
tmp = ((B + 1 - A) - 1)//2 + A - 1
if ((B + 1 - A) - 1)%2 == 1:
tmp = tmp + 1
if B-1 < tmp:
print(B - 1)
else:
print(tmp)
|
[
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change"
] | 627,811
| 627,812
|
u948694207
|
python
|
p02823
|
N,A,B = list(map(int,input().split()))
diff = B - A
N2B = N - B
N2A = N - A
sumN = N2A + N2B
sumAB = A + B
if diff % 2 == 0:
print(diff // 2)
else:
if N2B < A - 1:
tmp = (N - N2A + N2B)//2 + N2B
if (N - A + N2B)%2 == 0:
tmp = tmp + 1
if N2A < tmp:
print(N2A)
else:
print(tmp)
else:
tmp = ((B + 1 - A) - 1)//2 + A - 1
if ((B + 1 - A) - 1)%2 == 1:
tmp = tmp + 1
if B-1 < tmp:
print(B - 1)
else:
print(tmp)
|
N,A,B = list(map(int,input().split()))
diff = B - A
N2B = N - B
N2A = N - A
sumN = N2A + N2B
sumAB = A + B
if diff % 2 == 0:
print(diff // 2)
else:
if N2B < A - 1:
tmp = (N - (A + N2B))//2 + N2B
if (N - (A + N2B))%2 == 1:
tmp = tmp + 1
if N2A < tmp:
print(N2A)
else:
print(tmp)
else:
tmp = ((B + 1 - A) - 1)//2 + A - 1
if ((B + 1 - A) - 1)%2 == 1:
tmp = tmp + 1
if B-1 < tmp:
print(B - 1)
else:
print(tmp)
|
[
"assignment.value.change",
"expression.operation.binary.change",
"control_flow.branch.if.condition.change",
"literal.number.integer.change"
] | 627,813
| 627,812
|
u948694207
|
python
|
p02823
|
N,A,B=[int(x) for x in input().split()]
if (B-A)%2==0:
print(int((B-A)/2))
else:
if B-1 <= N-A:
print(int(min((B-A-1)/2+A,B-1)))
if B-1 > N-A:
print(int(min(N-A, (N-(A+N-(B+1))/2 + N-B+1))))
|
N,A,B=[int(x) for x in input().split()]
if (B-A)%2==0:
print(int((B-A)//2))
else:
if B-1 <= N-A:
print(int(min((B-A-1)//2+A,B-1)))
if B-1 > N-A:
print(int(min(N-A, (N-(A+N-B+1))//2 + N-B+1)))
|
[
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,817
| 627,815
|
u991619971
|
python
|
p02823
|
n,a,b = map(int,input().split())
if (b-a-1) % 2 == 0:
#print(b-1,n-a)
ans = min(a-1, n-b) + 1 + (B-A-1)//2
else:
ans = (b-a)//2
print(ans)
|
n,a,b = map(int,input().split())
if (b-a-1) % 2 == 0:
ans = min(a-1, n-b) + 1 + (b-a-1)//2
else:
ans = (b-a)//2
print(ans)
|
[
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 627,818
| 627,819
|
u740284863
|
python
|
p02823
|
n, a, b=map(int, input().split())
if a%2==b%2:
print((b-a)//2)
else:
if b-a>1:
if a-1<=n-b:
print(a+(b-a-1)//2)
else:
print(n-b+1+(a-n+b-1)//2)
else:
if a-1<=n-b:
print(b-1)
else:
print(n-a)
|
n, a, b=map(int, input().split())
if a%2==b%2:
print((b-a)//2)
else:
if b-a>1:
if a-1<=n-b:
print(a+(b-a-1)//2)
else:
print(n-b+1+(b-a-1)//2)
else:
if a-1<=n-b:
print(b-1)
else:
print(n-a)
|
[
"expression.operation.binary.remove"
] | 627,838
| 627,839
|
u345483150
|
python
|
p02823
|
n, a, b = map(int, input().split())
if abs(a-b)%2==0:
print(abs(a-b)//2)
else:
m = min(a,b)
M = max(a,b)
if M - m == 1:
if m-1 < n-M:
print((M-1))
else:
print((n-m))
else:
if m-1 < n-M:
print((M-1)+1+(M-m-1)//2)
else:
print((n-m)+1+(M-m-1)//2)
|
n, a, b = map(int, input().split())
if abs(a-b)%2==0:
print(abs(a-b)//2)
else:
m = min(a,b)
M = max(a,b)
if M - m == 1:
if m-1 < n-M:
print((M-1))
else:
print((n-m))
else:
if m-1 < n-M:
print((m-1)+1+(M-m-1)//2)
else:
print((n-M)+1+(M-m-1)//2)
|
[
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change",
"identifier.change"
] | 627,840
| 627,841
|
u036340997
|
python
|
p02823
|
n, a, b = map(int, input().split())
if abs(a-b)%2==0:
print(abs(a-b)//2)
else:
m = min(a,b)
M = max(a,b)
if M - m == 1:
if m-1 < n-M:
print((m-1))
else:
print((n-m))
else:
if m-1 < n-M:
print((m-1)+1+(M-m-1)//2)
else:
print((n-m)+1+(M-m-1)//2)
|
n, a, b = map(int, input().split())
if abs(a-b)%2==0:
print(abs(a-b)//2)
else:
m = min(a,b)
M = max(a,b)
if M - m == 1:
if m-1 < n-M:
print((M-1))
else:
print((n-m))
else:
if m-1 < n-M:
print((m-1)+1+(M-m-1)//2)
else:
print((n-M)+1+(M-m-1)//2)
|
[
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,842
| 627,841
|
u036340997
|
python
|
p02823
|
n,a,b = map(int,input().split())
i = 1
p = 0
if (b-a)%2==0:
print((b-a)//2)
else:
if a-1 < n-b:
print(min((1+b+(a-2))//2,b-1))
else:
print(min((n+a+(n-b))//2,n-a))
|
n,a,b = map(int,input().split())
i = 1
p = 0
if (b-a)%2==0:
print((b-a)//2)
else:
if a-1 < n-b:
print(min((1+b+(a-2))//2,b-1))
else:
print(min((n-a+(n-b+1))//2,n-a))
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,845
| 627,846
|
u602677143
|
python
|
p02823
|
a = list(map(int,input().split()))
N = a[0]
A = a[1]
B = a[2]
if (B - A) % 2 == 0:
ans = (B + A) // 2
else:
if (N - A) > (B - 1):
ans = A - 1
A = 1
B = B - ans
ans = ans + 1
B = B - 1
ans = ((B + A) // 2) + ans
else:
ans = N - B
B = N
A = A + ans
ans = ans + 1
A = A + 1
ans = ((B + A) // 2) + ans
print(ans)
|
a = list(map(int,input().split()))
N = a[0]
A = a[1]
B = a[2]
if (B - A) % 2 == 0:
ans = (B - A) // 2
else:
if (N - A) > (B - 1):
ans = A - 1
A = 1
B = B - ans
ans = ans + 1
B = B - 1
ans = ((B - A) // 2) + ans
else:
ans = N - B
B = N
A = A + ans
ans = ans + 1
A = A + 1
ans = ((B - A) // 2) + ans
print(ans)
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 627,887
| 627,888
|
u861071267
|
python
|
p02823
|
n, a, b = map(int, input().split())
diff=b-a
#b to n
#a to a+b-n
if(diff%2==0):
print(diff//2)
else:
ans1=n-b
dist=n-(a+b-n)
if(dist%2==0):
ans1+=dist//2
else:
ans1+=1+(dist-1)//2
#print(dist)
ans2=a-1
dist=(b-(a-1))-1
if(dist%2==0):
ans2+=dist//2
else:
ans2+=1+(dist-1)//2
#print(ans1,ans2)
print(min(ans1,ans2))
|
n, a, b = map(int, input().split())
diff=b-a
#b to n
#a to a+b-n
if(diff%2==0):
print(diff//2)
else:
ans1=n-b
dist=n-(a+n-b)
if(dist%2==0):
ans1+=dist//2
else:
ans1+=1+(dist-1)//2
#print(dist)
ans2=a-1
dist=(b-(a-1))-1
if(dist%2==0):
ans2+=dist//2
else:
ans2+=1+(dist-1)//2
#print(ans1,ans2)
print(min(ans1,ans2))
|
[
"expression.operation.binary.remove"
] | 627,906
| 627,907
|
u633497951
|
python
|
p02823
|
N,A,B = list(map(int,input().split()))
if (A+B) %2 == 0:
print(abs(B-A)//2)
else:
print(min((A+B+1)//2,(N-A+1+N-B)//2))
|
N,A,B = list(map(int,input().split()))
if (A+B) %2 == 0:
print(abs(B-A)//2)
else:
print(min((A+B-1)//2,(N-A+1+N-B)//2))
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 627,922
| 627,923
|
u904804404
|
python
|
p02823
|
n,a,b = map(int,input().split())
if abs(b-a)%2==0:
print(abs(b-a)//2)
elif abs(b-a)%2==1:
lst = [a-1,n-b]
if lst[0]>lst[1]:
print((n-b+1)+(n-(a+(n-b+1))//2))
elif lst[0]<lst[1]:
print((a-1+1)+(b-a-1)//2)
elif lst[0]==lst[1]:
print((a-1+1)+(b-a-1)//2)
|
n,a,b = map(int,input().split())
if abs(b-a)%2==0:
print(abs(b-a)//2)
elif abs(b-a)%2==1:
lst = [a-1,n-b]
if lst[0]>lst[1]:
print((n-b+1)+(n-(a+(n-b+1)))//2)
elif lst[0]<lst[1]:
print((a-1+1)+(b-a-1)//2)
elif lst[0]==lst[1]:
print((a-1+1)+(b-a-1)//2)
|
[
"call.arguments.change"
] | 627,938
| 627,939
|
u972658925
|
python
|
p02823
|
N, A, B = map(int, input().split())
if ((B-A)%2 == 0):
print((B-A)//2)
exit()
print(min(A-1, N-B-1) + 1 + (B-A)//2)
|
N, A, B = map(int, input().split())
if ((B-A)%2 == 0):
print((B-A)//2)
exit()
print(min(A-1, N-B) + 1 + (B-A)//2)
|
[
"expression.operation.binary.remove"
] | 627,960
| 627,961
|
u186426563
|
python
|
p02823
|
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from math import gcd
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
# 最小公倍数
def gcd(a, b):
if a < b:
a, b = b, a
while a % b != 0:
a, b = b, a % b
return b
# 最大公約数
def lcm(a, b):
y = a*b / gcd(a, b)
return int(y)
# N = INT()
# print(N)
N, A, B = MAP()
# guusuu
if (A - B) % 2 == 0:
s = B - A
ans = s // 2
print(ans)
# kisuu
else:
# if N - A <= B
# k = B - A
# m = min(N - A, B)
if A - 1 <= N - B:
# A ni tikazuku
# 最初の移動
s = A - 1
# Bが残り移動する距離
b = B - (A - 1) - 1
ans = (s + (b + 1)) // 2
# print(ans)
else:
s = N - B
ans = N - (A + s) + 1
ans = ans // 2
# ans = A + s + 1
# ans = ans // 2
print(ans)
# ans =(B - A + 1)//2
# else:
# a = N - (A + N - B )
# ans = a // 2
# print(ans)
# print(ans - k)
# if A <= N - B:
# print(B - A)
# else:
# print(B - A)
# # k = B - A
# ans = k+min(N - A, N - B)
# B - min(N - A, N - B)
# print(ans)
|
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from math import gcd
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
# 最小公倍数
def gcd(a, b):
if a < b:
a, b = b, a
while a % b != 0:
a, b = b, a % b
return b
# 最大公約数
def lcm(a, b):
y = a*b / gcd(a, b)
return int(y)
# N = INT()
# print(N)
N, A, B = MAP()
# guusuu
if (A - B) % 2 == 0:
s = B - A
ans = s // 2
print(ans)
# kisuu
else:
# if N - A <= B
# k = B - A
# m = min(N - A, B)
if A - 1 <= N - B:
# A ni tikazuku
# 最初の移動
s = A - 1
# Bが残り移動する距離
b = B - (A - 1) - 1
ans = s + (b + 1) // 2
# print(ans)
else:
s = N - B
a = N - (A + s) + 1
ans = s + a // 2
# ans = A + s + 1
# ans = ans // 2
print(ans)
# ans =(B - A + 1)//2
# else:
# a = N - (A + N - B )
# ans = a // 2
# print(ans)
# print(ans - k)
# if A <= N - B:
# print(B - A)
# else:
# print(B - A)
# # k = B - A
# ans = k+min(N - A, N - B)
# B - min(N - A, N - B)
# print(ans)
|
[
"assignment.variable.change",
"identifier.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 627,964
| 627,965
|
u083960235
|
python
|
p02823
|
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from math import gcd
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
# 最小公倍数
def gcd(a, b):
if a < b:
a, b = b, a
while a % b != 0:
a, b = b, a % b
return b
# 最大公約数
def lcm(a, b):
y = a*b / gcd(a, b)
return int(y)
# N = INT()
# print(N)
N, A, B = MAP()
# guusuu
if (A - B) % 2 == 0:
s = B - A
ans = s // 2
print(ans)
# kisuu
else:
# if N - A <= B
# k = B - A
# m = min(N - A, B)
if A - 1 <= N - B:
# A ni tikazuku
# 最初の移動
s = A - 1
# Bが残り移動する距離
b = B - (A - 1) - 1
ans = s + (b + 1) // 2
# print(ans)
else:
s = N - B
ans = N - (A + s) + 1
ans = ans // 2
# ans = A + s + 1
# ans = ans // 2
print(ans)
# ans =(B - A + 1)//2
# else:
# a = N - (A + N - B )
# ans = a // 2
# print(ans)
# print(ans - k)
# if A <= N - B:
# print(B - A)
# else:
# print(B - A)
# # k = B - A
# ans = k+min(N - A, N - B)
# B - min(N - A, N - B)
# print(ans)
|
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from math import gcd
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
# 最小公倍数
def gcd(a, b):
if a < b:
a, b = b, a
while a % b != 0:
a, b = b, a % b
return b
# 最大公約数
def lcm(a, b):
y = a*b / gcd(a, b)
return int(y)
# N = INT()
# print(N)
N, A, B = MAP()
# guusuu
if (A - B) % 2 == 0:
s = B - A
ans = s // 2
print(ans)
# kisuu
else:
# if N - A <= B
# k = B - A
# m = min(N - A, B)
if A - 1 <= N - B:
# A ni tikazuku
# 最初の移動
s = A - 1
# Bが残り移動する距離
b = B - (A - 1) - 1
ans = s + (b + 1) // 2
# print(ans)
else:
s = N - B
a = N - (A + s) + 1
ans = s + a // 2
# ans = A + s + 1
# ans = ans // 2
print(ans)
# ans =(B - A + 1)//2
# else:
# a = N - (A + N - B )
# ans = a // 2
# print(ans)
# print(ans - k)
# if A <= N - B:
# print(B - A)
# else:
# print(B - A)
# # k = B - A
# ans = k+min(N - A, N - B)
# B - min(N - A, N - B)
# print(ans)
|
[
"assignment.variable.change",
"identifier.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 627,966
| 627,965
|
u083960235
|
python
|
p02823
|
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from math import gcd
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
# 最小公倍数
def gcd(a, b):
if a < b:
a, b = b, a
while a % b != 0:
a, b = b, a % b
return b
# 最大公約数
def lcm(a, b):
y = a*b / gcd(a, b)
return int(y)
# N = INT()
# print(N)
N, A, B = MAP()
# guusuu
if (A - B) % 2 == 0:
s = B - A
ans = s // 2
print(ans)
# kisuu
else:
# if N - A <= B
# k = B - A
# m = min(N - A, B)
if A <= N - B:
# A ni tikazuku
# 最初の移動
s = A - 1
# Bが残り移動する距離
b = B - (A - 1) - 1
ans = s + (b + 1) // 2
# print(ans)
else:
s = N - B
ans = N - (A + s) + 1
ans = ans // 2
# ans = A + s + 1
# ans = ans // 2
print(ans)
# ans =(B - A + 1)//2
# else:
# a = N - (A + N - B )
# ans = a // 2
# print(ans)
# print(ans - k)
# if A <= N - B:
# print(B - A)
# else:
# print(B - A)
# # k = B - A
# ans = k+min(N - A, N - B)
# B - min(N - A, N - B)
# print(ans)
|
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from math import gcd
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
# 最小公倍数
def gcd(a, b):
if a < b:
a, b = b, a
while a % b != 0:
a, b = b, a % b
return b
# 最大公約数
def lcm(a, b):
y = a*b / gcd(a, b)
return int(y)
# N = INT()
# print(N)
N, A, B = MAP()
# guusuu
if (A - B) % 2 == 0:
s = B - A
ans = s // 2
print(ans)
# kisuu
else:
# if N - A <= B
# k = B - A
# m = min(N - A, B)
if A - 1 <= N - B:
# A ni tikazuku
# 最初の移動
s = A - 1
# Bが残り移動する距離
b = B - (A - 1) - 1
ans = s + (b + 1) // 2
# print(ans)
else:
s = N - B
a = N - (A + s) + 1
ans = s + a // 2
# ans = A + s + 1
# ans = ans // 2
print(ans)
# ans =(B - A + 1)//2
# else:
# a = N - (A + N - B )
# ans = a // 2
# print(ans)
# print(ans - k)
# if A <= N - B:
# print(B - A)
# else:
# print(B - A)
# # k = B - A
# ans = k+min(N - A, N - B)
# B - min(N - A, N - B)
# print(ans)
|
[
"control_flow.branch.if.condition.change",
"assignment.variable.change",
"identifier.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 627,967
| 627,965
|
u083960235
|
python
|
p02823
|
N,A,B = map(int,input().split())
if (B - A) % 2 == 0:
print((B - A) // 2)
else:
NA = N - A
B1 = B - 1
if NA < B1:
distance = N - B
adjust = distance + 1
moveA = A + adjust
print(((N - moveA) // 2) + adjust)
else:
distance = A - 1
adjust = distance + 1
moveB = B + adjust
print(((moveB - 1) // 2) + adjust)
|
N,A,B = map(int,input().split())
if (B - A) % 2 == 0:
print((B - A) // 2)
else:
NA = N - A
B1 = B - 1
if NA < B1:
distance = N - B
adjust = distance + 1
moveA = A + adjust
print(((N - moveA) // 2) + adjust)
else:
distance = A - 1
adjust = distance + 1
moveB = B - adjust
print(((moveB - 1) // 2) + adjust)
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 627,986
| 627,987
|
u993435350
|
python
|
p02823
|
N,A,B = map(int,input().split())
if (B - A) % 2 == 0:
print((B - A) // 2)
else:
NA = N - A
B1 = B - 1
if NA < B1:
distance = N - B
adjust = distance + 1
moveA = A + adjust
print(((N - moveA) // 2) + adjust)
else:
distance = A - 1
adjust = distance + 1
moveB = B + adjust
print(((A - moveB) // 2) + adjust)
|
N,A,B = map(int,input().split())
if (B - A) % 2 == 0:
print((B - A) // 2)
else:
NA = N - A
B1 = B - 1
if NA < B1:
distance = N - B
adjust = distance + 1
moveA = A + adjust
print(((N - moveA) // 2) + adjust)
else:
distance = A - 1
adjust = distance + 1
moveB = B - adjust
print(((moveB - 1) // 2) + adjust)
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 627,988
| 627,987
|
u993435350
|
python
|
p02823
|
num,a,b = map(int,input().split())
if(b-a) %2 ==0:
print((b-a)//2)
#間隔が奇数の時
else:
#aと右端の差
p=num-a
#bと左端の差
q=b-1
#aと左端の差
r=a-1
#bと右端の差
s=num-b
#もしbとaの差が3未満のとき
if b-a <3:
p = max(b-1,num-a)
print(p)
else:
z=r+1+(b-(r+1)-1)//2
y=s+1+(num-(a+(s+1)))//2
print(min(y,z))
|
num,a,b = map(int,input().split())
if(b-a) %2 ==0:
print((b-a)//2)
#間隔が奇数の時
else:
#aと右端の差
p=num-a
#bと左端の差
q=b-1
#aと左端の差
r=a-1
#bと右端の差
s=num-b
#もしbとaの差が3未満のとき
if b-a <3:
p = min(b-1,num-a)
print(p)
else:
z=r+1+(b-(r+1)-1)//2
y=s+1+(num-(a+(s+1)))//2
print(min(y,z))
|
[
"misc.opposites",
"assignment.value.change",
"identifier.change",
"call.function.change"
] | 628,012
| 628,013
|
u404290207
|
python
|
p02823
|
N, A, B = list(map(int, input().split()))
ans=0
if (B-A)%2 == 0:
ans = (B-A)//2
else:
if N-B <= A-1:
ans += N-B
A += N-B+1
ans += (N-A)//2 + 1
else:
ans += A-1
B -= A-1+1
ans += (A-1)//2 + 1
print(ans)
|
N, A, B = list(map(int, input().split()))
ans=0
if (B-A)%2 == 0:
ans = (B-A)//2
else:
if N-B <= A-1:
ans += N-B
A += N-B+1
ans += (N-A)//2 + 1
else:
ans += A-1
B -= A-1+1
ans += (B-1)//2 + 1
print(ans)
|
[
"identifier.change",
"expression.operation.binary.change"
] | 628,024
| 628,025
|
u057668615
|
python
|
p02823
|
n,a,b=map(int,input().split())
if (a-b)%2==0:
print(abs((a-b)//2))
else:
c = max(n-a,n-b)
d = max(a-1,b-1)
e = min(n-a,n-b)
f = min(a-1,b-1)
g = min(e,f)
h = g + (abs(a-b)+1)//2
print(min(c,d,g))
|
n,a,b=map(int,input().split())
if (a-b)%2==0:
print(abs((a-b)//2))
else:
c = max(n-a,n-b)
d = max(a-1,b-1)
e = min(n-a,n-b)
f = min(a-1,b-1)
g = min(e,f)
h = g + (abs(a-b)+1)//2
print(min(c,d,h))
|
[
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 628,032
| 628,033
|
u357230322
|
python
|
p02823
|
# coding: utf-8
# Your code here!
n,a,b=map(int,input().split())
if (b-a)%2==0:
print((b-a)//2)
else:
if a-1==min(a-1,n-b):
print(a+((b-a-1)//2))
else:
print(b+((b-a-1)//2))
|
# coding: utf-8
# Your code here!
n,a,b=map(int,input().split())
if (b-a)%2==0:
print((b-a)//2)
else:
if a-1==min(a-1,n-b):
print(a+((b-a-1)//2))
else:
print(n-b+1+((b-a-1)//2))
|
[
"expression.operation.binary.add"
] | 628,036
| 628,037
|
u727787724
|
python
|
p02823
|
def main():
n, a, b = map(int, input().split())
if abs(a - b) % 2 == 0:
print(abs(a - b) // 2)
else:
mi = min(a, b) - 1
ma = n - max(a, b)
print(min(mi, ma) + (abs(a - b) - 1 // 2))
if __name__ == '__main__':
main()
|
def main():
n, a, b = map(int, input().split())
if abs(a - b) % 2 == 0:
print(abs(a - b) // 2)
else:
mi = min(a, b) - 1
ma = n - max(a, b)
print(min(mi, ma) + (abs(a - b) + 1) // 2)
if __name__ == '__main__':
main()
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 628,046
| 628,045
|
u846694620
|
python
|
p02823
|
import sys
from math import factorial
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7
n, a, b = MAP()
if (a-b)%2 == 0:
print((b-a)//2)
else:
k = min(n-b, a-1)
print((b-a+k-1)//2 + k+1)
|
import sys
from math import factorial
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7
n, a, b = MAP()
if (a-b)%2 == 0:
print((b-a)//2)
else:
k = min(n-b, a-1)
print((b-a-1)//2 + k+1)
|
[
"expression.operation.binary.remove"
] | 628,054
| 628,055
|
u540799318
|
python
|
p02823
|
import sys
from math import factorial
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7
n, a, b = MAP()
if (a-b)%2 == 0:
print((b-a)//2)
else:
k = min(n-b, a-1)
print((b-a+k-1)//2 + max(k,1))
|
import sys
from math import factorial
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7
n, a, b = MAP()
if (a-b)%2 == 0:
print((b-a)//2)
else:
k = min(n-b, a-1)
print((b-a-1)//2 + k+1)
|
[
"expression.operation.binary.remove",
"call.remove",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 628,056
| 628,055
|
u540799318
|
python
|
p02823
|
N,A,B = map(int,input().split())
if (A-B)%2==0:
print((B-A)//2)
else:
print(min((A+B)//2,(N*2-A-B)//2))
|
N,A,B = map(int,input().split())
if (A-B)%2==0:
print((B-A)//2)
else:
print(min((A+B)//2,(N*2-A-B)//2+1))
|
[
"expression.operation.binary.add"
] | 628,080
| 628,081
|
u735069283
|
python
|
p02823
|
li = list(map(int,input().split()))
n = li[0]
a = li[1]
b = li[2]
ans = 0
if (b-a)%2 == 0:
ans = (b-a)//2
else:
if a-1>n-b:
ans+=n-b
ans = ans-(-(n-a)//2)
else:
ans+=a-1
ans = ans-(-(b-1)//2)
print(ans)
|
li = list(map(int,input().split()))
n = li[0]
a = li[1]
b = li[2]
ans = 0
if (b-a)%2 == 0:
ans = (b-a)//2
else:
if a-1>n-b:
ans+=n-b
ans = ans-(-(b-a)//2)
else:
ans+=a-1
ans = ans-(-(b-a)//2)
print(ans)
|
[
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change",
"identifier.replace.add",
"literal.replace.remove"
] | 628,095
| 628,096
|
u861340374
|
python
|
p02823
|
N,A,B=map(int,input().split())
C=A+B
if C%2==0:
print(C//2)
else:
dist_a=A-1
dist_b=N-B
base=min(dist_a,dist_b)
print(base+(B-A+1)//2)
|
N,A,B=map(int,input().split())
C=B-A
if C%2==0:
print(C//2)
else:
dist_a=A-1
dist_b=N-B
base=min(dist_a,dist_b)
print(base+(B-A+1)//2)
|
[
"expression.operation.binary.remove"
] | 628,114
| 628,115
|
u089142196
|
python
|
p02823
|
N , A, B = map(int, input().split())
if (B-A)%2 == 0:
ans = (B-A)//2
else:
if A-1<N-B:
ans = N-B+(B-A)//2
else:
ans = A-1+(B-A)//2
print(ans)
|
N , A, B = map(int, input().split())
if (B-A)%2 == 0:
ans = (B-A)//2
else:
if A-1>N-B:
ans = N-B+(B-A)//2+1
else:
ans = A-1+(B-A)//2+1
print(ans)
|
[
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 628,143
| 628,144
|
u310678820
|
python
|
p02823
|
import sys
readline = sys.stdin.readline
N, A, B = map(int, readline().split())
ans = None
if (B - A) % 2 == 0:
ans = (B-A)//2
else:
ans = A + (B - A - 1)//2
ans = min(ans, N-B+1 + (A+N-B+1)//2)
print(ans)
|
import sys
readline = sys.stdin.readline
N, A, B = map(int, readline().split())
ans = None
if (B - A) % 2 == 0:
ans = (B-A)//2
else:
ans = A + (B - A - 1)//2
ans = min(ans, N-B+1 + (-A+B-1)//2)
print(ans)
|
[
"expression.operation.unary.add",
"call.arguments.change",
"expression.operation.binary.remove",
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 628,147
| 628,148
|
u368780724
|
python
|
p02823
|
import sys
readline = sys.stdin.readline
N, A, B = map(int, readline().split())
ans = None
if (B - A) % 2 == 0:
ans = (B-A)//2
else:
ans = A + (B - A - 1)//2
ans = min(ans, N-B + (A+N-B+1)//2)
print(ans)
|
import sys
readline = sys.stdin.readline
N, A, B = map(int, readline().split())
ans = None
if (B - A) % 2 == 0:
ans = (B-A)//2
else:
ans = A + (B - A - 1)//2
ans = min(ans, N-B+1 + (-A+B-1)//2)
print(ans)
|
[
"expression.operation.unary.add",
"call.arguments.change",
"expression.operation.binary.remove",
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 628,149
| 628,148
|
u368780724
|
python
|
p02823
|
n, a, b = map(int, input().split())
if abs(a-b) % 2 == 0:
print(abs(a-b)//2)
exit()
print(min(a+(b-(a+1))//2, n-b+(b-a-1)//2))
|
n, a, b = map(int, input().split())
if abs(a-b) % 2 == 0:
print(abs(a-b)//2)
exit()
print(min(a+(b-(a+1))//2, n-b+1+(b-a-1)//2))
|
[
"expression.operation.binary.add"
] | 628,152
| 628,153
|
u594518120
|
python
|
p02823
|
n, a, b = map(int, input().split())
a, b = min(a,b), max(a,b)
if (b-a) % 2 == 0:
print(b-a//2)
exit(0)
d = min(a - 1, n - b)
print(d + 1 + (b-a-1)//2)
|
n, a, b = map(int, input().split())
a, b = min(a,b), max(a,b)
if (b-a) % 2 == 0:
print((b-a)//2)
exit(0)
d = min(a - 1, n - b)
print(d + 1 + (b-a-1)//2)
|
[
"call.arguments.change"
] | 628,178
| 628,179
|
u086980944
|
python
|
p02823
|
n, a, b = map(int, input().split())
a, b = min(a,b), max(a,b)
if (b-a) % 2 == 0:
print(b-a//2)
exit(0)
d = min(a - 1, n - a)
print(d + 1 + (b-a-1)//2)
|
n, a, b = map(int, input().split())
a, b = min(a,b), max(a,b)
if (b-a) % 2 == 0:
print((b-a)//2)
exit(0)
d = min(a - 1, n - b)
print(d + 1 + (b-a-1)//2)
|
[
"call.arguments.change",
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 628,180
| 628,179
|
u086980944
|
python
|
p02823
|
def main():
n,a,b=map(int,input().split())
if abs(a-b) % 2 == 0:
print(abs(a-b)//2)
return
left=0
temp = max(a,b)
left = temp - 1
right = 0
temp = min(a,b)
right = n - temp
ans = min(left,right)
tempR=b-a
mid1=10**19
if tempR-1>0:
mid1=(tempR-1)//2 + a
tempL=a+n-b+1
mid2=10**19
if n-tempL > 0:
mid2=(n-tempL)//2 + n-a
ans = min(ans,mid1,mid2)
print(ans)
return
if __name__=='__main__':
main()
|
def main():
n,a,b=map(int,input().split())
if abs(a-b) % 2 == 0:
print(abs(a-b)//2)
return
left=0
temp = max(a,b)
left = temp - 1
right = 0
temp = min(a,b)
right = n - temp
ans = min(left,right)
tempR=b-a
mid1=10**19
if tempR-1>0:
mid1=(tempR-1)//2 + a
tempL=a+n-b+1
mid2=10**19
if n-tempL > 0:
mid2=(n-tempL)//2 + n-b+1
ans = min(ans,mid1,mid2)
print(ans)
return
if __name__=='__main__':
main()
|
[
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 628,189
| 628,190
|
u321035578
|
python
|
p02823
|
def main():
n,a,b=map(int,input().split())
if abs(a-b) % 2 == 0:
print(abs(a-b)//2)
return
left=0
temp = max(a,b)
left = temp - 1
right = 0
temp = min(a,b)
right = n - temp
ans = min(left,right)
tempR=b-a
mid1=10**19
if tempR-1>0:
mid1=(tempR-1)//2 + a
tempL=a+n-b+1
mid2=10**19
if n-tempL > 0:
mid2=(n-tempL)//2 + n-a+1
ans = min(ans,mid1,mid2)
print(ans)
return
if __name__=='__main__':
main()
|
def main():
n,a,b=map(int,input().split())
if abs(a-b) % 2 == 0:
print(abs(a-b)//2)
return
left=0
temp = max(a,b)
left = temp - 1
right = 0
temp = min(a,b)
right = n - temp
ans = min(left,right)
tempR=b-a
mid1=10**19
if tempR-1>0:
mid1=(tempR-1)//2 + a
tempL=a+n-b+1
mid2=10**19
if n-tempL > 0:
mid2=(n-tempL)//2 + n-b+1
ans = min(ans,mid1,mid2)
print(ans)
return
if __name__=='__main__':
main()
|
[
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 628,191
| 628,190
|
u321035578
|
python
|
p02823
|
def main():
n,a,b=map(int,input().split())
if abs(a-b) % 2 == 0:
print(abs(a-b)//2)
return
left=0
temp = max(a,b)
left = temp - 1
right = 0
temp = min(a,b)
right = n - temp
ans = min(left,right)
tempR=b-a
mid1=10**19
if tempR-1>0:
mid1=(tempR-1)//2 + a -1
tempL=a+n-b
mid2=10**19
if n-tempL > 0:
mid2=(n-tempL)//2 + n-a+1
ans = min(ans,mid1,mid2)
print(ans)
return
if __name__=='__main__':
main()
|
def main():
n,a,b=map(int,input().split())
if abs(a-b) % 2 == 0:
print(abs(a-b)//2)
return
left=0
temp = max(a,b)
left = temp - 1
right = 0
temp = min(a,b)
right = n - temp
ans = min(left,right)
tempR=b-a
mid1=10**19
if tempR-1>0:
mid1=(tempR-1)//2 + a
tempL=a+n-b+1
mid2=10**19
if n-tempL > 0:
mid2=(n-tempL)//2 + n-b+1
ans = min(ans,mid1,mid2)
print(ans)
return
if __name__=='__main__':
main()
|
[
"expression.operation.binary.remove",
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 628,192
| 628,190
|
u321035578
|
python
|
p02823
|
def main():
n,a,b=map(int,input().split())
if abs(a-b) % 2 == 0:
print(abs(a-b)//2)
return
left=0
temp = max(a,b)
left = temp - 1
right = 0
temp = min(a,b)
right = n - temp
ans = min(left,right)
tempR=b-a
mid1=10**19
if tempR-1>0:
mid1=(tempR-1)//2 + a
tempL=a+n-b
mid2=10**19
if n-tempL > 0:
mid2=(n-tempL)//2 + n-a+1
ans = min(ans,mid1,mid2)
print(ans)
return
if __name__=='__main__':
main()
|
def main():
n,a,b=map(int,input().split())
if abs(a-b) % 2 == 0:
print(abs(a-b)//2)
return
left=0
temp = max(a,b)
left = temp - 1
right = 0
temp = min(a,b)
right = n - temp
ans = min(left,right)
tempR=b-a
mid1=10**19
if tempR-1>0:
mid1=(tempR-1)//2 + a
tempL=a+n-b+1
mid2=10**19
if n-tempL > 0:
mid2=(n-tempL)//2 + n-b+1
ans = min(ans,mid1,mid2)
print(ans)
return
if __name__=='__main__':
main()
|
[
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 628,193
| 628,190
|
u321035578
|
python
|
p02823
|
N, A, B = map(int, input().split())
cnt = 0
if (B - A) % 2:
if A - 1 <= N - B:
cnt = A
A = 1
B -= A
else:
cnt = N - B + 1
A += N - B + 1
B = N
print(cnt + (B - A) // 2)
|
N, A, B = map(int, input().split())
cnt = 0
if (B - A) % 2:
if A - 1 <= N - B:
cnt = A
B -= A
A = 1
else:
cnt = N - B + 1
A += N - B + 1
B = N
print(cnt + (B - A) // 2)
|
[
"assignment.remove",
"assignment.add"
] | 628,209
| 628,210
|
u415905784
|
python
|
p02823
|
n, a, b =map(int, input().split())
if (a - b) % 2 == 0:
print(abs(a - b) // 2)
else:
if a > b:
a, b = b, a
if n - b > a - 1:
print((2 * a + b - 3) // 2)
else:
print((2 * n - b - a + 1) // 2)
|
n, a, b =map(int, input().split())
if (a - b) % 2 == 0:
print(abs(a - b) // 2)
else:
if a > b:
a, b = b, a
if n - b > a - 1:
print((a + b - 1) // 2)
else:
print((2 * n - b - a + 1) // 2)
|
[
"expression.operation.binary.remove",
"literal.number.integer.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 628,223
| 628,224
|
u079427319
|
python
|
p02823
|
n, a, b = map(int, input().split())
if (b-a)%2 == 0:
print((b-a)//2)
else:
if (a+b) > n:
print(((n-a)+(n-b)-1)//2)
else:
print((a+b-1)//2)
|
n, a, b = map(int, input().split())
if (b-a)%2 == 0:
print((b-a)//2)
else:
if (a+b) > n:
print(((n-a)+(n-b)+1)//2)
else:
print((a+b-1)//2)
|
[
"misc.opposites",
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 628,236
| 628,237
|
u080364835
|
python
|
p02823
|
n, a, b = map(int, input().split())
a -= 1; b -= 1
if (b-a) % 2 == 0:
print((b-a) // 2)
else:
a = min(a, n-1-b)
print(a + 1 + (b-a-1) // 2)
|
n, a, b = map(int, input().split())
a -= 1; b -= 1
if (b-a) % 2 == 0:
print((b-a) // 2)
else:
x = min(a, n-1-b)
print(x + 1 + (b-a-1) // 2)
|
[
"assignment.variable.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 628,238
| 628,239
|
u193182854
|
python
|
p02823
|
N, A, B = map(int, input().split())
if A % 2 == B % 2:
print((B - A) // 2)
else:
print(min(A + (B - A + 1) // 2, B - 1, N - A, N - B + 1 + (B - A + 1) // 2))
|
N, A, B = map(int, input().split())
if A % 2 == B % 2:
print((B - A) // 2)
else:
print(min(A - 1 + (B - A + 1) // 2, B - 1, N - A, N - B + (B - A + 1) // 2))
|
[
"expression.operation.binary.remove"
] | 628,246
| 628,247
|
u984276646
|
python
|
p02823
|
n,a0,b0 = map(int,input().split())
a = min(a0,b0)
b = max(a0,b0)
ans = 0
if abs(a-b) % 2 == 0:
ans = abs(a-b)//2
else:
if (a-1) < (n-b):
ans = (a-1)+(b-a+1)//2
else:
ans = (n-b)+(b-a)//2
print(ans)
|
import math
n,a0,b0 = map(int,input().split())
a = min(a0,b0)
b = max(a0,b0)
ans = 0
if abs(a-b) % 2 == 0:
ans = abs(a-b)//2
else:
if (a-1) < (n-b):
ans = (a-1)+(b-a+2)//2
else:
ans = (n-b)+(b-a+1)//2
print(ans)
|
[
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 628,254
| 628,255
|
u738898077
|
python
|
p02823
|
#!/usr/bin/env python3
import sys
def solve(N: int, A: int, B: int):
if (B-A)%2 == 0:
between = (B-A)//2
print(between)
else: #端でしか会えない
answer = 0
if A-1<=N-B:
answer += A
A = 1
B -= A
answer += (B-A)//2
else:
answer += N-B+1
A += N-B+1
B = N
answer += (B-A)//2
print(answer)
return
def main():
def iterate_tokens():
for line in sys.stdin:
for word in line.split():
yield word
tokens = iterate_tokens()
N = int(next(tokens)) # type: int
A = int(next(tokens)) # type: int
B = int(next(tokens)) # type: int
solve(N, A, B)
if __name__ == '__main__':
main()
|
#!/usr/bin/env python3
import sys
def solve(N: int, A: int, B: int):
if (B-A)%2 == 0:
between = (B-A)//2
print(between)
else: #端でしか会えない
answer = 0
if A-1<=N-B:
answer += A
B -= A
A = 1
answer += (B-A)//2
else:
answer += N-B+1
A += N-B+1
B = N
answer += (B-A)//2
print(answer)
return
def main():
def iterate_tokens():
for line in sys.stdin:
for word in line.split():
yield word
tokens = iterate_tokens()
N = int(next(tokens)) # type: int
A = int(next(tokens)) # type: int
B = int(next(tokens)) # type: int
solve(N, A, B)
if __name__ == '__main__':
main()
|
[
"assignment.remove",
"assignment.add"
] | 628,264
| 628,265
|
u020390084
|
python
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.