TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Given is a string S of length N-1. Each character in S is `<` or `>`.  A sequence of N non-negative integers, a_1,a_2,\cdots,a_N, is said to be _good_ when the following condition is satisfied for all i (1 \leq i \leq N-1):    * If S_i= `<`: a_i<a_{i+1}   * If S_i= `>`: a_i>a_{i+1}  Find the minimum possible sum of the elements of a good sequence of N non- negative integers.

Submission attempts (in order):
s = input()
a = [0] * (len(s) + 1)
cur = 0
for i in range(len(s)):
  a[i] = cur
  cur = 0 if s[i] == '>' else cur + 1 
a[-1] = cur
cur = 0
for i in range(len(s)).reversed():
  a[i + 1] = max(a[i + 1], cur)
  cur = 0 if s[i] == '<' else cur + 1
a[0] = max(a[0], cur)
print(sum(a))

s = input()
a = [0] * (len(s) + 1)
cur = 0
for i in range(len(s)):
  a[i] = cur
  cur = 0 if s[i] == '>' else cur + 1 
a[-1] = cur
cur = 0
for i in reversed(range(len(s))):
  a[i + 1] = max(a[i + 1], cur)
  cur = 0 if s[i] == '<' else cur + 1
a[0] = max(a[0], cur)
print(sum(a))

Verdicts: Runtime Error

Accepted
Problem: Given is a string S of length N-1. Each character in S is `<` or `>`.  A sequence of N non-negative integers, a_1,a_2,\cdots,a_N, is said to be _good_ when the following condition is satisfied for all i (1 \leq i \leq N-1):    * If S_i= `<`: a_i<a_{i+1}   * If S_i= `>`: a_i>a_{i+1}  Find the minimum possible sum of the elements of a good sequence of N non- negative integers.

Submission attempts (in order):
S = input()
N = len(S) + 1
L = [0]
a = 0

for s in S:
    if s == '<':
        a += 1
        L.append(a)
    else:
        a -= 1
        L.append(a)

minimum = min(L)
L = [a-minimum for a in L]
L = [10 ** 6] + L + [10 ** 6]

for i in range(N):
    left = L[i]
    center = L[i + 1]
    right = L[i + 2]
    if left > center and center < right:
        L[i + 1] = 0
    else:
        L[i + 1] = min(left, right) + 1


for i in range(N):
    left = L[i]
    center = L[i + 1]
    right = L[i + 2]
    if left > center and center < right:
        L[i + 1] = 0
    else:
        L[i + 1] = min(left, right) + 1

L = L[1:-1]
print(sum(L))


import numpy as np

S = input()
L = []
N = len(S)

if S[-1] == '<':
    S += '><'
else:
    S += '<>'

index = 0
for n in range(N+1):
    if S[n: n + 2] == '><':
        L.append(S[index: n + 1])
        index = n + 1


def calc(string):
    K = len(string)
    c = K
    for k in range(K - 1):
        if string[k: k + 2] == '<>':
            c = k + 1
            break
    a = min(c, K - c)
    b = max(c, K - c)
    return a * (a - 1) // 2 + b * (b + 1) // 2


ans = 0
for string in L:
    ans += calc(string)

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Given is a string S of length N-1. Each character in S is `<` or `>`.  A sequence of N non-negative integers, a_1,a_2,\cdots,a_N, is said to be _good_ when the following condition is satisfied for all i (1 \leq i \leq N-1):    * If S_i= `<`: a_i<a_{i+1}   * If S_i= `>`: a_i>a_{i+1}  Find the minimum possible sum of the elements of a good sequence of N non- negative integers.

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

sl=len(s)+1
l=[0]*sl

for i in range(sl-1):
  if s[i]=="<":
    l[i+1]=l[i]+1
    
for i in range(sl-2,-1,-1):
  if s[i]==">":
    l[i]=max(l[i+1], l[i])
    
print(sum(l))
  
  

