TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: We have a sequence of N integers: A_1, A_2, \cdots, A_N.  You can perform the following operation between 0 and K times (inclusive):    * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element.  Compute the maximum possible positive integer that divides every element of A after the operations. Here a positive integer x divides an integer y if and only if there exists an integer z such that y = xz.

Submission attempts (in order):
def yakusu(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
N,K=map(int,input().split())
L=list(map(int,input().split()))
a=sum(L)
R=yakusu(a)[::-1]
minus=0
even=0
add=0
for i in range(len(R)):
  s=R[i]
  A=list()
  B=list()
  for j in range(N):
    k=L[j]
    a=k%s
    b=s-a
    if a>b:
      add+=b
      B.append(b)
    elif a<b:
      minus+=a
      A.append(a)
    else:
      add+=a
      B.append(a)
  
  A=sorted(A)
  B=sorted(B)
  if minus==add:
    d=minus
    if d<=K:
      print(s)
      exit()
  elif minus>add:
    q=(minus-add)//s
    d=sum(A[:len(A)-q])
    if d<=K:
      print(s)
      exit()
  else:
    q=(add-minus)//s
    d=sum(B[:len(B)-q])
    if d<=K:
      print(s)
      exit()

def yakusu(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
N,K=map(int,input().split())
L=list(map(int,input().split()))
a=sum(L)
R=yakusu(a)[::-1]
for i in range(len(R)):
  add=0
  minus=0
  s=R[i]
  A=list()
  B=list()
  for j in range(N):
    k=L[j]
    a=k%s
    b=s-a
    if a>b:
      add+=b
      B.append(b)
    elif a<b:
      minus+=a
      A.append(a)
    else:
      add+=a
      B.append(a)
  
  A=sorted(A)
  B=sorted(B)
  if minus==add:
    d=minus
    if d<=K:
      print(s)
      exit()
  elif minus>add:
    q=(minus-add)//s
    d=sum(A[:len(A)-q])
    if d<=K:
      print(s)
      exit()
  else:
    q=(add-minus)//s
    d=sum(B[:len(B)-q])
    if d<=K:
      print(s)
      exit()

Verdicts: Wrong Answer

Accepted
Problem: We have a set S of N points in a two-dimensional plane. The coordinates of the i-th point are (x_i, y_i). The N points have distinct x-coordinates and distinct y-coordinates.  For a non-empty subset T of S, let f(T) be the number of points contained in the smallest rectangle, whose sides are parallel to the coordinate axes, that contains all the points in T. More formally, we define f(T) as follows:    * f(T) :=  (the number of integers i (1 \leq i \leq N) such that a \leq x_i \leq b and c \leq y_i \leq d, where a, b, c, and d are the minimum x-coordinate, the maximum x-coordinate, the minimum y-coordinate, and the maximum y-coordinate of the points in T)  Find the sum of f(T) over all non-empty subset T of S. Since it can be enormous, print the sum modulo 998244353.

Submission attempts (in order):
import sys
import array

from operator import itemgetter

def main():



	input = sys.stdin.readline


	md = 998244353
	n = int(input())
	tl=n+1
	
	ft=[0]*tl

	xy = [[0]*2 for _ in range(n)]
	for i in range(n):
		xy[i] = [int(item) for item in input().split()]
	xy.sort(key=itemgetter(0))
	yxi = [y for x, y in xy]

	*YS, = set(yxi)
	YS.sort()
	yxi= list(map({e: i for i, e in enumerate(YS)}.__getitem__, yxi))

	ct=[0]*(n+1)
	ct[0]=1
	for i in range(1,n+1):
		ct[i]=ct[i-1]*2%md

	cnt=tuple(ct)

	def upd(i):
		i+=1
		while(i<=len(ft)):
			ft[i]+=1
			i+=i&-i

	def get(i):
		i+=1
		ret=0
		while(i!=0):
		    ret+=ft[i]
		    i-=i&-i
		return ret

	def calc(get,upd):
		for i, y in enumerate(yxi):
			v = get(y); upd(y)
			p1 = cnt[v]; p0 = cnt[y - v]
			q1 = cnt[i - v]; q0 = cnt[(n - y - 1) - (i - v)]
			yield (p0 + p1 + q0 + q1 - (p0 + q1) * (p1 + q0)) % md


	print((sum(calc(get,upd))+n*cnt[n] - n)%md)

main()


import sys
import array

from operator import itemgetter

def main():



	input = sys.stdin.readline


	md = 998244353
	n = int(input())
	tl=n+1
	
	ft=[0]*tl

	xy = [[0]*2 for _ in range(n)]
	for i in range(n):
		xy[i] = [int(item) for item in input().split()]
	xy.sort(key=itemgetter(0))
	yxi = [y for x, y in xy]

	*YS, = set(yxi)
	YS.sort()
	yxi= list(map({e: i for i, e in enumerate(YS)}.__getitem__, yxi))

	ct=[0]*(n+1)
	ct[0]=1
	for i in range(1,n+1):
		ct[i]=ct[i-1]*2%md

	cnt=tuple(ct)

	def upd(i):
		i+=1
		while(i<=n):
			ft[i]+=1
			i+=i&-i

	def get(i):
		i+=1
		ret=0
		while(i!=0):
		    ret+=ft[i]
		    i-=i&-i
		return ret

	def calc(get,upd):
		for i, y in enumerate(yxi):
			v = get(y); upd(y)
			p1 = cnt[v]; p0 = cnt[y - v]
			q1 = cnt[i - v]; q0 = cnt[(n - y - 1) - (i - v)]
			yield (p0 + p1 + q0 + q1 - (p0 + q1) * (p1 + q0)) % md


	print((sum(calc(get,upd))+n*cnt[n] - n)%md)

main()


Verdicts: Runtime Error

Accepted
Problem: We have a set S of N points in a two-dimensional plane. The coordinates of the i-th point are (x_i, y_i). The N points have distinct x-coordinates and distinct y-coordinates.  For a non-empty subset T of S, let f(T) be the number of points contained in the smallest rectangle, whose sides are parallel to the coordinate axes, that contains all the points in T. More formally, we define f(T) as follows:    * f(T) :=  (the number of integers i (1 \leq i \leq N) such that a \leq x_i \leq b and c \leq y_i \leq d, where a, b, c, and d are the minimum x-coordinate, the maximum x-coordinate, the minimum y-coordinate, and the maximum y-coordinate of the points in T)  Find the sum of f(T) over all non-empty subset T of S. Since it can be enormous, print the sum modulo 998244353.

Submission attempts (in order):
import sys
def solve():
    readline = sys.stdin.readline
    N = int(readline())
    P = [list(map(int, readline().split())) for i in range(N)]

    P.sort()

    Y = [y for x, y in P]

    def compress(X):
        *XS, = set(X)
        XS.sort()
        return list(map({e: i for i, e in enumerate(XS)}.__getitem__, X))
    Y = compress(Y)

    data = [0]*(N+1)
    def add(k, x):
        while k <= N:
            data[k] += x
            k += k & -k
    def get(k):
        s = 0
        while k:
            s += data[k]
            k -= k & -k
        return s

    def gen(add, get):
        MOD = 998244353
        pow2 = [1]*N
        r = 1
        for i in range(1, N):
            pow2[i] = r = r * 2 % MOD

        for i, y in enumerate(Y):
            v1 = get(y+1); v0 = y - v1
            w1 = i - v1; w0 = (N - y - 1) - w1
            add(y+1, 1)
            p1 = pow2[v1] - 1; p0 = pow2[v0] - 1
            q1 = pow2[w1] - 1; q0 = pow2[w0] - 1
            yield (2 * ((p1+1)*(p0+1) % MOD)*((q1+1)*(q0+1) % MOD) % MOD) - (1 + p0 + p1 + q0 + q1 + p0 * (p1 + q0) + (p1 + q0) * q1) % MOD
    print(sum(gen(add, get)) % MOD)
solve()

import sys
def solve():
    readline = sys.stdin.readline
    write = sys.stdout.write
    MOD = 998244353

    N = int(readline())
    P = [list(map(int, readline().split())) for i in range(N)]

    P.sort()

    Y = [y for x, y in P]

    def compress(X):
        *XS, = set(X)
        XS.sort()
        return list(map({e: i for i, e in enumerate(XS)}.__getitem__, X))
    Y = compress(Y)

    data = [0]*(N+1)
    def add(k, x):
        while k <= N:
            data[k] += x
            k += k & -k
    def get(k):
        s = 0
        while k:
            s += data[k]
            k -= k & -k
        return s

    pow2 = [1]*(N+1)
    r = 1
    for i in range(1, N+1):
        pow2[i] = r = r * 2 % MOD

    def gen(add, get, pow2):
        for i, y in enumerate(Y):
            v = get(y+1); add(y+1, 1)
            p1 = pow2[v]; p0 = pow2[y - v]
            q1 = pow2[i - v]; q0 = pow2[(N - y - 1) - (i - v)]
            yield (p0 + p1 + q0 + q1 - (p0 + q1) * (p1 + q0)) % MOD
    write("%d\n" % ((sum(gen(add, get, pow2)) + N*pow2[N] - N) % MOD))
solve()

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
inputs = input().split()
a = int(inputs[0])
b = int(inputs[1])
if abs(a - b) % 2 = 0:
  print( (a + b) / 2 )
else:
  print('IMPOSSIBLE')


inputs = input().split()
a = int(inputs[0])
b = int(inputs[1])
if (a - b) % 2 == 0:
  print( (a + b) / 2 )
else:
  print('IMPOSSIBLE')


inputs = input().split()
a = int(inputs[0])
b = int(inputs[1])
if (a - b) % 2 = 0:
  print( (a + b) / 2 )
else:
  print('IMPOSSIBLE')


inputs = input().split()
a = int(inputs[0])
b = int(inputs[1])
if (a - b) % 2 == 0:
  print( int((a + b) / 2 ))
else:
  print('IMPOSSIBLE')


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A, B = map(int, input().split())
print(abs(A-B)//2)


A, B = map(int, input().split())
if (A+B)%2==0:
    print((A+B)//2)
else:
    print('IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())
if (a+b)%2 == 0:
    print(a+b)/2
else:
    print("IMPOSSIBLE")


a,b=map(int,input().split())
if (a+b)%2 == 0:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")


Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B=map(int,input().split())

if (A+B)%2==0:
    print((A+B)/2)
else:
    print('IMPOSSIBLE')

A,B=map(int,input().split())

if (A+B)%2==0:
    print(int((A+B)/2))
else:
    print('IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B=map(int,input().split())

K=abs(A+B)/2

if abs(A+B) % 2 == 0:
	print(K)
else:
	print("IMPOSSIBLE")

A,B=map(int,input().split())

K=abs(A+B)/2

if abs(A+B) % 2 == 0;
	print(K)
else;
	print("IMPOSSIBLE")

A,B=map(int,input().split())

K=(B-A)/2

if (B-A) % 2 == 0;
	print(K)
else;
	print("IMPOSSIBLE")

A,B=map(int,input().split())

K=abs(A+B)/2

if abs(A+B) % 2 == 0:
  print(int(K))
else:
  print("IMPOSSIBLE")

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B = map(int, input().split())
K2 = abs(A-B)
if K2%2 == 0:
    print(int(K2/2) )
else:
    print("IMPOSSIBLE")

A,B = map(int, input().split())
K2 = abs(A-B)
if K2%2 == 0:
    print(int(max(A,B) - K2/2) )
else:
    print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
s = [int(x) if x!='?' else -1 for x in input()]

mod = 1000000007
length = len(s)
ans = list([0]*13 for i in range(length+1))
ans[0][0] = 1

mod_x10 = [0]*13
for i in range(13):
    mod_x10[i] = i * 10 % 13 - 1

for i in range(length):
    for j in range(13):
        x = mod_x10[j]
        if s[i] == -1:
            for k in range(10):
                x = (x + 1) % 13
                ans[i+1][x] += ans[i][j] % mod
        else:
            x = (x + int(s[i]) + 1) % 13
            ans[i+1][x] += ans[i][j] % mod

print('a')
print(ans[length][5] % mod)


a,b = map(int,input().split())

if (a + b) % 2 == 0:
    print((a+b)/2)
else:
    print(IMPOSSIBLE)


s = input()

mod = 1000000007
length = len(s)
ans = list([0]*13 for i in range(length+1))
ans[0][0] = 1

for i in range(length):
    for j in range(13):
        x = j*10 % 13 - 1
        if s[i] == '?':
            for k in range(10):
                x = (x + 1) % 13
                ans[i+1][x] += ans[i][j]
        else:
            x = (x + int(s[i]) + 1) % 13
            ans[i+1][x] += ans[i][j]

print(ans[length][5] % mod)


s = [int(x) if x!='?' else -1 for x in input()]

mod = 1000000007
length = len(s)
ans = list([0]*13 for i in range(length+1))
ans[0][0] = 1

mod_x10 = [0]*13
for i in range(13):
    mod_x10[i] = i * 10 % 13 - 1

for i in range(length):
    for j in range(13):
        x = mod_x10[j]
        if s[i] == -1:
            for k in range(10):
                x = (x + 1) % 13
                ans[i+1][x] += ans[i][j] % mod
        else:
            x = (x + int(s[i]) + 1) % 13
            ans[i+1][x] += ans[i][j] % mod

print(ans[length][5] % mod)
print('a')


a,b = map(int,input().split())

if (a + b) % 2 == 0:
    print((a+b)//2)
else:
    print('IMPOSSIBLE')


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())
if a+b/2:
  print("IMPOSSIBLE")
else:
  print(a+b/2)

a,b=map(int,input().split())
if a+b%2:
  print("IMPOSSIBLE")
else:
  print(a+b/2)

a,b=map(int,input().split())
if (a+b)%2:
  print("IMPOSSIBLE")
else:
  print((a+b)/2)

a,b=map(int,input().split())
if (a+b)%2:
  print("IMPOSSIBLE")
  
else:
  print(int((a+b)/2))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
length = int(input())
list_p = list(map(int,input().split()))
#list_p.sort()
count = 0
for i in range(length):
  if list_p[i] != (i+1):
    count += 1
 
if count <= 2 :
  print ("YES")
else :
  print ("NO")

n = int(input())
p = list(map(int,input().split()))
cnt = 0
for i in range(n):
  if p[i] != (i+1):
    cnt += 1
print("YES" if cnt == 0 or cnt == 2 else "NO") 

A,B = map(int, input().split())
if (A + B) % 2 == 0 :
  print ((A + B) // 2)
else :
  print ("IMPOSSIBLE")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
# n,m = map(int,input().split())
n = int(input())
# n = input()
a = list(map(int,input().split()))
b = list(map(int,input().split()))
cnt = 0
left = 0
for i in range(n):
    a1,b1 = a[i],b[i]
    if a1 <= b1 + left:
        cnt += a1
        left = min(b1 - a1 + left,b1)
    else:
        cnt += b1 + left
        left = 0
if a[n] <= left:
    cnt += a[n]
else:
    cnt += left
print(cnt)


n,m = map(int,input().split())
# n = int(input())
# n = input()
if (n + m) % 2 == 0:
    print((n + m) // 2)
else:
    print('IMPOSSIBLE') 

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
#!/usr/bin/env python3
# N = int(input())
# S = input()
A, B = map(int, input().split())
# A = list(map(int, input().split()))
if (A + B) % 2 == 0:
    print((A + B)) // 2)
else:
    print("IMPOSSIBLE")

#!/usr/bin/env python3
# N = int(input())
# S = input()
A, B = map(int, input().split())
# A = list(map(int, input().split()))
if (A + B) % 2 == 0:
    print((A + B) // 2)
else:
    print("IMPOSSIBLE")

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())

if (a-b)%2==0:
    print(int(abs((a-b)/2)))
else:
    print("IMPOSSIBLE")

a,b=map(int,input().split())

if (a-b)%2==0:
    print(int(abs(  ((a+b)/2)   )))
else:
    print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B = map(int, input().split())
# R = int(input())
# B = int(input())
# C = int(input())
# b = input()
print((A + B) / 2 if (A + B) % 2 == 0 else "IMPOSSIBLE")

A,B = map(int, input().split())
# R = int(input())
# B = int(input())
# C = int(input())
# b = input()
print((A + B) // 2 if (A + B) % 2 == 0 else "IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int, input().split())
ans="IMPOSSIBLE"
if a%b==0:
	ans=(a+b)/2
print(ans)

a,b = map(int, input().split())
ans="IMPOSSIBLE"
if (a+b)%2==0:
	ans=(a+b)//2
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().sprit())


if (a + b) % 2 == 0:
    print((a+b)//2)
else:
    print('IMPOSSIBLE')

a, b = map(int, input().split())


if (a + b) % 2 == 0:
    print((a+b)//2)
else:
    print('IMPOSSIBLE')

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int, input().split())
sum = a + b
print(sum / 2 if sum % 2 == 0 else "IMPOSSIBLE")

a,b = map(int, input().split())
sum = a + b
print(sum // 2 if sum % 2 == 0 else "IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split());print((a+b)/2 if (a+b)%2==0 else "IMPOSSIBLE")

a,b=map(int,input().split())
print((a+b)/2 if (a+b)%2==0 else "IMPOSSIBLE")

a,b=map(int,input().split())
print((a+b)//2 if (a+b)%2==0 else "IMPOSSIBLE")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
def main():
    a, b = map(int, input().split())
    if a % 2 and b % 2:
        print((a+b)/2)
    else:
        print('IMPOSSIBLE')
main()

import math

def main():
    a, b = map(int, input().split())
    if ((a % 2) == 0 and (b % 2) == 0) or ((a % 2) == 1 and (b % 2) == 1):
        print(math.floor((a+b)/2))
    else:
        print('IMPOSSIBLE')
main()

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
t = sum(map(int, input())
if t % 2 == 0:
    print(t//2)
else:
    print("IMPOSSIBLE")

t = sum(map(int, input().split()))
if t % 2 == 0:
        print(t//2)
else:
        print("IMPOSSIBLE")


Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B=map(int,input().split())
K=(A+B)/2
if(K.is_integer()==True):
  print(K)
else:
  print("Impossible")

A,B=map(int,input().split())
K=(A+B)/2
if(K.is_integer()==True):
  print(int(K))
else:
  print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())
c = abs(a - b) 
if c % 2 != 0:
    print("IMPOSSIBLE")
else:
    print(min(a, b) + c / 2)

a, b = map(int, input().split())
c = abs(a - b) / 2
s = abs(max(a, b) - c)
if (a + b) % 2 == 1:
    print('IMPOSSIBLE')
else:
    print(s)
#print(abs(max(a, b) - c))

a, b = map(int, input().split())
c = abs(a - b) 
if c % 2 != 0:
    print("IMPOSSIBLE")
else:
    print(int(min(a, b) + c / 2))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())
if abs(a-b)%2==0:
  print(abs(a-b)//2)
else:
  print("IMPOSSIBLE")

a,b=map(int,input().split())
if abs(a-b)%2==0:
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split( ))
s = a + b
if s %2 ==1:
  print('IMPOSSIBLE')
else;
print(s//2)

a, b = map(int, input().split( ))
s = a + b
if s %2 ==1:
  print('IMPOSSIBLE')
else:
  print(s//2)


Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = input()

a,b=map(int, input().split())


if (a + b) % 2 === 0:
  print((a + b) // 2)
else:
  print("IMPOSSIBLE")

from sys import stdin

n = int(stdin.readline().rstrip())

print(n)

a,b=map(int, input().split())

c = a + b

if c % 2 == 0:
  print(c)
else:
  print('IMPOSSIBLE')
  

n = input()

a,b = n[0], n[1]

if (a + b) % 2 === 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")

a,b=map(int, input().split())
     
     
if (a + b) % 2 === 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")

a, b = map(int, input().split())

if (a + b) % 2 === 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")

a,b = (int(i) for i in input().split())
     
     
if (a + b) % 2 === 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")

a = input()

from sys import stdin

n = int(stdin.readline().rstrip())

a, b = n[0], n[1]

if (a + b) % 2 === 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")

a, b = map(int, input().split())

a, b = map(int, input().split())

if (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int,input().split())
if (a + b) % 2 == 0:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")

a,b = map(int,input().split())
if (a + b) % 2 == 0:
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
AB = int(input().split())

A = AB[0]
B = AB[1]

if A%2 == 0 and B%2 == 0:
  print((A+B)/2)
  
elif A%2 == 1 and B%2 ==1:
  print((A+B)/1)
  
else:
  print("IMPOSSIBLE")

AB = list(map(int, input().split()))
 
A = int(AB[0])
B = int(AB[1])
 
if A%2 == 0 and B%2 == 0:
    print((A+B)/2)
elif A%2 == 1 and B%2 == 1:
    print((A+B)/1)
else:
    print("IMPOSSIBLE")

AB = list(map(int, input().split()))
 
A = int(AB[0])
B = int(AB[1])
 
if A%2 == 0 and B%2 == 0:
    print(int((A+B)/2))
elif A%2 == 1 and B%2 == 1:
    print(int((A+B)/2))
else:
    print("IMPOSSIBLE")

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split(" "))
print(int(abs((a-b)/2)) if abs((a-b)/2)%1==0 else "IMPOSSIBLE")

a, b = map(int, input().split(" "))
print(int(abs((a+b)/2)) if abs((a+b)/2)%1==0 else "IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b= map(int, input().split())
if (a+b)%2==0:
  print((a+b)/2)
else:
  print('IMPOSSIBLE')


a, b= map(int, input().split())
if (a+b)%2==0:
  k=(a+b)/2
  print(k)
else:
  print('IMPOSSIBLE')


a, b= map(int, input().split())
if (a+b)%2==0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = (int(i) for i in input().split())
if a+b % 2 == 0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')

a, b = (int(i) for i in input().split())
if (a+b) % 2 == 0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
N = int(input())
k = 0
lis = list(range(1, N+1))
for i in range(1, N+1):
  a = int(input())
  if a == lis[i-1]:
    k += 10
  else:
    k += 0
if k >= 10 * (N-2):
  print('YES')
else:
  print('NO')



, B = map(int, input().split())
 
if A > B:
  for i in range(A):
    k = abs(A - i)
    l = abs(B - i)
    if k == l:
      print(i)
  else:
    print('IMPOSSIBLE')
if A < B:
  for i in range(B):
    k = abs(A - i)
    l = abs(B - i)
    if k == l:
      print(i)
  else:
    print('IMPOSSIBLE')
    
      

A, B = map(int, input().split())
 
if A > B:
  for i in range(A):
    k = abs(A-i)
    l = abs(B-i)
    if k == l:
      print(i)
  else:
    print('IMPOSSIBLE')
if A < B:
  for i in range(B):
    k = abs(A-i)
    l = abs(B-i)
    if k == l:
      print(i)
  else:
    print('IMPOSSIBLE')


A, B = map(int, input().split())

if A > B:
  for i in range(A):
    k = abs(A - i)
    l = abs(B - i)
    if k == l:
      print(i)
    else:
      print('IMPOSSIBLE')

if A < B:
  for i in range(B):
    k = abs(A - i)
    l = abs(B - i)
    if k == l:
      print(i)
    else:
      print('IMPOSSIBLE')
    
      


A, B = map(int, input())

if abs(A - K) == abs(B - K):
  print(K)
else:
  print('IMPOSSIBLE')

A, B = map(int, input().split())

for i in range(10**9):
  k = abs(A - i)
  l = abs(B - i)
  if k == l:
    print(k)
  else:
    print('IMPOSSIBLE')

A, B = map(int, input().split())

if A > B:
  for i in range(A):
    k = abs(A-i)
    l = abs(B-i)
    if k == l:
      print(i)
  else:
    print('IMPOSSIBLE')

if A < B:
  for in in range(B):
    k = abs(A-i)
    l = abs(B-i)
    if k == l:
      print(i)
  else:
    print('IMPOSSIBLE')

A, B = map(int, input().split())

for i in range(5*10**8):
  k = abs(A - i )
  l = abs(B - i)
  if k == l:
    print(k)
  else:
    print('IMPOSSIBLE')

A, B = map(int, input().split())
 
if (A + B)%2 == 0:
  k = (A + B)/2
  print(round(k))
else:
  print('IMPOSSIBLE')



Verdicts: Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Time Limit Exceeded

Runtime Error

Time Limit Exceeded

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b,c = map(int,input().split())
s=c-(a-b)
if s>0:
  print(s)
else:
  print('0')

A,B = map(int,input().split())
K=(A+B)/2
if K%1==0:
  print(K)
else:
  print('IMPOSSIBLE')

A,B = map(int,input().split())
K=(A+B)/2
if K%1==0:
  print(int(K))
else:
  print('IMPOSSIBLE')

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
p,q=map(int,input().split())
if (p-q)%2==1:
  print("IMPOSSIBLE")
else:
  print(abs((p-q)//2))

p,q=map(int,input().split())
if (p-q)%2==1:
  print("IMPOSSIBLE")
else:
  print((p+q)//2)

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B = map(int,input().split())

k = (A + B) / 2

answer = 0
if A - k >= 0 and -B + k >=0 :
	answer = 1
    
elif -A + k >=0 and B - k >= 0 :
	answer = 1 
    
if answer == 1 and (A + B) % 2 == 0  :
	print(k)
else :
	print("IMPOSSIBLE")

A,B = map(int,input().split())

k = (A + B) / 2

answer = 0
if A - k >= 0 and -B + k <=0 :
	answer = 1
    
elif -A + K <=0 and B - k >= 0 :
	answer = 1 
    
if anaswer == 1 and (A + B) % 2 == 0  :
	print(k)
else :
	print("IMPOSSIBLE")

A,B = map(int,input().split())

k = (A + B) / 2

answer = 0
if A - k >= 0 and -B + k <=0 :
	answer = 1
    
elif -A + k <=0 and B - k >= 0 :
	answer = 1 
    
if answer == 1 and (A + B) % 2 == 0  :
	print(k)
else :
	print("IMPOSSIBLE")

A,B = map(int,input().split())

k = (A + B) / 2

answer = 0

if A != B and (A + B) % 2 == 0 and (A - k) * (B - k) < 0:
	print(int(k))
else:
	print("IMPOSSIBLE")

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A, B = map(int, input().split())

if A + B % 2 == 0:
    print((A+B)//2)
else:
    print("IMPOSSIBLE")


A, B = map(int, input().split())

if (abs(A) + abs(B)) % 2 == 0:
    print((abs(A)+abs(B))//2)
else:
    print("IMPOSSIBLE")


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())
k=(a+b)/2
if int(k)==k:
  print(k)
else:
  print("IMPOSSIBLE")

a,b=map(int,input().split())
k=(a+b)/2
if k.is_integer():
  print(k)
else:
  print("IMPOSSIBLE")

a,b=map(int,input().split())
k=(a+b)/2
if k.is_integer():
  print(int(k))
else:
  print("IMPOSSIBLE")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=(int(x) for x in input().split())
k = abs((a - b)/2)
if k.is_integer() == True:
    print(int(k))
else :
    print('IMPOSSIBLE')

a,b=(int(x) for x in input().split())
k = (a+b)/2
if int(k.is_integer()) == True:
    print(int(k))
else :
    print('IMPOSSIBLE')
    

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A, B = (int(x) for x in input().split())
K = (A + B) / 2
if A == B:
  print(0)
else:
  if isinstance(K, int):
    print(K)
  else:
    print('IMPOSSIBLE')

A, B = (int(x) for x in input().split())
K = (A + B) / 2
if A == B:
  print(0)
else:
  if K.is_integer():
    print(int(K))
  else:
    print('IMPOSSIBLE')


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())
k=(a+b)/2
if (a+b)%2==0:
    print(k)
else:
    print('IMPOSSIBLE')
    

a,b=map(int,input().split())
k=(a+b)//2
if (a+b)%2==0:
    print(k)
else:
    print('IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())  

if (a+b)%2==0:
    print((a + b) / 2)
else:
    print("IMPOSSIBLE")

a, b = map(int, input().split())  

if (a+b)%2==0:
    print(int((a + b) / 2))
else:
    print("IMPOSSIBLE")

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=(int(x) for x in input().split())

print("IMPOSSIBLE" if (a+b)%2==1 else (a+b)/2)

a,b=(int(x) for x in input().split())

print("IMPOSSIBLE" if (a+b)%2==1 else (a+b)//2)

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug  9 22:36:19 2019

@author: kohei
"""

N = input()

A = int(N.split()[0])
B = int(N.split()[1])

if A==B:
    print('IMPOSSIBLE')

else:
    if (A+B)%2==0:
        print((A+B)/2)
    
    else:
        print('IMPOSSIBLE')
    


#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug  9 22:36:19 2019

@author: kohei
"""

N = input()

A = int(N.split()[0])
B = int(N.split()[1])

if A==B:
    print('IMPOSSIBLE')

else:
    if (A+B)%2==0:
        print(int((A+B)/2))
    
    else:
        print('IMPOSSIBLE')
    


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A, B = map(int, input().split())

if (a - b) % 2 == 0:
  r = int(abs(a - b)/2 + min(a, b) )
else:
  r = 'IMPOSSIBLE'
print(r)

a, b = map(int, input().split())
 
if (a - b) % 2 == 0:
  r = int(abs(a - b)/2 + min(a, b))
else:
  r = 'IMPOSSIBLE'
print(r)

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int,input().split())
k = 'IMPOSSIBLE'
if ((a+b)/2) % 2 == 0:
  k = (a+b)//2
print(k)

a,b = map(int,input().split())
k = 'IMPOSSIBLE'
if a != b and ((a+b)/2) % 2 == 0:
  k = (a+b)//2
print(k)

a,b = map(int,input().split())
k = 'IMPOSSIBLE'
if a != b and (a+b)%2 == 0:
  k = (a+b)//2
print(k)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A, B = map(int, input().split())
dif = abs(A - B)
print(dif//2 if dif%2==0 else 'IMPOSSIBLE')

A, B = map(int, input().split())
dif = abs(A - B)
print(min(A, B) + dif//2 if dif%2==0 else 'IMPOSSIBLE')

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a = int(input())
b = int(input())

if (a + b) % 2 != 0:
    print("IMPOSSIBLE")
else:
    if a < b:
        A = a
        B = b
    else:
        A = b
        B = a

    K = int(B - (B - A) / 2)
    print(str(K))


N = int(input())
Nlist = [int(i) for i in input().split()]

sum = 0
cnt = 0
for i in range(N):
    if cnt > 2:
        break

    if Nlist[i] == (i + 1):
        continue
    else:
        sum += Nlist[i]
        cnt += 1

if cnt == 0 or sum == (N + 1):
    print("YES")
else:
    print("NO")

a, b = map(int, input().split())

if a < b:
    A = a
    B = b
else:
    A = b
    B = a

if (B - A) % 2 != 0:
	print("IMPOSSIBLE")
else: 
	K = int(B - (B - A) / 2)
	print(str(K))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A=input() 
a=int(A)
B=input() 
b=int(B)
K=(b+a)/2
k=int(K)
if((b+a)%2==0):
    print(k)
if((b+a)%2!=0):
    print("IMPOSSIBLE")


A,B=input().split()
a=int(A)
b=int(B)
K=(b+a)/2
k=int(K)
if((b+a)%2==0):
    print(k)
if((b+a)%2!=0):
    print("IMPOSSIBLE")

Verdicts: Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int, input().split())

if (a+b)%2 == 0:
    print((a+b)/2)
else:
    print("IMPOSSIBLE")

a,b = map(int, input().split())

if (a+b)%2 == 0:
    print(int((a+b)/2))
else:
    print("

a,b = map(int, input().split())

if (a+b)%2 == 0:
    print((a+b)/2)
else
    print("IMPOSSIBLE")

a,b = map(int, input().split())

if (a+b)%2 == 0:
    print(int(a+b)/2)
else:
    print("IMPOSSIBLE")

a,b = list(map(int,input().split()))
if (a+b)%2 == 0:
  print((a+b)//2)
else:
  print("IMPOSSIBLE")

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = [int(i) for i in input().split(" ")]
print("IMPOSSIBLE" if (a+b)%2 else (a+b)/2)

a, b = [int(i) for i in input().split(" ")]
print("IMPOSSIBLE" if (a+b)%2 else (a+b)/2)

n = int(input())
a = [int(i) for i in input().split()]
q = 0
for i in range(n):
 for j in range(i+1, n):
  t = a[i]
  a[i] = a[j]
  a[j] = t
  f = 1  
  lst = - 1100
  for k in a:
   f &= k > lst
   lst = k
  q |= f
  t = a[i]
  a[i] = a[j]
  a[j] = t
print("YES" if q else "NO")


a, b = [int(i) for i in input().split(" ")]
print("IMPOSSIBLE" if (a+b)%2 else (a+b)//2)


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
# -*- coding: utf-8 -*-

a, b = map(int, input().split())

print((a+b)/2 if (a+b)%2==0 else 'IMPOSSIBLE')


# -*- coding: utf-8 -*-

a, b = map(int, input().split())

print((a+b)//2 if (a+b)%2==0 else 'IMPOSSIBLE')


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B = map(int,input().split())
print((A+B)/2) if (A+B) % 2 == 0 else print('IMPOSSIBLE') 

A,B = map(int,input().split())
print((A+B)//2) if (A+B) % 2 == 0 else print('IMPOSSIBLE') 


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int,input().split())
for i in range(1000000000):
    if abs(a-i)==abs(b-i):
        print(i)
else:
    print("IMPOSSIBLE")

n=int(input())
seqs =list(map(int,input().split()))
count = 0
for i in range(1,n+1):
    if i != seqs[i]:
        count += 1
if count <= 2:
    print("YES")
else:
    print("NO")

a,b = map(int,input().split())
if (a-b)%2==0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")

Verdicts: Time Limit Exceeded

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):

A, B = map(int, input().split())

if (A+B) % 2 == 1:
    print('IMPOSSIBLE')
else:
    print((A+B)/2)

N = int(input())
p = list(map(int, input().split()))

k = 0
counter = 1
for e in p:
    if e == counter:
        counter += 1
    else:
        k += 1
        counter += 1

if k <= 2:
    print('YES')
else:
    print('NO')


A, B = map(int, input().split(" "))

if (A+B) % 2 == 1:
    print('IMPOSSIBLE')
else:
    print((A+B)/2)


A, B = map(int, input().split(" "))

if (A+B) % 2 == 1:
    print('IMPOSSIBLE')
else:
    print((A+B)/2)


A, B = map(int, input().split())

if (A+B) % 2 == 1:
    print('IMPOSSIBLE')
else:
    print((A+B)/2)

A, B = map(int, input().split())

if (A+B) % 2 == 1:
    print('IMPOSSIBLE')
else:
    print(int((A+B)/2))

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())

if ((a - b) / 2 ) % 2 == 0:
    print((a - b) / 2 )
else:
    print("IMPOSSIBLE")

a, b = map(int, input().split())

if ((a - b) / 2 ) % 2 == 0:
    print((a + b) / 2 )
else:
    print("IMPOSSIBLE")

a, b = map(int, input().split())

if ((a - b) / 2 ) % 2 == 0:
    print((a + b) // 2 )
else:
    print("IMPOSSIBLE")

a, b = map(int, input().split())

if (a - b) % 2 == 0:
    print((a + b) // 2 )
else:
    print("IMPOSSIBLE")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())

if a+b % 2 == 0:
  print(int(a+b)/2)
else:
  print('IMPOSSIBLE')

a, b = map(int, input().split())

if (a+b) % 2 == 0:
  print(int(a+b)/2)
else:
  print('IMPOSSIBLE')

a, b = map(int, input().split())

if (a+b) % 2 == 0:
  print(int((a+b)/2))
else:
  print('IMPOSSIBLE')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
#135  Harmony
A,B = map(int, input().split())
print((A+B)/2 if (A+B)%2 == 0 else 'IMPOSSIBLE')

A,B = map(int, input().split())
print((A+B)/2 if (A+B)%2 == 0)

#135  Harmony
A,B = map(int, input().split())
print((A+B)//2 if (A+B)%2 == 0 else 'IMPOSSIBLE')

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):

a,b = map(int,input().split())

if ((a+b)/2) % 1 == 0:
    print((a+b)/2)
else:
    "IMPOSSIBLE"



a,b = map(int,input().split())

if ((a+b)/2) % 1 == 0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")


Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
import random

r = random.randint(1,3)
if r == 0:
  # TLE
  import time
  time.sleep(100000)
elif r == 1:
  # MLE
  x = '01234567' * (1 << 27)
else:
  # RE
  RE


import random
r = random.randint(1,3)

if r == 1:
  # TLE
  import time
  time.sleep(5)
elif r == 2:
  # MLE
  x = '01234567'
  x *= (1 << 27)
else:
  # RE
  RE


import numpy as np
A=np.ones(1<<27,dtype=np.int64)

import random

r = random.randint(1,3)
if r == 1:
  # TLE
  import time
  time.sleep(100000)
elif r == 2:
  # MLE
  x = '01234567' * (1 << 27)
else:
  # RE
  RE


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A,B = map(int,read().split())

q,r = divmod(A+B,2)

if r == 1:
    print('IMPOSSIBLE')
else:
    print(q)

Verdicts: Memory Limit Exceeded

Runtime Error

Memory Limit Exceeded

Memory Limit Exceeded

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int,input().split())
d = abs(a+b)
if d %2 ==1:
  print('IMPOSSIBLE')
else:
  print(d/2)

a,b = map(int,input().split())
d = a+b
if d %2 ==1:
  print('IMPOSSIBLE')
else:
  print(d/2)

a,b = map(int,input().split())
d = a+b
if d %2 ==1:
  print('IMPOSSIBLE')
else:
  print(int(d/2))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
n = int(input())
num = [int(i) for i in input().split()]
flag = 0
if num == sorted(num):
  flag = 1
else:  
  sorted_num = sorted(num)
  for i in range(n):
    if flag == 1:
      break
    for j in range(n-i-1):
      temp = num[i]
      num[i] = num[i+j+1]
      num[i+j+1] = temp
      if num == sorted_num:
        flag = 1
        break
      else:
        temp = num[i]
        num[i] = num[i+j+1]
        num[i+j+1] = temp
if flag == 1:
  print('YES')
else:
  print('NO')

num = [input() for i in range(2)]
k = (num[0] + num[1]) / 2
if k > int(k):
  print(IMPOSSIBLE)
else:
  print(k)

num = [int(i) for i in input().split()]
k = (num[0] + num[1]) / 2
if k > int(k):
  print('IMPOSSIBLE')
else:
  print(int(k))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a, b = map(int, input().split())

if (max(a,b) - min(a,b)) % 2 == 1:
  print("IMPOSSIBLE")
else:
  print((a+b)/2)

a, b = map(int, input().split())

if (max(a,b) - min(a,b)) % 2 == 1:
  print("IMPOSSIBLE")
else:
  print(int((a+b)/2))

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
A,B = map(int, input().split())
if A+B % 2 == 0:
  print((A+B)//2)
else:
  print("IMPOSSIBLE")
  

A,B = map(int, input().split())
if (A+B) % 2 == 0:
  print((A+B)//2)
else:
  print("IMPOSSIBLE")
  

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b=map(int,input().split())

if ((a+b)%2==1):
  print("IMPOSSIBLE")

else:
  print((a+b)/2)


a,b=map(int,input().split())

if (a+b)%2==1:
  print("IMPOSSIBLE")

else:
  print((a+b)/2)

a,b=map(int,input().split())

if ((a+b)%2==1):
  print("IMPOSSIBLE")

else:
  print((a+b)//2)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
a,b = map(int,input().split())
m = a - b
if m % 2 == 1:
  print('IMPOSSIBLE')
else:
  print(abs(m//2))

a,b = map(int,input().split())
m = a + b
if m % 2 == 1:
  print('IMPOSSIBLE')
else:
  print(abs(m//2))

Verdicts: Wrong Answer

Accepted
Problem: We have two distinct integers A and B.  Print the integer K such that |A - K| = |B - K|.  If such an integer does not exist, print `IMPOSSIBLE` instead.

Submission attempts (in order):
# -*- coding: utf-8 -*-

def main():

    A, B = map(int, input().split())

    if (A + B) % 2 == 0:
        ans = (A + B) / 2

    else:
        ans = 'IMPOSSIBLE'

    print(ans)


if __name__ == "__main__":
    main()

# -*- coding: utf-8 -*-

def main():

    A, B = map(int, input().split())

    if (A + B) % 2 == 0:
        ans = (A + B) // 2

    else:
        ans = 'IMPOSSIBLE'

    print(ans)


if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Accepted