TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively.  Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other.  Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.

Submission attempts (in order):
from fractions import gcd
from functools import reduce


N, K = map(int, input().split())
A = list(map(int, input().split()))
g = reduce(gcd, A)
if K <= max(A) and K % g == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


from itertools import accumulate


N, *A = map(int, open(0).read().split())
A.sort()
acc = list(accumulate(A))
ans = N
for i in range(N - 1):
    if 3 * acc[i] < acc[i + 1]:
        ans = N - i - 1
print(ans)


Verdicts: Runtime Error

Accepted
Problem: Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively.  Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other.  Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.

Submission attempts (in order):
n=int(input())
l=sorted(list(map(int,input().split())))
ans,s=0,0
for u in l:
  if 2*s>=u:ans+=1
  s+=u
print(ans)

n=int(input())
l=sorted(list(map(int,input().split())))
ans,s=1,0
for u in l:
  if 2*s>=u:ans+=1
  else:ans=1
  s+=u
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively.  Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other.  Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.

Submission attempts (in order):
n=int(input())
A=list(map(int,input().split()))
saisho=10**15
cnt=0
for i in range(n):
    if  A[i]<saisho/2:
        saisho=A[i]
    else:
        cnt+=1
print(cnt)

n=int(input())
A=list(map(int,input().split()))
A.sort()
cnt=1
cum=0
for i in range(n-1):
    cum+=A[i]
    if A[i+1]-2*cum<=0:
        cnt+=1
    else:
        cnt=1
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
N, M= map(float, input().split())
if N > round(M/2):
	print(round(M/2))
else:
	c=N+(M-N*2)//4
	print(c)

	

N, M= map(float, input().split())
if N > round(M/2):
	print(round(M/2))
else:
	c=N+(M-N*2)//4
	print(int(c))


Verdicts: Wrong Answer

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
n,m = map(int, input().split())