n = input()[:-1]
while n[:len(n)//2] != n[len(n)//2:]:
  n = n[:-1]
print(len(n))


s=input()

sl=len(s)+1
l=[0]*sl

for i in range(sl-1):
  if s[i]=="<":
    l[i+1]=l[i]+1
    
for i in range(sl-2,-1,-1):
  if s[i]==">":
    l[i]=max(l[i+1], l[i])
    
print(sum(l))
  
  

s=input()

sl=len(s)+1
l=[0]*sl

for i in range(sl-1):
  if s[i]=="<":
    l[i+1]=l[i]+1
    
for i in range(sl-2,-1,-1):
  if s[i]==">":
    l[i]=max(l[i+1]+1, l[i])
    
print(sum(l))
  
  

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: 10^9 contestants, numbered 1 to 10^9, will compete in a competition. There will be two contests in this competition.  The organizer prepared N problems, numbered 1 to N, to use in these contests. When Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.  The organizer will use these N problems in the two contests. Each problem must be used in exactly one of the contests, and each contest must have at least one problem.  The _joyfulness_ of each contest is the number of contestants who will solve all the problems in the contest. Find the maximum possible total joyfulness of the two contests.

Submission attempts (in order):
import sys
from operator import itemgetter
input = sys.stdin.readline

_n, *lrlist = map(int, open(0).read().split())
Lp, Rq = max(lrlist[::2]), min(lrlist[1::2])

st = sorted([(max(r - Lp + 1, 0), max(Rq - l + 1, 0)) for l, r in lrlist])
ans = max([r - l + 1 for l, r in lrlist]) + max(Rq - Lp + 1, 0)

for index, (a, b) in enumerate(st):
    if index:
        continue


for i in range(1, _n):
    s, t = st[:i], st[i:]
    min_b, min_a = sorted(s, key=itemgetter(1))[0][1], t[0][0]

    ans = max(min_a + min_b, ans)

print(ans)


import sys
input = sys.stdin.readline

_n = int(input())
lrlist = [list(map(int, input().split())) for _ in range(_n)]
Lp, Rq = max(l for l, r in lrlist), min(r for l, r in lrlist)

st = sorted([(max(r - Lp + 1, 0), max(Rq - l + 1, 0)) for l, r in lrlist], key=lambda x: (x[0], -x[1]))
ans = max([r - l + 1 for l, r in lrlist]) + max(Rq - Lp + 1, 0)

min_b = 10 ** 9
for i in range(_n - 1):
    min_b = min(st[i][1], min_b)
    ans = max(ans, min_b + st[i + 1][0])

print(ans)


Verdicts: Runtime Error

Accepted
Problem: 10^9 contestants, numbered 1 to 10^9, will compete in a competition. There will be two contests in this competition.  The organizer prepared N problems, numbered 1 to N, to use in these contests. When Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.  The organizer will use these N problems in the two contests. Each problem must be used in exactly one of the contests, and each contest must have at least one problem.  The _joyfulness_ of each contest is the number of contestants who will solve all the problems in the contest. Find the maximum possible total joyfulness of the two contests.

Submission attempts (in order):
INF = 10 ** 10

N = int(input())

L = [tuple(map(int,input().split())) for _ in range(N)]

L.sort(key=lambda x:(-x[0], x[1]))

MAX_L = 0
MIN_R = INF
MAX = 0
a = 0
b = 0

for i in range(N):
    if MAX_L < L[i][0]:
        MAX_L = L[i][0]
        a = i
    if MIN_R > L[i][1]:
        MIN_R = L[i][1]
        b = i
    MAX = max(MAX, L[i][1] - L[i][0] + 1)

ans = MAX + max(0, MIN_R - MAX_L + 1)

p = 0

for i in range(N-1):
    p = max(p, L[i+1][0])
    ans = max(ans, max(0, L[i][1] - L[0][0] + 1) + max(0, L[-1][1] - L[i+1][0] + 1))


    print(ans)INF = 10 ** 10

N = int(input())

L = [tuple(map(int,input().split())) for _ in range(N)]

L.sort(key=lambda x:(-x[0], x[1]))

MAX_L = 0
MIN_R = INF
MAX = 0
a = 0
b = 0

for i in range(N):
    if MAX_L < L[i][0]:
        MAX_L = L[i][0]
        a = i
    if MIN_R > L[i][1]:
        MIN_R = L[i][1]
        b = i
    MAX = max(MAX, L[i][1] - L[i][0] + 1)

ans = MAX + max(0, MIN_R - MAX_L + 1)

p = 0

for i in range(N-1):
    p = max(p, L[i+1][0])
    ans = max(ans, max(0, L[i][1] - L[0][0] + 1) + max(0, L[-1][1] - L[i+1][0] + 1))


    print(ans)

INF = 10 ** 10

N = int(input())

L = [tuple(map(int,input().split())) for _ in range(N)]

L.sort(key=lambda x:(-x[0], x[1]))

MAX_L = 0
MIN_R = INF
MAX = 0
a = 0
b = 0

for i in range(N):
    if MAX_L < L[i][0]:
        MAX_L = L[i][0]
        a = i
    if MIN_R > L[i][1]:
        MIN_R = L[i][1]
        b = i
    MAX = max(MAX, L[i][1] - L[i][0] + 1)

ans = MAX + max(0, MIN_R - MAX_L + 1)

p = 0

for i in range(N-1):
    p = max(p, L[i+1][0])
    ans = max(ans, max(0, L[i][1] - L[0][0] + 1) + max(0, L[-1][1] - L[i+1][0] + 1))


    print(ans)

INF = 10 ** 10

N = int(input())
 
L = [tuple(map(int,input().split())) for _ in range(N)]
 
L.sort(key=lambda x:(-x[0], x[1]))
 
MAX_L = 0
MIN_R = INF
MAX = 0
a = 0
b = 0
 
for i in range(N):
    if MAX_L < L[i][0]:
        MAX_L = L[i][0]
        a = i
    if MIN_R > L[i][1]:
        MIN_R = L[i][1]
        b = i
    MAX = max(MAX, L[i][1] - L[i][0] + 1)
 
ans = MAX + max(0, MIN_R - MAX_L + 1)
 
p = INF
 
for i in range(N-1):
    p = min(p, L[i][1])
    ans = max(ans, max(0, p - L[a][0] + 1) + max(0, L[b][1] - L[i+1][0] + 1))
 
print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 10^9 contestants, numbered 1 to 10^9, will compete in a competition. There will be two contests in this competition.  The organizer prepared N problems, numbered 1 to N, to use in these contests. When Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.  The organizer will use these N problems in the two contests. Each problem must be used in exactly one of the contests, and each contest must have at least one problem.  The _joyfulness_ of each contest is the number of contestants who will solve all the problems in the contest. Find the maximum possible total joyfulness of the two contests.

Submission attempts (in order):
def kazu(p, q):
    return max(p[0], q[0]), min(p[1], q[1]), max(-max(p[0], q[0]) + min(p[1], q[1]) + 1, 0)
def kazu1(p):
    return p[1] - p[0] + 1
def main():
    N = int(input())
    l = []
    for _ in range(N):
        L, R = map(int, input().split())
        l.append((L, R))
    l.sort(key=lambda x:x[0])
    dp= [(l[0], l[1])]
    for i in range(2, N):
        a, b, c = kazu(dp[i-2][0], l[i]) 
        d, e, f = kazu(dp[i-2][1], l[i])
        if  f + kazu1(dp[i-2][0]) > c + kazu1(dp[i-2][1]):
            dp.append(((d,e),dp[i-2][0]))
        else:
            dp.append(((a,b),dp[i-2][1]))
    return kazu1(dp[-1][0]) + kazu1(dp[-1][1])
print(main())


def kazu(p, q):
    return max(p[0], q[0]), min(p[1], q[1]), max(-max(p[0], q[0]) + min(p[1], q[1]) + 1, 0)
def kazu1(p):
    return p[1] - p[0] + 1
def main():
    N = int(input())
    l = []
    for _ in range(N):
        L, R = map(int, input().split())
        l.append((L, R))
    l.sort(key=lambda x:x[1])
    dp= [(l[0], l[1])]
    for i in range(2, N):
        a, b, c = kazu(dp[i-2][0], l[i]) 
        d, e, f = kazu(dp[i-2][1], l[i])
        if  f + kazu1(dp[i-2][0]) > c + kazu1(dp[i-2][1]):
            dp.append(((d,e),dp[i-2][0]))
        else:
            dp.append(((a,b),dp[i-2][1]))
    return kazu1(dp[-1][0]) + kazu1(dp[-1][1])
print(main())


def kazu(p, q):
    return max(p[0], q[0]), min(p[1], q[1]), max(-max(p[0], q[0]) + min(p[1], q[1]) + 1, 0)
def kazu1(p):
    return max(p[1] - p[0] + 1, 0)
def main():
    N = int(input())
    l = []
    for _ in range(N):
        L, R = map(int, input().split())
        l.append((L, R))
    l.sort(key=lambda x:x[1])
    dp= (l[0], l[1])
    for i in range(2, N):
        a, b, c = kazu(dp[0], l[i]) 
        d, e, f = kazu(dp[1], l[i])
        g, h, j = kazu(dp[0], dp[1])
        m = max(f + kazu1(dp[0]), c + kazu1(dp[1]), j + kazu1(l[i]))
        if  m == f + kazu1(dp[0]):
            dp = ((d,e),dp[0])
        elif m == c + kazu1(dp[1]):
            dp = ((a,b),dp[1])
        else:
            dp = ((g,h), l[i])
    return kazu1(dp[0]) + kazu1(dp[1])
print(main())


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 10^9 contestants, numbered 1 to 10^9, will compete in a competition. There will be two contests in this competition.  The organizer prepared N problems, numbered 1 to N, to use in these contests. When Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.  The organizer will use these N problems in the two contests. Each problem must be used in exactly one of the contests, and each contest must have at least one problem.  The _joyfulness_ of each contest is the number of contestants who will solve all the problems in the contest. Find the maximum possible total joyfulness of the two contests.

Submission attempts (in order):
N, *LR = map(int, open(0).read().split())
LR = sorted(((r - l + 1, r, l) for l, r in zip(*[iter(LR)] * 2)), key=lambda x: x[0])


_, min_r, max_l = LR[0]
A = []
for _, r, l in LR:
    max_l, min_r = max(max_l, l), min(min_r, r)
    A.append(max(0, min_r - max_l + 1))

_, min_r, max_l = LR[-1]
B = []
for _, r, l in reversed(LR):
    max_l, min_r = max(max_l, l), min(min_r, r)
    B.append(max(0, min_r - max_l + 1))

B.pop()

print(max(a + b for a, b in zip(A, reversed(B))))


from sys import stdin

def main():
    N, *LR = map(int, stdin.buffer.read().split())
    L, R = LR[::2], LR[1::2]

    Lp = max(L)
    Rq = min(R)

    AB = sorted((max(0, r - Lp + 1), -max(0, Rq - l + 1)) for l, r in zip(L, R))

    mi = float("inf")
    ma = max(r - l + 1 for l, r in zip(L, R)) + max(0, Rq - Lp + 1)

    for i, (a, b) in enumerate(AB):
        if i:
            ma = max(ma, mi + a)
        mi = min(mi, -b)

    print(ma)


main()


Verdicts: Wrong Answer

Accepted
Problem: 10^9 contestants, numbered 1 to 10^9, will compete in a competition. There will be two contests in this competition.  The organizer prepared N problems, numbered 1 to N, to use in these contests. When Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.  The organizer will use these N problems in the two contests. Each problem must be used in exactly one of the contests, and each contest must have at least one problem.  The _joyfulness_ of each contest is the number of contestants who will solve all the problems in the contest. Find the maximum possible total joyfulness of the two contests.

Submission attempts (in order):
import sys
sys.setrecursionlimit(10 ** 9)

n = int(input())
LR = [tuple(map(int, input().split())) for _ in range(n)]

def quicksort(x):
    if x==[]: return []

    smallerSorted = quicksort([a for a in x[1:] if (a[0] < x[0][0] or (a[0] == x[0][0] and a[1] >= x[0][1])])
    biggerSorted = quicksort([a for a in x[1:] if (a[0] > x[0][0] or (a[0] == x[0][0] and a[1] < x[0][1]))])

    return(smallerSorted+[x[0]]+biggerSorted)

LR = quicksort(LR)

ans = [0] * (n+1)
temp = 10 ** 9
i = 1
for L, R in LR:
    temp = min(temp, R)
    if L > temp:
        break
    ans[i] = temp - L + 1
    i += 1
#print(ans)
temp = 10 ** 9
i = n - 1
L = LR[-1][0]
for x, R in reversed(LR):
    temp = min(temp, R)
    if L > temp:
        break
    ans[i] += temp - L + 1
    i -= 1

print(max(ans))

import sys
sys.setrecursionlimit(10 ** 9)

n = int(input())
LR = [tuple(map(int, input().split())) for _ in range(n)]

def quicksort(x):
    if x==[]: return []

    smallerSorted = quicksort([a for a in x[1:] if a[0] < x[0][0] or (a[0] == x[0][0] and a[1] >= x[0][1])])
    biggerSorted = quicksort([a for a in x[1:] if a[0] > x[0][0] or (a[0] == x[0][0] and a[1] < x[0][1])])

    return(smallerSorted+[x[0]]+biggerSorted)

LR = quicksort(LR)

e = [[] for _ in range(n+2)]

ans = [0] * (n+1)
temp = 10 ** 9
i = 1
for L, R in LR:
    temp = min(temp, R)
    if L > temp:
        break
    ans[i] = temp - L + 1
    i += 1

temp = 10 ** 9
i = n - 1
L = LR[-1][0]
for x, R in reversed(LR):
    temp = min(temp, R)
    if L > temp:
        break
    ans[i] += temp - L + 1
    i -= 1

res = max(ans)
for L, R in LR:
    res = max(res, R - L + 1 + ans[0])

#print(LR)
#print(ans)
print(res)


Verdicts: Runtime Error

Accepted
Problem: 10^9 contestants, numbered 1 to 10^9, will compete in a competition. There will be two contests in this competition.  The organizer prepared N problems, numbered 1 to N, to use in these contests. When Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.  The organizer will use these N problems in the two contests. Each problem must be used in exactly one of the contests, and each contest must have at least one problem.  The _joyfulness_ of each contest is the number of contestants who will solve all the problems in the contest. Find the maximum possible total joyfulness of the two contests.

Submission attempts (in order):
import sys
N, = map(int, input().split())
mx, md, my = 0, 0, 10**9
ps = []

for _ in range(N):
    x, y = map(int, input().split())
    mx = max(x, mx)
    my = min(y, my)
    md = max(y-x+1, md)
    ps.append([x,-y])

ps.sort()
for p in ps:
    p[1] *= -1

if ps[-1][1] == my:
    print(my-mx+1+md)
    sys.exit()

for i, (x, y) in enumerate(ps):
    if y == my:
        mmx = x
        del ps[i]
        break


from collections import deque
rs = []
dq = deque()
for i in range(N-1):
    while True:
        if not len(dq):
            dq.append(i)
            break
        lxi = dq[-1]
        if ps[i][1] >= ps[lxi][1]:
            dq.append(i)
            break
        dq.pop()

r = max(my - mmx + 1, 0) + max(ps[dq.popleft()][1] - mx + 1, 0)

for i in range(N-2):
    x = max(ps[i][0], mmx)
    if len(dq):
        if i+1 == dq[0]:
            y = ps[dq.popleft()][1] # mx
    #y = min(p[1] for p in ps[i+1:])
    print(r)
    r = max(r, max(my - x + 1, 0) + max(y - mx + 1, 0))
print(r)


import sys
N, = map(int, input().split())
mx, md, my = 0, 0, 10**9
ps = []

for _ in range(N):
    x, y = map(int, input().split())
    mx = max(x, mx)
    my = min(y, my)
    md = max(y-x+1, md)
    ps.append([x,y])

ps.sort()
for p in ps:
#    p[1] *= -1
    if p == [mx, my]:
        print(my-mx+1+md)
        sys.exit()

for i, (x, y) in enumerate(ps):
    if y == my:
        mmx = x
        del ps[i]
        break

from collections import deque
rs = []
dq = deque()
for i in range(N-1):
    while True:
        if not len(dq):
            dq.append(i)
            break
        lxi = dq[-1]
        if ps[i][1] >= ps[lxi][1]:
            dq.append(i)
            break
        dq.pop()

r = max(my-mx+1, 0) + md
r = max(r, max(my - mmx + 1, 0) + max(ps[dq.popleft()][1] - mx + 1, 0))

for i in range(N-2):
    x = max(ps[i][0], mmx)
    if len(dq):
        if i+1 == dq[0]:
            y = ps[dq.popleft()][1] # mx
    #y = min(p[1] for p in ps[i+1:])
#    print(r)
    r = max(r, max(my - x + 1, 0) + max(y - mx + 1, 0))
print(r)


Verdicts: Wrong Answer

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

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

if a or b > 9:
    print(-1)
else:
    print(a*b)

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

if 1<=a<=9 and 1<=b<=9:
    print(a * b)
else:
    print(-1)

Verdicts: Wrong Answer

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
A,B=map(int,input(),split())
if A,B<=9:
  print(A*B)
else:
  print(-1)

A,B=map(int,input(),split())
if A<=9 and B<=9:
  print(A*B)
else:
  print(-1)

A,B=map(int.input(),split())
if A<=9 and B<=9:
  print(A*B)
else:
  print(-1)


A=int(input())
B=int(input())

if A,B<=9:
  print(A*B)
else:
  print(-1)

A,B=map(int,input().split())
if A<=9 and B<=9:
  print(A*B)
else:
  print(-1)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
ab = input().split(" ")
a = int(ab[0])
b = int(ab[1])


def check(a,b):
	if (a>9 or b>9):
		return -1
	else
		return a*b

print(check(a,b))


ab = input().split(" ")
a = int(ab[0])
b = int(ab[1])


def check(a,b):
	if (a>9 or b>9):
		return -1
	else:
		return a*b
ans = check(a,b)
print(ans)


Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
n=int(input())
l=list()
if n<=5:
  print("Yes")
  exit()
for i in range(2, n//2+1):
    if n % i == 0: 
        if (n//i,i) not in l:
            l.append((i,n//i))
flag=0
for i in l:
    if i[0]<=9 and i[1]<=9:
        flag=1
        print("Yes")
        exit()
if not flag:
    print("No")


a,b=map(int,input().split(' '))
count=0
if (a<=9 and a>=1) and (b<=9 and b>=1) :
    print(a*b)
else:
    print("-1")


Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
a,b = map(int,raw_input.split())
if(a>9 or b >9):
  print("-1")
else:
  print(a*b)
  

a,b = map(int,raw_input.split())
if(a<1 or a>9 or b<1 or b >9):
  print("-1")
else:
  print(a*b)
  

x, y = map(int, raw_input().split())
if(x>=1and x<=9) or (y>=1 and y<=9):
	print(x*y)
else:
	print("-1")

x,y = map(int,input.split())
if(x<1 or x>9 or y<1 or y>9):
  print("-1")
else:
  print(x*y)

x,y = map(int,input().split())
if(x<1 or x>9 or y<1 or y>9):
  print("-1")
else:
  print(x*y)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

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

if (a >= 1 and a <= 9 and b >= 1 and b <= 9):
  print(a*b)
else:
  print("-1")


a=input()
b=[int(s) for s in a.split() if s.isdigit()]
if 1<=b[0]<=9 and 1<=b[1]<=9:
  print(b[0]*b[1])
else:
  print(-1)

Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
a, b = map(int, input().split())
if 1 <= a and a <= 9 and 1 <= b nd b <= 9:
  print(a*b)
else:
  print(-1)

a, b = map(int, input().split())
if 1 <= a <= 9 and 1 <= b <= 9:
  print(a*b)
else:
  print(-1)


Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

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

if a < 10 and b < 10:
    print(a*b)
else:
    print(-1)

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

if a < 10 and b < 10:
    print(a*b)
else:
    print(-1)

Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

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

list_aaa = [1,2,3,4,5,6,7,8,9]

ans = 0

for i in list_aaa:
    if A == i or B == i:
        ans = 1
    else:
        ans = 2

if ans ==1:
    print(A*B)
else:
    print('-1')

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

list_aaa = [1,2,3,4,5,6,7,8,9]

ans_a = 0
ans_b = 0

for i in list_aaa:
    if A == i :
        ans_a = 1
    if B == i:
        ans_b = 1
    else:
        ans = 2

if ans_a ==1 and ans_b ==1:
    print(A*B)
else:
    print('-1')

Verdicts: Wrong Answer

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
N = int(input())
root = int(N**0.5)
print(min([i + N //i -2 for i in range(1, root+1) if N % i == 0])

A, B = map(int,input().split())
print((1 <= A <= 9) and (1 <= B <= 9))

N = int(input())
root = int(N**0.5)
print(min([i + N //i -2 for i in range(1, root+1) if N % i == 0]))

A, B = map(int,input().split())
ans = 1 if (1 <= A <= 9) and (1 <= B <= 9) else -1
print(ans)

A, B = map(int,input().split())
ans = A*B if (1 <= A <= 9) and (1 <= B <= 9) else -1
print(ans)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
a, b = map(int, input().split())
if a>=10 or b>=10:
  print(a*b)
else:
  print(-1)

a, b = map(int, input().split())
if a>=10 or b>=10:
  print(-1)
else:
  print(a*b)


Verdicts: Wrong Answer

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):

N_list = []

for i in range(1,10):
    for j in range(1,10):
        N_list.append(i*j)
A_B = list(map(int, input().split()))
s = A_B[0]*A_B[1]
if A_B[0] < 10 & A_B[1] < 10:    
    if s in N_list:
        print(s)
    else :
        print("-1")
else :
    print("-1")



N_list = []

for i in range(1,10):
    for j in range(1,10):
        N_list.append(i*j)
A_B = list(map(int, input().split()))
if A_B[0] < 10 and A_B[1] < 10:
    s = A_B[0]*A_B[1]
    if s in N_list:
        print(s)
    else :
        print("-1")
else :
    print("-1")


Verdicts: Wrong Answer

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
A,B = map(int,input().split())
if A > 9 or B > 0:
    print("-1")
else: 
    print(str(A * B))

A,B = map(int,input().split())
if A > 9 or B > 9:
    print("-1")
else: 
    print(str(A * B))

Verdicts: Wrong Answer

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

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

if A > 9:
    print(-1)
elif B > 9:
    print(-1)
else:
    print(A*B)

A,B = map(int,input().split())
if A > 9:
    print(-1)
elif B > 9:
    print(-1)
else:
    print(A*B)

Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
a, b = map(int, raw_input().split())
if a > 9 or b > 9:
  print(-1)
else:
  print(a*b)

a, b = map(int, input().split())
if a > 9 or b > 9:
  print(-1)
else:
  print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
a, b = input().split()
a= int(a)
b = int(b)
if not len(a) <2;
 if not len(b) < 2;
  print(a*b)
else:
  print("-1")


a, b = input().split()
a= int(a)
b = int(b)
if a in range(1,9);
 if b in range(1,9);
  print(a*b)
else:
  print("-1")


a, b = input().split()
a= int(a)
b = int(b)
if a in range(1,9);
 if b in range(1,9)
  print(a*b)
else:
  print("-1")


a, b = map(int, input().split())
if a in range(1,9);
 if b in range(1,9);
  print(a*b)
else:
  print("-1")


a, b = input().split()
a= int(a)
b = int(b)
if not len(a) ==2;
 if not len(b) == 2;
  print(a*b)
else:
  print("-1")


import sys
a, b = map(int, input().split())
k = range(1,10)
if a in k:
 if b in k:
  print(a*b)
  sys.exit()
 else:
  pass
print("-1")  

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

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

if a <= 9 and b <= 0:
  print(a*b)
else:
  print(-1)

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

if a <= 9 and b <= 9:
  print(a*b)
else:
  print(-1)

Verdicts: Wrong Answer

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
a=int(input())
b=0
c=0
for i in range(1,10):
  if a%i==0:
    b=a/i
    if b<=9:
      c=1
      break
if c==1:
  print("Yes")
else:
  print("No")


a=int(input())
b=0
c=0
for i in range(1,10):
  if a%i==0:
    b=a/i
    if b<=9:
      c=1
      break
if c==1:
  print("Yes")
else
  print("No")



i = list(map(int, input().split()))

if (i[0] <= 9 and i[1] <= 9):
	print(i[0] * i[1])
else:
	print("-1");







Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
import collections
A= int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    
    return divisors
  
primelist=make_divisors(A)
S = primelist[-1]
G = int(A/S)
print((G-1)+(S-1))

A,B= map(int, input().split())
if A > 9 or B > 9:
  print('-1')
else:
  print(A*B)

Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
a, b = map(int, input().split())
ans = -1 if 0 < a < 10 or 0 < b < 10 else a*b
print(ans)

a, b = map(int, input().split())
ans = a*b if 0  < a < 10 and 0  < b < 10 else -1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
a.b = list(map(int, input().split( )))
if 1 <= a <= 9 and 1 <= b <= 9:
  print(a*b)
else:
  print(-1)
  

a,b = map(int, input().split( ))
if 1 <= a <= 9 and 1 <= b <= 9:
  print(a*b)
else:
  print(-1)
  


Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
A, B = [int(i) for i in input().split()]
print(A, B)

if A > 10 or B > 10:
    print(-1)
else:
    print(A*B)

A, B = [int(i) for i in input().split()]


if A >= 10 or B >= 10:
    print(-1)
else:
    print(A*B)

Verdicts: Wrong Answer

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
N = int(input())
ans = "No"
for i in range (1,10):
  for j in range(1,10):
    if N == i * j:
      ans = "Yes"
      break
print(ans)

N = int(input())
ans = 'No'
 
for i in range(1, 10):
    if ans == 'Yes':
        break
 
    for j in range(1, 10):
        if N == i * j:
            ans = "Yes"
            break
        else:
            ans = "No"
print(ans)

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

if A // 10 == 0 and B // 10 == 0:
  print(A * B)
else:
  print(-1)
# 2 5
#5 10
#9 9

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
data=input().split()
ans=1
count=0

for i in data:
  if int(i)<=9:
    ans*=int(i)
  if int(i)>9:
    count+=1
    
if count>=1:
  print("-1")
elif cuont==0:
  print(ans)

data=input().split()

ans=1
count=0
 
for i in data:
  if int(i)<=9:
    ans*=int(i)
  if int(i)>9:
    count+=1
    
if count>=1:
  print("-1")
elif count==0:
  print(ans)

Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
x = input()
x = int(x)
y = input()
y = int(y)

if x < 10 and y < 10:
	print(x * y)
else:
	print(-1)



x, y = map(int, input().split())

if x < 10 and y < 10:
	print(x * y)
else:
	print(-1)



Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

a = int(input())

b = prime_factorize(a)

c = 10**10
d = 10**10
for i in range(len(b)):
    if i % 2 == 0:
        c *= b[i]
    else:
        d *= b[i]

print(c + d - 2)


a = int(input())

for i in range(int(i**0.5),0,-1):
    if a % i == 0:
        print(int(a/i + i -2))
        break


a = int(input())

for i in range(int(i**0.5),0,-1):
    if a % i == 0:
        print(a/i + i -2)
        break


a = int(input())

for i in range(int(a**0.5),0,-1):
    if a % i == 0:
        print(int(a/i + i -2))
        break


a = list(map(int, input().split()))
if 1<=a[0] and a[0]<=9:
    if 1<=a[1] and a[1]<=9:
        print(a[0]*a[1])
    else:
        print(-1)
else:
    print(-1)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
import numpy as np

N,K = list(map(int, input().split(" ")))
A = list(map(int, input().split(" "))) # consumption coefficient of members
F = list(map(int, input().split(" "))) # difficulty of food

# pair fastest eaters (low consumption coefficient) with most difficult foods
A.sort()
F.sort(reverse=True)
A = np.array(A)
F = np.array(F)

maxT = np.max(A*F)
# use binary search to find lowest possible T
left = -1
right = maxT
while left+1< right:
    mid = (left+right)//2
    if np.maximum(0, A - (mid//F)).sum() <= K:
        right  = mid
    else:
        left = mid
print(right)



import numpy as np

N,K = list(map(int, input().split(" ")))
A = list(map(int, input().split(" "))) # consumption coefficient of members
F = list(map(int, input().split(" "))) # difficulty of food

# pair fastest eaters (low consumption coefficient) with most difficult foods
A.sort()
F.sort(reverse=True)
A = np.array(A)
F = np.array(F)

def how_many_K(A,F,T,K):
    """
    Returns whether the number of training sessions needed for group A with foods F to have a score equal to T is less than K
    """
    num_trains = 0
    for i in range(len(A)):
        a = A[i]
        f = F[i]
        num_trains += max(0, a-T//f)

    if num_trains > K:
        return False
    else:
        return True

maxT = np.max(A*F)
# use binary search to find lowest possible T
left = -1
right = maxT
while left+1< right:
    mid = (left+right)//2
    if how_many_K(A,F,mid,K):
        right  = mid
    else:
        left = mid
print(right)



A, B = list(map(int, input().split(" ")))
if not A >9 and not B >9:
    print(A*B)
else:
    print("-1")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

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

B = [A[i] *F[i] for i in range(0,N)]
d = max(B)

def nex(x):
    count = 0
    for i in range(0,N):
        if x < B[i]:
            count += A[i] - int(x/F[i])
    return count

def target(l,r):
    if r - l == 1:
        if nex(l) <= K:
            return l
        else:
            return r
    elif nex(int((l+r)/2)) <= K:
         return target(l,int((l+r)/2))
    else:
        return target(int((l+r)/2),r)
    
ans = target(0,d)
print(ans)

A,B = map(int,input().split())
if(A >= 10 or B >= 10):
    print(-1)
else:
    print(A * B)

Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):

a,b = map(int, input().split())
ans=a*b
if:a>=10 or b >=10:
    print(-1)
else:
    print(ans)

a,b = map(int, input().split())
ans=a*b
if a>=10 or b >=10:
    print(-1)
else:
    print(ans)

Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
A = int(input())
B = int(input())

if A < 1 or A > 9 or B < 1 or B > 9:
    print("-1")
else:
    print(A*B)

A, B = map(int, input().split())
if A < 1 or A > 9 or B < 1 or B > 9:
    print("-1")
else:
    print(A*B)

Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
a,b=map(int input().split())
if a<10 and b<10:
    print(a*b)
else:
    print(-1)

a,b=map(int, input().split())
if a<10 and b<10:
    print(a*b)
else:
    print(-1)


Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

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

if a[0] < 10 && a[1] < 10:
  print(a[0] * a[1])
else:
  print(-1)

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

if a[0] < 10 and a[1] < 10:
  print(a[0] * a[1])
else:
  print(-1)


Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):

number = input().split(" ")
    


if int(number[0]) <= 9 & int(number[1]) <= 9:
    print(int(number[0]) * int(number[1]))
else:
    print(-1)

print(9 * 9)


number = input().split(" ")

if (int(number[0]) <= 9) & (int(number[1]) <= 9):
    print(int(number[0]) * int(number[1]))
else:
    print(-1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
n = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == n:
            print('Yes')
            quit()
else:
    print('No')


a, b = map(int, input().split())
print(-1 if a not in range(1, 10) or b not in range(1, 10) else a*b)


Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
n = int(input())
a = 0
for i in range(1,10):
    if n % i != 0:
        continue
    else:
        if n / i <= 9:
            a += 1
            break
        else:
            continue
if a == 1:
    print('Yes')
else:
    print('No')

n = int(input())
a = 0
for i in range(1,10):
    if n % i != 0:
        continue
    else:
        if n / i <= 9:
            a += 1
            break
        else:
            continue
if a == 1:
	print('Yes')
else:
	print('No')

n = int(input())
a = 0
for i in range(1,10):
	if n % i != 0:
        continue
    else:
        if n / i <= 9:
            a += 1
            break
        else:
            continue
if a == 1:
	print('Yes')
else:
	print('No')

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

if a > 9 or b > 9:
    print('-1')
else:
	print(a*b)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
A, B = map(int, input().split())
print(0 <= A <= 9 and 0 <= B <= 9)

A, B = map(int, input().split())
if 0 <= A <= 9 and 0 <= B <= 9:
    print(A*B)
else:
    print(-1)

Verdicts: Wrong Answer

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
a,b = map(int, input())
if len(str(a)) == 1 and len(str(b)) == 1:
  print(a*b)
else:
  print(-1)

a,b = map(int, input().split())
if len(str(a)) == 1 and len(str(b)) == 1:
  print(a*b)
else:
  print(-1)

Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
a,b = map(int,input())
if a<=9 and b<=9:
    print(a*b)
else:
    print(-1)

a,b = map(int,input().split())
if a<=9 and b<=9:
    print(a*b)
else:
    print(-1)

Verdicts: Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):
A, B = [int(input()) for i in range(2)]
result = int(int(A)*int(B))
if 9 < int(A) and 9 < int(B):
    print(-1)
else:
    print(result)

A = input()
B = input()
result = int(A)*int(B)
if 9 < int(A):
    print(-1)
elif 9 < int(B):
    print(-1)

else:
    print(result)

A = input()
B = input()
result = int(A)*int(B)
if 9 < int(A):
    print(-1)
elif 9 < int(B):
    print(-1)

else:
    print(result)

A = input()
B = input()
result = int(A)*int(B)
if 9 < int(A):
    print(-1)
elif 9 < int(B):
    print(-1)

else:
    print(result)

A, B =[int(input()) for i in range(2)]
result = int(int(A)*int(B))
if 9 < int(A):
    print(-1)
elif 9 < int(B):
    print(-1)
else:
    print(result)

list = input().split(' ')
A = int(list[0])
B = int(list[1])
if A <= 9 and B <= 9:
    print(A*B)
else:
    print(-1)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

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

if a*b<=81:
  print(a*b)
else:
	print(-1)


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

if a*b<=81:
  print(a*b)
else:
	print(-1)

A, B = map(int, input().split())
if 0 <= A <= 9 and 0 <= B <= 9:
    print(A*B)
else:
    print(-1)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.  Given are two integers A and B.  If Takahashi can calculate A \times B, print the result; if he cannot, print `-1` instead.

Submission attempts (in order):

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

if 9<A || 9<B:
  print(-1)
else:
  print(A*B)
  

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

if (9<A or 9<B):
  print(-1)
else:
  print(A*B)
  
  

Verdicts: Runtime Error

Accepted