if n > (m+n)/3:
    print(m//2)
    exit()

ans = n
m -= 2*n
ans += m//4

n,m = map(int, input().split())

if n > (m+n)/3:
    print(m//2)
    exit()

ans = n
m -= 2*n
ans += m//4
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
def solve():
  n, m = map(int, input().split())
  if m//2 <= n:
    print(m//2)
  else:
    print("ばーか")
  return 0
 
if __name__ == "__main__":
  solve()


def solve():
  n, m = map(int, input().split())
  if m//2 <= n:
    print(m//2)
  else:
    ans = 0
    ans += n
    m = m-n*2
    ans += m//4
    print(ans)
  return 0
 
if __name__ == "__main__":
  solve()


Verdicts: Wrong Answer

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
s,c = map(int,input().split())
res = 0
if s == 1 or c == 1:
    print(0)
    exit()
if s*2 <= c:
    res += s
    c -= s*2
else:
    res += c//2
    c //= 2
print(res+c//4)

s,c = map(int,input().split())
res = 0

if s*2 <= c:
    res += s
    c -= s*2
    res+= c
else:
    res += c//2
    c //= 2
if c:
    res += m//4
print(res)

s,c = map(int,input().split())
res = 0
if s*2 <= c:
    res = s
    c -= s*2
    s = 0
else:
    res += c//2
    c = 0

if c:
    res += c//4
print(res)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
N,M=map(int,input().split())
n1=min(N,M//2)
print(ans+(M-2*n1)//4)


N,M=map(int,input().split())
n1=min(N,M//2)
N-=n1
M-=2*n1
print(ans+(M-2*n1)//4)


N,M=map(int,input().split())
n1=min(N,M//2)
print(n1+(M-2*n1)//4)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
# ARC069c
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)

    n, m = map(int, input().split())
    if n > m*2:
        print(m//2+(n-m//2)//2)
    else:
        print(n)


if __name__ == '__main__':
    main()


# ARC069c
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)

    n, m = map(int, input().split())
    if m > n*2:
        print(n+(m-n*2)//4)
    else:
        print(m//2)


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def POW(x, y):
    if y == 0:
        return 1
    elif y == 1:
        return x
    elif y % 2 == 0:
        return POW(x, y // 2) ** 2 % MOD
    else:
        return POW(x, y // 2) ** 2 * x % MOD
def mod_factorial(x, y): return x * POW(y, MOD - 2) % MOD
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from functools import reduce

def main():
    N, M = LI()
    if N >= 2 * M:
        return M
    rem = 2 * M - N
    ans = M + rem // 3
    return ans

print(main())

import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def POW(x, y):
    if y == 0:
        return 1
    elif y == 1:
        return x
    elif y % 2 == 0:
        return POW(x, y // 2) ** 2 % MOD
    else:
        return POW(x, y // 2) ** 2 * x % MOD
def mod_factorial(x, y): return x * POW(y, MOD - 2) % MOD
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from functools import reduce

def main():
    N, M = LI()
    if N >= M // 2:
        return M // 2
    rem = M - 2 * N
    ans = M // 2 + rem // 3
    return ans

print(main())

import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def POW(x, y):
    if y == 0:
        return 1
    elif y == 1:
        return x
    elif y % 2 == 0:
        return POW(x, y // 2) ** 2 % MOD
    else:
        return POW(x, y // 2) ** 2 * x % MOD
def mod_factorial(x, y): return x * POW(y, MOD - 2) % MOD
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from functools import reduce

def main():
    N, M = LI()
    if N >= M // 2:
        return M // 2
    rem = M - 2 * N
    ans = N + rem // 4
    return ans

print(main())

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
[n,m] = [int(i) for i in input().split()]
if n * 2 >= m:
    print(n)
else:
    if n >= 2:
        ans = n
        m = min(m - n * 2,0)
        ans += m//4
        print(ans)
    else:
        print(0)


[n,m] = [int(i) for i in input().split()]
if n * 2 >= m:
    print(n)
else:
    if m >= 2:
        ans = n
        m = min(m - n * 2,0)
        ans += m//4
        print(ans)
    else:
        print(0)


[n,m] = [int(i) for i in input().split()]
if n * 2 >= m:
    print(m // 2)
else:
    if m >= 2:
        ans = n
        m = max(m - n * 2,0)
        ans += m//4
        print(ans)
    else:
        print(0)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
import sys
N, M = map(int, input().split())
S = [0] * M
C = [0] * M
for i in range(M):
    S[i], C[i] = map(int, input().split())

for i in range(1000):
    string = str(i)
    if len(string) != N:
        continue
    flag = True
    for j in range(M):
        if string[S[j] - 1] == str(C[j]):
            None
        else:
            flag = False
            break
    if flag:
        print(i)
        sys.exit(0)
print("-1")


n,m = map(int,input().split())

if n*2>=m:
    print(m//2)
else:
    tmp=m-n*2
    print(n+tmp//4)

Verdicts: Runtime Error

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
N,M = map(int,inpu().split())

def solve(N,M):
  
  if M < N * 2:
    return N
  
  M -= N * 2
  
  ans = N + M // 3
  return ans

print(solve(N,M))


N,M = map(int,input().split())

def solve(N,M):
  
  if M < N * 2:
    return M // 2
  
  M -= N * 2
  
  ans = N + (M // 4)
  return ans

print(solve(N,M))


Verdicts: Runtime Error

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
n=int(input());s=input();a=['SS','WS','SW','WW']
for i in range(n):
    for j in range(4):a[j]+='SW'[::-1 if s[i]=='o' else 1][a[j][i]==a[j][i+1]]
for i in range(4):
    if a[i][1]==a[i][n+1] and a[i][0] == a[i][n]:print(a[i][1:n+1]);exit()
print(-1)

n,m=map(int,input().split())
print(min((m+2*n),2*m)//2)

n,m=map(int,input().split());print((min(2*n,m)+m)//4)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
N, M = map(int, input().split())
ans = 0
if N > M//2:
  print(M//2)
else:
  p = M - 2*N
  print(N + p//4

N, M = map(int, input().split())
ans = 0
if N > M//2:
  print(M//2)
else:
  p = M - 2*N
  print(N + p//4)

Verdicts: Runtime Error

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n, m = nm()
if m >= 2 * n:
    c = 2 * n - m
    print(n + (c // 4))
else:
    print(n)


import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n, m = nm()
if m >= 2 * n:
    c = m - 2 * n
    print(n + (c // 4))
else:
    print(m // 2)


Verdicts: Wrong Answer

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
from sys import exit, stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
r = M-2*N
if r <= 0:
    print(N//2)
else:
    pritnt(N+r//4)

from sys import exit, stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
r = M-2*N
if r <= 0:
    print(M//2)
else:
    print(N+r//4)

Verdicts: Runtime Error

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
    u, v = map(int, input().split())
    print(min(u//2, (2*u+v)//4))

u, v = map(int, input().split())
print(min(u//2, (2*u+v)//4)

u, v = map(int, input().split())
if 2*u > v:
  print(v//2)  
else:
  print((2*u+v)//4)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
n, m = map(int, input().split())

k = max(m // 2, (n + m // 2) // 2)
print(k)


n, m = map(int, input().split())

k = min(m // 2, (n + m // 2) // 2)
print(k)


Verdicts: Wrong Answer

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
def solve(s, c):
    """rv = min(Sr, Cr//2), where
       Sr = S + a
       Cr = C - 2a  # a>=0, a is number of (2c->S) conversions
       thus
       rv = max(min(S + a, C//2 - a) for a in range(0, C//2))
       if a >=0, optimum is Sr == Cr//2, thus
                            S + a == Cr//2 - a
                            a = (C//2 - S) / 2
    """
    a = (c / 2 - s) / 2
    if a < 0:
        a = 0
    al = int(a)
    ar = int(a) + 1
    return max(min(s + a, c//2 - a) for a in (al, ar))


if __name__ == "__main__":
    import sys
    S, C = sys.stdin.readline().split()
    print(solve(s, c))


def test_solve():
    assert solve(1, 2) == 1
    assert solve(0, 4) == 1
    assert solve(0, 1) == 0


def test_atcode():
    assert solve(1, 6) == 2
    assert solve(12345, 678901) == 175897

def solve(s, c):
    """rv = min(Sr, Cr//2), where
       Sr = S + a
       Cr = C - 2a  # a>=0, a is number of (2c->S) conversions
       thus
       rv = max(min(S + a, C//2 - a) for a in range(0, C//2))
       if a >=0, optimum is Sr == Cr//2, thus
                            S + a == Cr//2 - a
                            a = (C//2 - S) / 2
    """
    a = (c / 2 - s) / 2
    if a < 0:
        a = 0
    al = int(a)
    ar = int(a) + 1
    return max(min(s + a, c//2 - a) for a in (al, ar))


if __name__ == "__main__":
    import sys
    S, C = map(int, sys.stdin.readline().split())
    print(solve(S, C))


def test_solve():
    assert solve(1, 2) == 1
    assert solve(0, 4) == 1
    assert solve(0, 1) == 0


def test_atcode():
    assert solve(1, 6) == 2
    assert solve(12345, 678901) == 175897

Verdicts: Runtime Error

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
N, M = map(int, input().split())
if 2 * N > M:
  print(M // 2)
else:
  C = M // 2
  n = (C - N) // 2
  print(max(min(S+n-1, C-n+1), min(S+n, C-n), min(S+n+1, C-n-1)))

N, M = map(int, input().split())
if 2 * N > M:
  print(M // 2)
else:
  C = M // 2
  n = (C - N) // 2
  print(max(min(N+n-1, C-n+1), min(N+n, C-n), min(N+n+1, C-n-1)))


Verdicts: Runtime Error

Accepted
Problem: Snuke loves puzzles.  Today, he is working on a puzzle using `S`\- and `c`-shaped pieces. In this puzzle, you can combine two `c`-shaped pieces into one `S`-shaped piece, as shown in the figure below:    Snuke decided to create as many `Scc` groups as possible by putting together one `S`-shaped piece and two `c`-shaped pieces.  Find the maximum number of `Scc` groups that can be created when Snuke has N `S`-shaped pieces and M `c`-shaped pieces.

Submission attempts (in order):
n,m=map(int, input().split())
p1=n
p2=m//2
if p1>p2:
 	print(p2)
else:
	delta=p2-p1
    print(delta//2+p1)

n,m=map(int,input().split())
p1=n
p2=m//2
if p1>p2:
 	print(p2)
else:
	delta=p2-p1
    print(delta//2+p1)

n,m=map(int,input().split())
p1=n
p2=m//2
if p1>p2:
 	print(p2)
else:
	delta=p2-p1
    print(delta//2+p1)


n,m=map(int,input().split())
p1=n
p2=m//2
if p1>p2:
    print(p2)
else:
    delta=p2-p1
    print(delta//2+p1)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Snuke, who loves animals, built a zoo.  There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1.  There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies.  Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species.  More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise.  Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`.

Submission attempts (in order):
N = int(input())
s = input()
s += s[0]

def isOK(x, y):
    lst = [-1] * (N+2)
    lst[0] = x
    lst[1] = y
    for i in range(1, N+1):
        if (s[i] == 'o') ^ (lst[i]):    
            lst[i+1] = 1 - lst[i-1]
        else:                       
            lst[i+1] = lst[i-1]
    if lst[0] == lst[-2] and lst[1] == lst[-1]:     
        return lst[:-2]
    else:
        return []

for x in range(2):
    for y in range(2):
        lst = isOK(x, y)
        if len(lst) > 0:
            break

if len(lst) == 0:
    ans = -1
else:
    ans = ''
    for x in lst:
        if x:
            ans += 'S'
        else:
            ans += 'W'
print(ans)


from itertools import product
N = int(input())
s = input()
s += s[0]

def isOK(x, y):
    lst = [-1] * (N+2)
    lst[0] = x
    lst[1] = y
    for i in range(1, N+1):
        if (s[i] == 'o') ^ (lst[i]):    
            lst[i+1] = 1 - lst[i-1]
        else:                       
            lst[i+1] = lst[i-1]
    if lst[0] == lst[-2] and lst[1] == lst[-1]:     
        return lst[:-2]
    else:
        return []

for x, y in product([1,0], repeat=2):
    chk = isOK(x, y)
    if len(chk) > 0:
        break

if len(chk) == 0:
    ans = -1
else:
    ans = ''
    for x in chk:
        if x:
            ans += 'S'
        else:
            ans += 'W'
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Snuke, who loves animals, built a zoo.  There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1.  There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies.  Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species.  More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise.  Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`.

Submission attempts (in order):
import sys

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ri()
S = rs()
d = {'S': 'W', 'W': 'S'}
for x in ['SS', 'SW', 'WS', 'WW']:
    animals = x
    for i in range(N):
        if S[i] == 'o':
            if animals[i+1] == 'S':
                animals += animals[i]
            else:
                animals += d[animals[i]]
        else:
            if animals[i+1] == 'S':
                animals += d[animals[i]]
            else:
                animals += animals[i]
    if animals[0] == animals[-1]:
        print(animals[1:])
        exit()

print(-1)

#08


import sys

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ri()
S = rs()
d = {'S': 'W', 'W': 'S'}
for x in ['SS', 'SW', 'WS', 'WW']:
    animals = x
    for i in range(N):
        if S[i] == 'o':
            if animals[i+1] == 'S':
                animals += animals[i]
            else:
                animals += d[animals[i]]
        else:
            if animals[i+1] == 'S':
                animals += d[animals[i]]
            else:
                animals += animals[i]
    if animals[0:2] == animals[-2:]:
        print(animals[1:-1])
        exit()

print(-1)

#08


Verdicts: Wrong Answer

Accepted
Problem: Snuke, who loves animals, built a zoo.  There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1.  There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies.  Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species.  More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise.  Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`.

Submission attempts (in order):
n=int(input())
s=input()

def sheep(a,b):
    l=[0]*(n+1)
    l[0]=a
    l[1]=b
    for i in range(1,n):
        if s[i]=="o":
            if l[i]==0:
                l[i+1]=l[i-1]
            else:
                l[i+1]=(l[i-1]+1)%2
        else:
            if l[i]==0:
                l[i+1]=(l[i-1]+1)%2
            else:
                l[i+1]=l[i-1]
    if l[n]==l[0]:
        for i in range(n):
            if l[i]==0:
                print("S")
            else:
                print("W")
        exit()


sheep(0,0)
sheep(0,1)
sheep(1,0)
sheep(1,1)
print("-1")

n=int(input())
s=input()

def sheep(a,b):
    l=[0]*(n+1)
    l[0]=a
    l[1]=b
    m=[]
    for i in range(1,n):
        if s[i]=="o":
            if l[i]==0:
                l[i+1]=l[i-1]
            else:
                l[i+1]=(l[i-1]+1)%2
        else:
            if l[i]==0:
                l[i+1]=(l[i-1]+1)%2
            else:
                l[i+1]=l[i-1]
    x=0
    if s[0]=="o":
        if l[0]==0:
            x=l[1]
        else:
            x=(l[1]+1)%2
    else:
        if l[0]==0:
            x=(l[1]+1)%2
        else:
            x=l[1]
    if l[n]==l[0] and x==l[n-1]:
        for i in range(n):
            if l[i]==0:
                m.append("S")
            else:
                m.append("W")
        print("".join(m))
        exit()

sheep(0,0)
sheep(0,1)
sheep(1,0)
sheep(1,1)
print("-1")

Verdicts: Wrong Answer

Accepted
Problem: Snuke, who loves animals, built a zoo.  There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i (2≤i≤N-1) is adjacent to the animals numbered i-1 and i+1. Also, the animal numbered 1 is adjacent to the animals numbered 2 and N, and the animal numbered N is adjacent to the animals numbered N-1 and 1.  There are two kinds of animals in this zoo: honest sheep that only speak the truth, and lying wolves that only tell lies.  Snuke cannot tell the difference between these two species, and asked each animal the following question: "Are your neighbors of the same species?" The animal numbered i answered s_i. Here, if s_i is `o`, the animal said that the two neighboring animals are of the same species, and if s_i is `x`, the animal said that the two neighboring animals are of different species.  More formally, a sheep answered `o` if the two neighboring animals are both sheep or both wolves, and answered `x` otherwise. Similarly, a wolf answered `x` if the two neighboring animals are both sheep or both wolves, and answered `o` otherwise.  Snuke is wondering whether there is a valid assignment of species to the animals that is consistent with these responses. If there is such an assignment, show one such assignment. Otherwise, print `-1`.

Submission attempts (in order):
import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
s = ns()
a = [['S','S'],['S','W'],['W','S'],['W','W']]

for b in a:
    for i in range(1,n):
        c = 0 if b[i] == 'S' else 1
        d = 0 if s[i] == 'o' else 1
        e = b[i-1] if not c^d else 'W' if b[i-1] == 'S' else 'S'
        b.append(e)
    c = 0 if b[-1] == 'S' else 1
    d = 0 if s[-1] == 'o' else 1
    e = 0 if b[-2] == b[1] else 1
    if b[0] == b[-1] and c^d == e:
        print(''.join(b[:-1]))
        exit()

print(-1)

import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
s = ns()
a = [['S','S'],['S','W'],['W','S'],['W','W']]

for b in a:
    for i in range(1,n):
        c = 0 if b[i] == 'S' else 1
        d = 0 if s[i] == 'o' else 1
        e = b[i-1] if not c^d else 'W' if b[i-1] == 'S' else 'S'
        b.append(e)
    c = 0 if b[0] == 'S' else 1
    d = 0 if s[0] == 'o' else 1
    e = 0 if b[-2] == b[1] else 1
    if b[0] == b[-1] and c^d == e:
        print(''.join(b[:-1]))
        exit()

print(-1)

Verdicts: Wrong Answer

Accepted
Problem: Snuke loves constructing integer sequences.  There are N piles of stones, numbered 1 through N. The pile numbered i consists of a_i stones.  Snuke will construct an integer sequence s of length Σa_i, as follows:    1. Among the piles with the largest number of stones remaining, let x be the index of the pile with the smallest index. Append x to the end of s.   2. Select a pile with one or more stones remaining, and remove a stone from that pile.   3. If there is a pile with one or more stones remaining, go back to step 1. Otherwise, terminate the process.  We are interested in the lexicographically smallest sequence that can be constructed. For each of the integers 1,2,3,...,N, how many times does it occur in the lexicographically smallest sequence?

Submission attempts (in order):
class BIT():#1-indexed
	def __init__(self, size):
		self.table = [0 for _ in range(size+2)]
		self.size = size

	def b_sum(self, i):
		s = 0
		while i > 0:
			s += self.table[i]
			i -= (i & -i)
		return s

	def b_add(self, i, x):
		while i <= self.size:
			self.table[i] += x
			i += (i & -i)
		return

n = int(input())
a = list(map(int, input().split()))
c = sorted(list(set(a)))
num = 2
d = dict()
for i in range(len(c)):
	d[c[i]] = i+1
e = [d[a[i]] for i in range(n)]
#print(a)
b = BIT(n+2)
greater = [0 for _ in range(n)]
for i in range(n-1, -1, -1):
	greater[i] = n-i - b.b_sum(e[i] - 1)
	b.b_add(e[i], 1)
print(greater)
M = max(a)
cur = 0
s = 0
for i in range(n):
	if a[i] > cur:
		print(greater[i] * (a[i] - cur))
		cur = a[i]
	else:
		print(0)

n = int(input())
a = list(map(int, input().split()))
b = sorted(list(set(a)))
a_to_i = dict()
for i in range(len(b)):
	a_to_i[b[i]] = i

a_count = [0 for _ in range(len(b))]
for x in a:
	a_count[a_to_i[x]] += 1

cum_reversed = [a_count[-1]]
for i in range(len(b)-2, -1, -1):
	cum_reversed.append(cum_reversed[-1] + a_count[i])

dominant = [-1 for _ in range(len(b))]
i = 0
for j in range(n):
	if i == len(b):
		break
	while a[j] >= b[i]:
		dominant[i] = j
		i += 1
		if i == len(b):
			break
b.reverse()
b.append(0)
dominant.reverse()

ans = [0 for _ in range(n)]

for i in range(len(b)-1):
	ans[dominant[i]] += (b[i] - b[i+1]) * cum_reversed[i]

print(*ans, sep="\n")

Verdicts: Wrong Answer

Accepted
Problem: Snuke loves constructing integer sequences.  There are N piles of stones, numbered 1 through N. The pile numbered i consists of a_i stones.  Snuke will construct an integer sequence s of length Σa_i, as follows:    1. Among the piles with the largest number of stones remaining, let x be the index of the pile with the smallest index. Append x to the end of s.   2. Select a pile with one or more stones remaining, and remove a stone from that pile.   3. If there is a pile with one or more stones remaining, go back to step 1. Otherwise, terminate the process.  We are interested in the lexicographically smallest sequence that can be constructed. For each of the integers 1,2,3,...,N, how many times does it occur in the lexicographically smallest sequence?

Submission attempts (in order):
from collections import Counter
N = int(input())
S = list(map(int,input().split()))
T = []
for i in range(N):
    T.append((i,S[i]))
U = sorted(T,key=lambda x:x[1], reverse=True)

Ans = [0]*N
c,v = 0,10**10

for i in range(N-1):
    c+=1
    v = min(v,U[i][0])
    if U[i][1]==U[i+1][1]:
        continue
    else:
        Ans[v] += (U[i][1] - U[i+1][1])*c
else:
    Ans[0] += U[i+1][1]

for i in range(N):
    print(Ans[i])

from collections import Counter
N = int(input())
S = list(map(int,input().split()))
T = []
for i in range(N):
    T.append((i,S[i]))
U = sorted(T,key=lambda x:x[1], reverse=True)

Ans = [0]*N
c,v = 0,10**10

for i in range(N-1):
    c+=1
    v = min(v,U[i][0])
    if U[i][1]==U[i+1][1]:
        continue
    else:
        Ans[v] += (U[i][1] - U[i+1][1])*c
else:
    Ans[0] = 0
    Ans[0] = sum(S) - sum(Ans)

for i in range(N):
    print(Ans[i])

Verdicts: Runtime Error

Accepted
Problem: Snuke loves constructing integer sequences.  There are N piles of stones, numbered 1 through N. The pile numbered i consists of a_i stones.  Snuke will construct an integer sequence s of length Σa_i, as follows:    1. Among the piles with the largest number of stones remaining, let x be the index of the pile with the smallest index. Append x to the end of s.   2. Select a pile with one or more stones remaining, and remove a stone from that pile.   3. If there is a pile with one or more stones remaining, go back to step 1. Otherwise, terminate the process.  We are interested in the lexicographically smallest sequence that can be constructed. For each of the integers 1,2,3,...,N, how many times does it occur in the lexicographically smallest sequence?

Submission attempts (in order):
N = int(input())
A = [(a, i) for i, a in enumerate(map(int, input().split()))]
A.sort(reverse=True)
A.append((0, 0))

ans = [0] * N
now = float('inf')

for j, (a, i) in enumerate(A[:N], start=1):
    now = min(now, i)
    ans[now] += j * (now - A[j][0])

print(*ans, sep='\n')


N = int(input())
A = [(a, i) for i, a in enumerate(map(int, input().split()))]
A.sort(reverse=True)
A.append((0, 0))

ans = [0] * N
now = float('inf')

for j, (a, i) in enumerate(A[:N], start=1):
    now = min(now, a)
    ans[now] += j * (now - A[j][0])

print(*ans, sep='\n')


from heapq import heapify, heappop

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

que = [(-a, i + 1) for i, a in enumerate(A)]
heapify(que)

ans = [0] * (N + 1)
cnt = 0
while que:
    a, now = heappop(que)
    cnt += 1
    ans[now] = -a * cnt

    while que and que[0][1] > now:
        a, _ = heappop(que)
        ans[now] += -a
        cnt += 1

    if que:
        ans[now] -= -que[0][0] * cnt

print(*ans[1:], sep='\n')


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Snuke loves constructing integer sequences.  There are N piles of stones, numbered 1 through N. The pile numbered i consists of a_i stones.  Snuke will construct an integer sequence s of length Σa_i, as follows:    1. Among the piles with the largest number of stones remaining, let x be the index of the pile with the smallest index. Append x to the end of s.   2. Select a pile with one or more stones remaining, and remove a stone from that pile.   3. If there is a pile with one or more stones remaining, go back to step 1. Otherwise, terminate the process.  We are interested in the lexicographically smallest sequence that can be constructed. For each of the integers 1,2,3,...,N, how many times does it occur in the lexicographically smallest sequence?

Submission attempts (in order):
N = int(input())
a = list(map(int, input().split()))
b = []
for i in range(N):
    b.append([a[i], i+1])
b.sort(reverse = True)
ans = [0]*(N+1)
mini = N+1

for i in range(N-1):
    mini = min(mini, b[i][1])
    if b[i+1][0] - b[i][0] < 0:
        ans[mini] += (b[i][0] - b[i+1][0])*(i+1)

ans[1] += N*min(b)
for i in range(N):
    print(ans[i+1])


N = int(input())
a = list(map(int, input().split()))
b = []
for i in range(N):
    b.append([a[i], i+1])
b.sort(reverse = True)
ans = [0]*(N+1)
mini = N+1

for i in range(N-1):
    mini = min(mini, b[i][1])
    if b[i+1][0] - b[i][0] < 0:
        ans[mini] += (b[i][0] - b[i+1][0])*(i+1)

ans[1] += N*b[-1][0]
for i in range(N):
    print(ans[i+1])


Verdicts: Runtime Error

Accepted
Problem: Snuke loves constructing integer sequences.  There are N piles of stones, numbered 1 through N. The pile numbered i consists of a_i stones.  Snuke will construct an integer sequence s of length Σa_i, as follows:    1. Among the piles with the largest number of stones remaining, let x be the index of the pile with the smallest index. Append x to the end of s.   2. Select a pile with one or more stones remaining, and remove a stone from that pile.   3. If there is a pile with one or more stones remaining, go back to step 1. Otherwise, terminate the process.  We are interested in the lexicographically smallest sequence that can be constructed. For each of the integers 1,2,3,...,N, how many times does it occur in the lexicographically smallest sequence?

Submission attempts (in order):
N = int(input())
A = [0] + list(map(int, input().split()))
B = [[a, i, 1] for i, a in enumerate(A)]
C = sorted(B, reverse=True)
a_max, idx = 0, 0 # [value, idx]
left_max = [[0, 0] for i in range(N+1)] # [value, idx]
for i, a in enumerate(A):
  left_max[i] = [a_max, idx]
  if a > a_max:
    a_max, idx = a, i

print(left_max)
ans = [0] * (N+1)
next_i = C[0][1]
print(B)
print(C)
for _, i, _ in C:
  a, _, num = B[i]
  if i == next_i:
    next_a, next_i = left_max[i]
    now_i = i
    ans[i] += (a - next_a) * num
    B[next_i][2] += num
  else:
    ans[now_i] += (a - next_a) * num
    B[next_i][2] += num
    

print(*ans[1:], sep='\n')

N = int(input())
A = [0] + list(map(int, input().split()))


B = [[a, i, 1] for i, a in enumerate(A)]
C = sorted(B, reverse=True)



a_max, idx = 0, 0 # [value, idx]
left_max = [[0, 0] for i in range(N+1)] # [value, idx]
for i, a in enumerate(A):
  left_max[i] = [a_max, idx]
  if a > a_max:
    a_max, idx = a, i

ans = [0] * (N+1)
next_i = C[0][1]
for _, i, _ in C: 
  a, _, num = B[i] 
  if i == next_i:
    next_a, next_i = left_max[i] 
    now_i = i
    ans[i] += (a - next_a) * num 
    B[next_i][2] += num 
  else:
    ans[now_i] += (a - next_a) * num
    B[next_i][2] += num

print(*ans[1:], sep='\n')

Verdicts: Wrong Answer

Accepted
Problem: Snuke loves constructing integer sequences.  There are N piles of stones, numbered 1 through N. The pile numbered i consists of a_i stones.  Snuke will construct an integer sequence s of length Σa_i, as follows:    1. Among the piles with the largest number of stones remaining, let x be the index of the pile with the smallest index. Append x to the end of s.   2. Select a pile with one or more stones remaining, and remove a stone from that pile.   3. If there is a pile with one or more stones remaining, go back to step 1. Otherwise, terminate the process.  We are interested in the lexicographically smallest sequence that can be constructed. For each of the integers 1,2,3,...,N, how many times does it occur in the lexicographically smallest sequence?

Submission attempts (in order):
import collections
import heapq
n=int(input())
A=[int(i) for i in input().split()]
Ans=[0]*n
M=[0]
for i in range(n):
  M.append(max(M[-1],A[i]))
D=collections.defaultdict(int)
H=[]
for i in range(n):
  j=n-1-i
  if A[j]<=M[j]:
    heapq.heappush(H,-A[j])
  else:
    Ans[j]=(A[j]-M[j])*(D[A[j]]+1)
    D[M[j]]+=D[A[j]]+1
    ct=0
    while H:
      a=heapq.heappop(H)
      a=-a
      if a<=M[j]:
        heapq.heappush(H,-a)
        break
      else:
        Ans[j]+=a-M[j]
        D[M[j]]+=1

for a in Ans:
  print(Ans)


import collections
import heapq
n=int(input())
A=[int(i) for i in input().split()]
Ans=[0]*n
M=[0]
for i in range(n):
  M.append(max(M[-1],A[i]))
D=collections.defaultdict(int)
H=[]
for i in range(n):
  j=n-1-i
  if A[j]<=M[j]:
    heapq.heappush(H,-A[j])
  else:
    Ans[j]=(A[j]-M[j])*(D[A[j]]+1)
    D[M[j]]+=D[A[j]]+1
    ct=0
    while H:
      a=heapq.heappop(H)
      a=-a
      if a<=M[j]:
        heapq.heappush(H,-a)
        break
      else:
        Ans[j]+=a-M[j]
        D[M[j]]+=1

for a in Ans:
  print(a)


Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are playing _One Card Poker_.   One Card Poker is a two-player game using playing cards.  Each card in this game shows an integer between `1` and `13`, inclusive.   The _strength_ of a card is determined by the number written on it, as follows:  Weak `2` < `3` < `4` < `5` < `6` < `7` < `8` < `9` < `10` < `11` < `12` < `13` < `1` Strong  One Card Poker is played as follows:    1. Each player picks one card from the deck. The chosen card becomes the player's hand.   2. The players reveal their hands to each other. The player with the stronger card wins the game.   If their cards are equally strong, the game is drawn.  You are watching Alice and Bob playing the game, and can see their hands.   The number written on Alice's card is A, and the number written on Bob's card is B.   Write a program to determine the outcome of the game.

Submission attempts (in order):
import sys

a,b = map(int, sys.stdin.readline().split())

if a == 1:
    a = 14
if b == 1:
    b = 14:

if a > b:
    print("Alice")
elif a == b:
    print("Draw")
else:
    print("Bob")

import sys

a,b = map(int, sys.stdin.readline().split())

if a == 1:
    a = 14
if b == 1:
    b = 14

if a > b:
    print("Alice")
elif a == b:
    print("Draw")
else:
    print("Bob")

Verdicts: Runtime Error

Accepted