output_description stringlengths 15 956 | submission_id stringlengths 10 10 | status stringclasses 3 values | problem_id stringlengths 6 6 | input_description stringlengths 9 2.55k | attempt stringlengths 1 13.7k | problem_description stringlengths 7 5.24k | samples stringlengths 2 2.72k |
|---|---|---|---|---|---|---|---|
Print the largest number among A + B, A - B, and A \times B.
* * * | s497968014 | Runtime Error | p02945 | Input is given from Standard Input in the following format:
A B | A, B = map(int(), input().split())
number1 = A + B
number2 = A - B
number3 = A * B
print(max([number1, number2, number3]))
| Statement
We have two integers: A and B.
Print the largest number among A + B, A - B, and A \times B. | [{"input": "-13 3", "output": "-10\n \n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is\n-10.\n\n* * *"}, {"input": "1 -33", "output": "34\n \n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\n* * *"}, {"input": "13 3", "output": "39\n \n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39."}] |
Print the largest number among A + B, A - B, and A \times B.
* * * | s421926945 | Wrong Answer | p02945 | Input is given from Standard Input in the following format:
A B | kx = list(map(int, input().split()))
k = kx[0]
x = kx[1]
a = x + 1 - k
b = x + k
for i in range(a, b):
print(i, end=" ")
| Statement
We have two integers: A and B.
Print the largest number among A + B, A - B, and A \times B. | [{"input": "-13 3", "output": "-10\n \n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is\n-10.\n\n* * *"}, {"input": "1 -33", "output": "34\n \n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\n* * *"}, {"input": "13 3", "output": "39\n \n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39."}] |
Print the largest number among A + B, A - B, and A \times B.
* * * | s457667521 | Runtime Error | p02945 | Input is given from Standard Input in the following format:
A B | n = map(int, input().split())
print(max(sum(n), n(0) - n(1), n(0) * n(1)))
| Statement
We have two integers: A and B.
Print the largest number among A + B, A - B, and A \times B. | [{"input": "-13 3", "output": "-10\n \n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is\n-10.\n\n* * *"}, {"input": "1 -33", "output": "34\n \n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\n* * *"}, {"input": "13 3", "output": "39\n \n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39."}] |
Print the largest number among A + B, A - B, and A \times B.
* * * | s473382057 | Runtime Error | p02945 | Input is given from Standard Input in the following format:
A B | A, B = input().split()
max(A * B, A + B, A - B)
| Statement
We have two integers: A and B.
Print the largest number among A + B, A - B, and A \times B. | [{"input": "-13 3", "output": "-10\n \n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is\n-10.\n\n* * *"}, {"input": "1 -33", "output": "34\n \n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\n* * *"}, {"input": "13 3", "output": "39\n \n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39."}] |
Print the largest number among A + B, A - B, and A \times B.
* * * | s514321641 | Accepted | p02945 | Input is given from Standard Input in the following format:
A B | a, b = list(map(int, input().strip().split()))
print(max([a * b, a + b, a - b]))
| Statement
We have two integers: A and B.
Print the largest number among A + B, A - B, and A \times B. | [{"input": "-13 3", "output": "-10\n \n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is\n-10.\n\n* * *"}, {"input": "1 -33", "output": "34\n \n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\n* * *"}, {"input": "13 3", "output": "39\n \n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39."}] |
Print the largest number among A + B, A - B, and A \times B.
* * * | s449028537 | Accepted | p02945 | Input is given from Standard Input in the following format:
A B | num = input().split()
A = int(num[0])
B = int(num[1])
s = [A + B, A - B, A * B]
print(max(s))
| Statement
We have two integers: A and B.
Print the largest number among A + B, A - B, and A \times B. | [{"input": "-13 3", "output": "-10\n \n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is\n-10.\n\n* * *"}, {"input": "1 -33", "output": "34\n \n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\n* * *"}, {"input": "13 3", "output": "39\n \n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39."}] |
For each dataset, print the sum of digits in x. | s268977098 | Accepted | p02416 | The input consists of multiple datasets. For each dataset, an integer x is
given in a line. The number of digits in x does not exceed 1000.
The input ends with a line including single zero. Your program should not
process for this terminal symbol. | for a in iter(input, "0"):
print(sum([int(s) for s in a]))
| Sum of Numbers
Write a program which reads an integer and prints sum of its digits. | [{"input": "55\n 1000\n 0", "output": "10\n 1"}] |
For each dataset, print the sum of digits in x. | s873711585 | Accepted | p02416 | The input consists of multiple datasets. For each dataset, an integer x is
given in a line. The number of digits in x does not exceed 1000.
The input ends with a line including single zero. Your program should not
process for this terminal symbol. | # coding: utf-8
# Here your code !
def func():
inputdata = []
while True:
try:
line = input().rstrip()
if int(line) == 0:
break
else:
inputdata.append(line)
except EOFError:
return 0
except:
return inputError()
data = [sum([int(char) for char in item]) for item in inputdata]
[print(item) for item in data]
def inputError():
print("input Error")
return -1
func()
| Sum of Numbers
Write a program which reads an integer and prints sum of its digits. | [{"input": "55\n 1000\n 0", "output": "10\n 1"}] |
For each dataset, print the sum of digits in x. | s399970840 | Wrong Answer | p02416 | The input consists of multiple datasets. For each dataset, an integer x is
given in a line. The number of digits in x does not exceed 1000.
The input ends with a line including single zero. Your program should not
process for this terminal symbol. | word = input()
result = 0
for i in word:
result += int(i)
print(result)
| Sum of Numbers
Write a program which reads an integer and prints sum of its digits. | [{"input": "55\n 1000\n 0", "output": "10\n 1"}] |
For each dataset, print the sum of digits in x. | s106502819 | Wrong Answer | p02416 | The input consists of multiple datasets. For each dataset, an integer x is
given in a line. The number of digits in x does not exceed 1000.
The input ends with a line including single zero. Your program should not
process for this terminal symbol. | a = list(input())
b = [int(a) for a in a]
print(sum(b))
| Sum of Numbers
Write a program which reads an integer and prints sum of its digits. | [{"input": "55\n 1000\n 0", "output": "10\n 1"}] |
For each dataset, print the sum of digits in x. | s140377123 | Wrong Answer | p02416 | The input consists of multiple datasets. For each dataset, an integer x is
given in a line. The number of digits in x does not exceed 1000.
The input ends with a line including single zero. Your program should not
process for this terminal symbol. | print(
"".join(
c.upper() if c.islower() else c.lower() if c.isupper() else c for c in input()
)
)
| Sum of Numbers
Write a program which reads an integer and prints sum of its digits. | [{"input": "55\n 1000\n 0", "output": "10\n 1"}] |
For each dataset, print the sum of digits in x. | s004482714 | Wrong Answer | p02416 | The input consists of multiple datasets. For each dataset, an integer x is
given in a line. The number of digits in x does not exceed 1000.
The input ends with a line including single zero. Your program should not
process for this terminal symbol. | print(*[sum(map(int, line.strip())) for line in open(0).readlines()][:-1], sep="\n")
| Sum of Numbers
Write a program which reads an integer and prints sum of its digits. | [{"input": "55\n 1000\n 0", "output": "10\n 1"}] |
For each dataset, print the sum of digits in x. | s705373080 | Accepted | p02416 | The input consists of multiple datasets. For each dataset, an integer x is
given in a line. The number of digits in x does not exceed 1000.
The input ends with a line including single zero. Your program should not
process for this terminal symbol. | a = []
w = 1
while w != 0:
w = int(input())
a.append(w)
a.pop()
for i in a:
s = 0
for j in range(len(str(i))):
s += int(str(i)[j])
print("{0}".format(s))
| Sum of Numbers
Write a program which reads an integer and prints sum of its digits. | [{"input": "55\n 1000\n 0", "output": "10\n 1"}] |
For each dataset, print the sum of digits in x. | s612317402 | Accepted | p02416 | The input consists of multiple datasets. For each dataset, an integer x is
given in a line. The number of digits in x does not exceed 1000.
The input ends with a line including single zero. Your program should not
process for this terminal symbol. | l = list(map(int, input()))
while l[0]:
print(sum(l))
l = list(map(int, input()))
| Sum of Numbers
Write a program which reads an integer and prints sum of its digits. | [{"input": "55\n 1000\n 0", "output": "10\n 1"}] |
Print the answer.
* * * | s849649958 | Runtime Error | p02553 | Input is given from Standard Input in the following format:
a b c d | a,b,c,d = map(int,input())
print(max(a*c,a*d,b*c,b*d))
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s143846826 | Runtime Error | p02553 | Input is given from Standard Input in the following format:
a b c d | a, b, c, d = int(map(int, input().split()))
print(max(a * c, max(a * d, max(b * c, b * d))))
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s982221114 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | data = list(map(int,input().split()))
a = data[0]
b = data[1]
c = data[2]
d = data[3]
data[0] = a*c
data[1] = a*d
data[2] = b*c
data[3] = b*d
print(max(data)) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s738410372 | Runtime Error | p02553 | Input is given from Standard Input in the following format:
a b c d | a=int(input("a="))
b=int(input("b="))
c=int(input("c="))
d=int(input("d="))
X=max(a*c,a*d)
X=max(X,b*c)
X=max((X,b*d))
print(X) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s349404115 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | a, b, c, d = input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
def m():
if a>=0 and d<=0:
max=a*d
print(max)
elif a>=0 and c>=0:
max=b*d
print(max)
elif b<=0 and c>=0:
max=b*c
print(max)
elif b<=0 and d<=0:
max=a*c
print(max)
elif a<=0 and b>=0 and c<=0 and d>=0:
if a*c>=b*d:
max=a*c
print(max)
else:
max=b*d
print(max)
elif a>=0 and c<=0 and d>=0:
max=b*d
print(max)
elif b<=0 and c<=0 and d>=0:
max=a*c
print(max)
elif a<=0 and b>=0 and c>=0:
max=b*d
print(max)
elif a<=0 and b>=0 and d<=0:
max=a*c
print(max)
m() | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s601779112 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | a,b,c,d=map(int,input().split())
v1=0
v2=0
flag=0
if a==0 and b!=0:
flag=1
v1=b
elif a!=0 and b==0:
flag=1
v1=a
if c==0 and d!=0:
flag=1
v2=d
elif c!=0 and d==0:
flag=1
v2=c
if c<0 and d<0 and a>0 and b>0:
flag=1
v1=a
v2=d
if a<0 and b<0 and c>0 and d>0:
flag=1
v1=b
v2=c
if c<0 and d>0 and a<0 and b>0:
flag=1
v1=max(abs(a),b)
v2=max(abs(c),d)
if d<0 and c>0 and b<0 and a>0:
flag=1
v1=max(abs(b),a)
v2=max(abs(d),c)
if flag==0:
if d<0 or c<0 or a<0 or b<0:
v1=max(abs(a),abs(b))
v2=max(abs(c),abs(d))
if v1==abs(a) and a<0:
flag=-1
elif v1==abs(b) and b<0:
flag=-1
elif v2==abs(c) and c<0:
flag=-1
elif v2==abs(d) and d<0:
flag=-1
else:
flag=1
if (a>0 and b>0 and c>0 and d>0) or (a<0 and b<0 and c<0 and d<0):
flag=1
v1=b
v2=d
print(v1*v2*flag)
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s915988772 | Runtime Error | p02553 | Input is given from Standard Input in the following format:
a b c d | N = int(input())
INF = 10 ** 9
y_min_pos = [INF, []]
x_min_pos = [INF, []]
y_max_pos = [0, []]
x_max_pos = [0, []]
for _ in range(N):
# print(x_min_pos, y_min_pos, y_max_pos, x_max_pos)
x, y = map(int, input().split())
if y <= y_min_pos[0]:
if y == y_min_pos[0]:
y_min_pos[1].append(x)
else:
y_min_pos = [y, [x]]
if y >= y_max_pos[0]:
if y == y_max_pos[0]:
y_max_pos[1].append(x)
else:
y_max_pos = [y, [x]]
if x <= x_min_pos[0]:
if x == x_min_pos[0]:
x_min_pos[1].append(y)
else:
x_min_pos = [x, [y]]
if x >= x_max_pos[0]:
if x == x_max_pos[0]:
x_max_pos[1].append(y)
else:
x_max_pos = [x, [y]]
# print(x_max_pos[1])
x_min_ymax = max(x_min_pos[1])
x_max_ymax = max(x_max_pos[1])
y_min_xmax = max(y_min_pos[1])
y_max_xmax = max(y_max_pos[1])
x_min_ymin = min(x_min_pos[1])
x_max_ymin = min(x_max_pos[1])
y_min_xmin = min(y_min_pos[1])
y_max_xmin = min(y_max_pos[1])
y_min_max = max(
abs(y_min_xmax - x_min_pos[0]) + abs(y_min_pos[0] - x_min_ymax),
abs(y_min_xmax - y_max_xmin) + abs(y_min_pos[0] - y_max_pos[0]),
abs(y_min_xmin - x_max_pos[0]) + abs(y_min_pos[0] - x_max_ymax),
abs(y_min_xmin - y_max_xmax) + abs(y_min_pos[0] - y_max_pos[0]),
)
y_max_max = max(
abs(y_max_xmax - x_min_pos[0]) + abs(y_max_pos[0] - x_min_ymin),
abs(y_max_xmax - y_min_xmin) + abs(y_max_pos[0] - y_min_pos[0]),
abs(y_max_xmin - x_max_pos[0]) + abs(y_max_pos[0] - x_max_ymin),
abs(y_max_xmin - y_max_xmax) + abs(y_max_pos[0] - y_min_pos[0]),
)
x_min_max = max(
abs(x_min_ymax - y_min_pos[0]) + abs(x_min_pos[0] - y_min_xmax),
abs(x_min_ymax - x_max_ymin) + abs(x_min_pos[0] - x_max_pos[0]),
abs(x_min_ymin - y_max_pos[0]) + abs(x_min_pos[0] - y_max_xmax),
abs(x_min_ymin - x_max_ymax) + abs(x_min_pos[0] - x_max_pos[0]),
)
x_max_max = max(
abs(x_max_ymax - y_min_pos[0]) + abs(x_max_pos[0] - y_min_xmin),
abs(x_max_ymax - x_min_ymin) + abs(x_max_pos[0] - x_min_pos[0]),
abs(x_max_ymin - y_max_pos[0]) + abs(x_max_pos[0] - y_max_xmin),
abs(x_max_ymin - x_min_ymax) + abs(x_max_pos[0] - x_min_pos[0]),
)
print(max(y_min_max, y_max_max, x_min_max, x_max_max))
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s508498352 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | A,B,C,D=map(int,input().split())
lis=[A*C,A*D,B*C,B*D]
print(max(lis)) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s226095019 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | a, b, c, d = [int(t) for t in input().split()]
print(max([b * d, a * c, a * d, b * d]))
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s465775648 | Runtime Error | p02553 | Input is given from Standard Input in the following format:
a b c d | a, b, c, d = int(input())
list1 = []
list1.append(a * c)
list1.append(a * d)
list1.append(b * c)
list1.append(b * c)
list1.sort()
print(list1[3])
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s839945436 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
A,B,C,D=MI()
ans1=A*C
ans2=A*D
ans3=B*C
ans4=B*D
Max=max(ans1,ans2,ans3,ans4)
if A<=0<=B or C<=0<=D:
Max=max(0,Max)
print(Max) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s646270661 | Runtime Error | p02553 | Input is given from Standard Input in the following format:
a b c d | a, b, c, d = (int(x) for x in input().split())
print(max[a * c, a * d, b * c, b * d])
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s972737418 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | a,b,c,d=map(int, input().split(" "))
print(max(a*b, a*c, a*d, b*c, b*d, c*d)) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s630381209 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | l = list(map(int, input().split()))
print(max(l[0] * l[2], l[0] * l[3], l[1] * l[2], l[1] * l[3]))
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s773577416 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | a,b,c,d = map(int,input().split())
List = set([])
List.add(a*c)
List.add(a*d)
List.add(b*c)
List.add(b*d)
print(max(List)) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s469039348 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | [a, b, c, d] = [int(inp) for inp in input().split()]
print(max([a * c, b * d]))
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s720999703 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | a, b, c, d = [int(x) for x in input().split(" ")]
max_mul = -1 * 10**18
max_mul = max(max_mul, a * c)
max_mul = max(max_mul, a * d)
max_mul = max(max_mul, b * c)
max_mul = max(max_mul, b * d)
print(max_mul)
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s195271927 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | list1 = input()
list2 = list1.split()
a = int(list2[0])
b = int(list2[1])
c = int(list2[2])
d = int(list2[3])
# x = [i for i in range(a,b+1)]
# y = [j for j in range(c,d+1)]
x_min = a
x_max = b
y_min = c
y_max = d
answer_list = [x_max * y_max, x_max * y_min, x_min * y_max, x_min * y_min]
print(max(answer_list))
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s518185456 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | (
a,
b,
c,
d,
) = map(int, input().split())
x = a * c
y = a * d
z = b * c
w = b * d
s = b * d
if w < x and z < x and y < x:
print(x)
elif w < y and z < y and x < y:
print(y)
elif w < z and x < z and y < z:
print(z)
elif y < w and z < w and x < w:
print(w)
else:
print(s)
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s349059088 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | in_n = input().split()
a, b, c, d = int(in_n[0]), int(in_n[1]), int(in_n[2]), int(in_n[3])
num_list = []
num_list.append(a * c)
num_list.append(a * d)
num_list.append(b * c)
num_list.append(b * d)
if a <= 0 and b >= 0:
num_list.append(0)
if c <= 0 and d >= 0:
num_list.append(0)
print(max(num_list))
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s086871217 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | a, b, c, d = map(int, input().split())
x = [a, b]
y = [c, d]
maxVal = max(x) * max(y)
if (
min(x) * min(y) > maxVal
and min(x) * min(y) > min(x) * max(y)
and min(x) * min(y) > max(x) * min(y)
):
res = min(x) * min(y)
elif (
min(x) * max(y) > maxVal
and min(x) * max(y) > min(x) * min(y)
and min(x) * max(y) > max(x) * min(y)
):
res = min(x) * max(y)
elif (
max(x) * min(y) > maxVal
and max(x) * min(y) > min(x) * max(y)
and max(x) * min(y) > min(x) * min(y)
):
res = max(x) * min(y)
else:
res = maxVal
print(res)
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s794639649 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | a,b,c,d= map(int,input().split())
A=max(a*c,a*d,b*c,b*d)
print(A) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s922117515 | Runtime Error | p02553 | Input is given from Standard Input in the following format:
a b c d | a, b, c, d = input().split()
xy1 = a*c
xy2 = a*d
xy3 = b*c
xy4 = b*d
print(max([xy1, xy2, xy3, xy4])) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s989812203 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | A=input().split()
a=int(A[0])
b=int(A[1])
c=int(A[2])
d=int(A[3])
e=a*c
f=a*d
g=b*c
h=b*d
if e>f:
f=e
if g>h:
h=g
if f>h:
h=f
print(h) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s432351197 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | if __name__ == "__main__":
a,b,c,d = (int(x) for x in input().split())
if b <= 0 :
if d <= 0:
xy = a * c
elif d > 0:
if c > 0:
xy = b * c
elif c == 0:
xy = 0
elif c < 0:
xy = a * c
elif b > 0:
if a >= 0:
if d <= 0:
xy = a * d
elif d > 0:
xy = b * d
elif a < 0:
if d <= 0:
xy = a * c
elif d > 0:
if c >= 0:
xy = b * d
elif c < 0:
if abs(a * c) > abs(b * d):
xy = a * c
else:
xy = b * d
print(xy)
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s269301830 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | tmp = [int(e) for e in input().split()]
a = tmp[0]
b = tmp[1]
c = tmp[2]
d = tmp[3]
res = a * c
tmp = a * d
if tmp > res:
res = tmp
tmp = b * c
if tmp > res:
res = tmp
tmp = b * d
if tmp > res:
res = tmp
print(res)
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s285801467 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | a, b, c, d = [int(x) for x in input().split()]
max_x = b
max_y = d
min_x = a
min_y = c
li_1 = [max_x, min_x]
li_2 = [max_y, min_y]
max_num = -(10**9)
for i in li_1:
for j in li_2:
num = i * j
if num > max_num:
max_num = num
print(max_num)
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s839792115 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | nums=[int(e) for e in input().split()]
if nums[0]>=0 and nums[1]>=0 and nums[2]>=0 and nums[3]>=0:
print(nums[1]*nums[3])
elif nums[0]>=0 and nums[1]>=0 and nums[2]<0 and nums[3]>=0:
print(nums[1]*nums[3])
elif nums[0]>=0 and nums[1]>=0 and nums[2]<0 and nums[3]<0:
print(nums[0]*nums[3])
elif nums[0]<0 and nums[1]>=0 and nums[2]>=0 and nums[3]>=0:
print(nums[1]*nums[3])
elif nums[0]<0 and nums[1]>=0 and nums[2]<0 and nums[3]>=0:
if abs(nums[0])*abs(nums[2]) > abs(nums[1])*abs(nums[3]):
print(nums[0]*nums[2])
elif abs(nums[0])*abs(nums[2]) <= abs(nums[1])*abs(nums[3]):
print(nums[1]*nums[3])
elif nums[0]<0 and nums[1]>=0 and nums[2]<0 and nums[3]<0:
print(nums[0]*nums[2])
elif nums[0]<0 and nums[1]<0 and nums[2]>=0 and nums[3]>=0:
print(nums[1]*nums[2])
elif nums[0]<0 and nums[1]<0 and nums[2]<0 and nums[3]>=0:
print(nums[0]*nums[2])
elif nums[0]<0 and nums[1]<0 and nums[2]<0 and nums[3]<0:
print(nums[0]*nums[2])
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s292810383 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | S = list(input().split())
A = [int(n) for n in S]
if A[0] < 0 and A[1] < 0 and A[2] < 0 and A[3] < 0:
print(A[0] * A[2])
elif A[0] <= 0 and A[1] <= 0 and A[2] <= 0 and A[3] >= 0:
print(A[0] * A[2])
elif A[0] <= 0 and A[1] <= 0 and A[2] >= 0 and A[3] >= 0:
print(A[1] * A[2])
elif A[0] <= 0 and A[1] >= 0 and A[2] <= 0 and A[3] <= 0:
print(A[0] * A[2])
elif A[0] <= 0 and A[1] >= 0 and A[2] <= 0 and A[3] >= 0:
print(max(A[0] * A[2], A[1] * A[3]))
elif A[0] <= 0 and A[1] >= 0 and A[2] >= 0 and A[3] >= 0:
print(A[1] * A[3])
elif A[0] >= 0 and A[1] >= 0 and A[2] <= 0 and A[3] <= 0:
print(A[0] * A[3])
elif A[0] >= 0 and A[1] >= 0 and A[2] <= 0 and A[3] >= 0:
print(A[1] * A[3])
elif A[0] >= 0 and A[1] >= 0 and A[2] >= 0 and A[3] >= 0:
print(A[1] * A[3])
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s651529331 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | nums = [int(x) for x in input().split()]
sign = [0] * 4
for x in range(4):
if nums[x] < 0:
sign[x] = 1
result = min(nums[0:2]) * min(nums[2:])
if sum(sign) == 1 or sum(sign) == 0:
result = max(nums[0:2]) * max(nums[2:])
if sum(sign) == 2:
if (sign[0] == 1 and sign[1]) or (sign[2] == 1 and sign[3] == 1):
if sign[0] == 1:
result = max(nums[0:2]) * min(nums[2:])
elif sign[2] == 1:
result = min(nums[0:2]) * max(nums[2:])
else:
result = nums[1] * nums[3]
print(result)
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s111008726 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | a=list(map(int,input().split()))
print(max([a[0]*a[2],a[0]*a[3],a[1]*a[2],a[1]*a[3]]))
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s554391019 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | if __name__=='__main__':
a,b,c,d=[int(_) for _ in input().split()]
print(max(a*c,a*d,b*c,b*d)) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s279589120 | Runtime Error | p02553 | Input is given from Standard Input in the following format:
a b c d | n = int(input())
mod = 10**9 + 7
dp = [0] * 2001
dp[0] = 1
sdp = [0] * 2001
sdp[0] = 1
for i in range(2000):
dp[i + 1] = sdp[i - 2]
sdp[i + 1] = dp[i + 1] + sdp[i]
print(dp[n] % mod)
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s089603176 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | a, b, c, d = input().split()
if int(a) < 0 and int(c) < 0:
if int(a) * int(c) < int(b) * int(d):
print(int(b) * int(d))
else:
print(int(a) * int(c))
elif int(a) < 0:
print(int(b) * int(d))
elif int(c) < 0:
print(int(b) * int(d))
elif int(a) > 0 and int(c) > 0:
print(int(b) * int(d))
elif int(a) < 0 and int(b) < 0:
print(int(b) * int(c))
elif int(c) < 0 and int(d) < 0:
print(int(a) * int(d))
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s027993772 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | a, b, c, d = map(int, input().split())
minx = min(a, b)
miny = min(c, d)
maxx = max(a, b)
maxy = max(c, d)
if maxx >= 0 and maxy >= 0:
print(maxx * maxy)
elif maxx < 0 and maxy < 0:
print(minx * miny)
elif maxx > 0:
print(minx * maxy)
else:
print(maxy * minx)
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s778335970 | Accepted | p02553 | Input is given from Standard Input in the following format:
a b c d | a,b,c,d=map(int, input().split())
print(b*d if a>=0 and d>=0 else d*a if a>=0 and d<=0 else b*d if b>=0 and a<=0 and c>=0
else max(b*d, c*a) if a<=0 and b>=0 and c<=0 and d>=0 else c*a if a<=0 and b>=0 and d<=0
else b*c if b<=0 and c>=0 else c*a ) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s427707560 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | li = input().split()
print(int(li[1]) * int(li[3]))
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s800093453 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | a = sorted(list(map(int, input().split())))
print(max(
a[0] * a[1], a[-2] * a[-1]
)) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s981986499 | Runtime Error | p02553 | Input is given from Standard Input in the following format:
a b c d | a,b,c,d=map(int,input().split())
if a>0 and c>0:
l=list(range(a,b+1))
m=list(range(c,d+1))
p=max(l)
q=max(m)
c=p*q
elif a>0 and c<0:
l=list(range(d,c+1,-1))
m=list(range(a,b+1))
p=max(l)
q=min(m)
c=p*q
elif a<0 and c<0:
l=list(range(b,a-1,-1))
m=list(range(d,c-1,-1))
p=min(l)
q=min(m)
c=p*q
print(c) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s843020243 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | (X1,X2,Y1,Y2)=list(map(int,input().split()))
#print (X1,X2,Y1,Y2)
ans=X2*Y2
if X1<0 and Y1 <0:
ans=max(ans,X1*Y1)
print (ans) | Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s936737920 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | x = input().split(" ")
a = int(x[0])
b = int(x[1])
c = int(x[2])
d = int(x[3])
ab = a + b
cd = c + d
con1 = a >= -10**9 and a <= b and b <= 10**9
con2 = c >= -10**9 and c <= d and d <= 10**9
def positive(a, b, c, d):
if a >= b and c >= d:
return a * c
elif a >= b and c <= d:
return a * d
elif a <= b and c >= d:
return b * c
else:
return b * d
def negativeLeft(a, b, c, d):
if a >= b and c >= d:
return a * d
elif a >= b and c <= d:
return a * c
elif a <= b and c >= d:
return b * d
else:
return b * c
def negativeRight(a, b, c, d):
if a >= b and c >= d:
return b * c
elif a >= b and c <= d:
return b * d
elif a <= b and c >= d:
return a * c
else:
return a * d
def negative(a, b, c, d):
if a >= b and c >= d:
return b * d
elif a >= b and c <= d:
return b * c
elif a <= b and c >= d:
return a * d
else:
return a * c
if con1 == True and con2 == True:
if ab >= 0 and cd >= 0:
print(positive(a, b, c, d))
elif ab >= 0 and cd <= 0:
print(negativeRight(a, b, c, d))
elif ab <= 0 and cd >= 0:
print(negativeLeft(a, b, c, d))
else:
print(negative(a, b, c, d))
else:
print()
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s470971320 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | L = list(map(int, input().split()))
X = L[:2]
Y = L[2:]
# ans = 0
ans_max = -(10**9)
for x in X:
for y in Y:
ans = x * y
if ans >= ans_max:
ans_max = ans
print(ans_max)
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the answer.
* * * | s121463307 | Wrong Answer | p02553 | Input is given from Standard Input in the following format:
a b c d | a,b,c,d = map(int,input().split())
answer =0
if b < 0:
if c < 0:
answer = a*c
if c>=0:
answer = a * c
if b>=0:
if a <0:
answer = max(a*c ,b * d,0)
if a >= 0:
if d< 0:
if a == 0:
answer = 0
else:
answer = a*d
if d>=0:
answer = b*d
print(answer)
| Statement
Given are integers a,b,c and d. If x and y are integers and a \leq x \leq b
and c\leq y \leq d hold, what is the maximum possible value of x \times y? | [{"input": "1 2 1 1", "output": "2\n \n\nIf x = 1 and y = 1 then x \\times y = 1. If x = 2 and y = 1 then x \\times y =\n2. Therefore, the answer is 2.\n\n* * *"}, {"input": "3 5 -4 -2", "output": "-6\n \n\nThe answer can be negative.\n\n* * *"}, {"input": "-1000000000 0 -1000000000 0", "output": "1000000000000000000"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s512148673 | Runtime Error | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | a=[input() for i in range]
c=""
for i in range(len(a[0])+2):
c=c+"#"
print(c)
for i in range(len(a[0]+2):
print("#"+a[i]+"#")
print(c) | Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s021884109 | Wrong Answer | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | H, W = map(int, input().split())
S = [0] * (H + 2)
S[0] = "*" * (W + 2)
S[H + 1] = "*" * (W + 2)
for h in range(1, H + 1):
S[h] = "*" + input() + "*"
print(*S, sep="\n")
| Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s082279828 | Accepted | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | #!/usr/bin/env python3
import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random # random, uniform, randint, randrange, shuffle, sample
# import string # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict # subclass of dict. defaultdict(facroty)
# from collections import Counter # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce # reduce(f, iter[, init])
# from functools import lru_cache # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate # accumulate(iter[, f])
# from operator import itemgetter # itemgetter(1), itemgetter('key')
# from fractions import gcd # for Python 3.4 (previous contest @AtCoder)
def main():
mod = 1000000007 # 10^9+7
inf = float("inf") # sys.float_info.max = 1.79...e+308
# inf = 2 ** 64 - 1 # (for fast JIT compile in PyPy) 1.84...e+19
sys.setrecursionlimit(10**6) # 1000 -> 1000000
def input():
return sys.stdin.readline().rstrip()
def ii():
return int(input())
def mi():
return map(int, input().split())
def mi_0():
return map(lambda x: int(x) - 1, input().split())
def lmi():
return list(map(int, input().split()))
def lmi_0():
return list(map(lambda x: int(x) - 1, input().split()))
def li():
return list(input())
h, w = mi()
grid = [input() for _ in range(h)]
print("#" * (w + 2))
for i in range(h):
print("#" + grid[i] + "#")
print("#" * (w + 2))
if __name__ == "__main__":
main()
| Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s593234476 | Accepted | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | import sys
import math
import collections
import itertools
import array
import inspect
# Set max recursion limit
sys.setrecursionlimit(1000000)
# Debug output
def chkprint(*args):
names = {id(v): k for k, v in inspect.currentframe().f_back.f_locals.items()}
print(", ".join(names.get(id(arg), "???") + " = " + repr(arg) for arg in args))
# Binary converter
def to_bin(x):
return bin(x)[2:]
def li_input():
return [int(_) for _ in input().split()]
def gcd(n, m):
if n % m == 0:
return m
else:
return gcd(m, n % m)
def gcd_list(L):
v = L[0]
for i in range(1, len(L)):
v = gcd(v, L[i])
return v
def lcm(n, m):
return (n * m) // gcd(n, m)
def lcm_list(L):
v = L[0]
for i in range(1, len(L)):
v = lcm(v, L[i])
return v
# Width First Search (+ Distance)
def wfs_d(D, N, K):
"""
D: 隣接行列(距離付き)
N: ノード数
K: 始点ノード
"""
dfk = [-1] * (N + 1)
dfk[K] = 0
cps = [(K, 0)]
r = [False] * (N + 1)
r[K] = True
while len(cps) != 0:
n_cps = []
for cp, cd in cps:
for i, dfcp in enumerate(D[cp]):
if dfcp != -1 and not r[i]:
dfk[i] = cd + dfcp
n_cps.append((i, cd + dfcp))
r[i] = True
cps = n_cps[:]
return dfk
# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
"""
v: 現在のノード
pre: 1つ前のノード
dist: 現在の距離
以下は別途用意する
D: 隣接リスト(行列ではない)
D_dfs_d: dfs_d関数で用いる,始点ノードから見た距離リスト
"""
global D
global D_dfs_d
D_dfs_d[v] = dist
for next_v, d in D[v]:
if next_v != pre:
dfs_d(next_v, v, dist + d)
return
def sigma(N):
ans = 0
for i in range(1, N + 1):
ans += i
return ans
class Combination:
def __init__(self, n, mod):
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, n + 1):
g1.append((g1[-1] * i) % mod)
inverse.append((-inverse[mod % i] * (mod // i)) % mod)
g2.append((g2[-1] * inverse[-1]) % mod)
self.MOD = mod
self.N = n
self.g1 = g1
self.g2 = g2
self.inverse = inverse
def __call__(self, n, r):
if r < 0 or r > n:
return 0
r = min(r, n - r)
return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD
# --------------------------------------------
dp = None
def main():
H, W = li_input()
S = [input() for _ in range(H)]
print("#" * (W + 2))
for s in S:
print("#{}#".format(s))
print("#" * (W + 2))
main()
| Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s792295133 | Wrong Answer | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | # -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math
import itertools
import random
# NO, PAY-PAY
# import numpy as np
# import statistics
# from statistics import mean, median,variance,stdev
def inputInt():
return int(input())
def inputMap():
return map(int, input().split())
def inputList():
return list(map(int, input().split()))
def main():
H, W = inputMap()
a = []
for i in range(H):
tmp = input()
tmp = "*" + tmp + "*"
a.append(tmp)
tmp = ""
for i in range(W + 2):
tmp += "*"
print(tmp)
for i in a:
print(i)
print(tmp)
class UnionFind(object):
def __init__(self, n=1):
self.par = [i for i in range(n)]
self.rank = [0 for _ in range(n)]
self.size = [1 for _ in range(n)]
# x が属するグループを探索
def find(self, x):
if self.par[x] == x:
return x
else:
self.par[x] = self.find(self.par[x])
return self.par[x]
# x と y のグループを結合
def union(self, x, y):
x = self.find(x)
y = self.find(y)
if x != y:
# メンバ数の更新
sum = self.size[x] + self.size[y]
self.size[x] = sum
self.size[y] = sum
# 短いリストを長いリストのルートに繋ぎ直す
if self.rank[x] < self.rank[y]:
x, y = y, x
if self.rank[x] == self.rank[y]:
self.rank[x] += 1
self.par[y] = x
# x と y が同じグループがどうか
def is_same(self, x, y):
return self.find(x) == self.find(y)
# x が属するグループのメンバ数を返却
def getSize(self, x):
par_x = self.find(x)
return self.size[par_x]
if __name__ == "__main__":
main()
| Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s405558480 | Runtime Error | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
string[] input = ReadLine().Split();
int h = int.Parse(input[0]);
int w = int.Parse(input[1]);
List<List<string>> a = new List<List<string>>();
List<string> slis = new List<string>();
string s = "";
for (int i=0;i<w+2;i++)
{
s+="#";
}
a.Add(s.ToList().ConvertAll(x=>x.ToString()));
for (int i=0;i<h;i++)
{
slis.Clear();
slis.Add("#");
slis.AddRange(ReadLine().ToList().ConvertAll(x=>x.ToString()));
slis.Add("#");
a.Add(slis);
}
a.Add(s.ToList().ConvertAll(x=>x.ToString()));
foreach (var i in a)
{
WriteLine(string.Join("",i));
}
}
} | Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s049655132 | Accepted | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | h, w = (int(i) for i in input().split())
sharp = "#" * (w + 2)
print(sharp)
for i in range(h):
ans = input()
output = "#" + ans + "#"
print(output)
print(sharp)
| Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s499558498 | Wrong Answer | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | H, W = map(int, input().split())
edge = [["#"] * (W + 2)]
output = edge + [["#"] + list(input()) + ["#"] for __ in range(H)] + edge
print(output)
for row in output:
row_str = "".join(row)
print(row_str)
| Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s933811044 | Runtime Error | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | h,w = (int(i) for i in input().split())
a[]
for i in range(h):
a.append(input())
print('#'*(w+2))
for i in range(h):
print('#'+ a[i] + '#')
print('#'*(w+2)) | Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s089944940 | Accepted | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | import math
import sys
def getinputdata():
# 配列初期化
array_result = []
data = input()
array_result.append(data.split(" "))
flg = 1
try:
while flg:
data = input()
array_temp = []
if data != "":
array_result.append(data.split(" "))
flg = 1
else:
flg = 0
finally:
return array_result
arr_data = getinputdata()
h = int(arr_data[0][0])
w = int(arr_data[0][1])
s = ""
s += (w + 2) * "#"
s += "\n"
for i in range(1, 1 + h):
s += "#"
s += "".join(arr_data[i])
s += "#\n"
s += (w + 2) * "#"
print(s)
| Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s458828491 | Wrong Answer | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | a = input().split(" ")
tmp_out = [[""] for i in range(int(a[0]) + 2)]
for j in range(int(a[1]) + 2):
tmp_out[0] = ["".join(tmp_out[0] + ["#"])]
for i in range(1, int(a[0]) + 1):
tmp = input().split(" ")
tmp_out[i] = ["".join(["#"] + tmp + ["#"])]
tmp_out[int(a[0]) + 1] = tmp_out[0]
for i in range(int(a[0]) + 2):
print(tmp_out[i])
| Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s687292505 | Runtime Error | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | h, w = map(int,input().split()
a = [row for row in range(h)]
print('#' * w)
for i in range(h):
print('#' + a[i] + '#')
print('#' * w) | Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s835163518 | Runtime Error | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} |
h,w = map(int,input().split())
s = [input() for i in range(h)]
print("#" * (w + 2)
for i in range(h):
print("#" + s[i] + "#")
print("#" * (w + 2))
| Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s556712295 | Runtime Error | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | h, w = map(int, input().split())
x = [0]*h
for i in range(h):
x[i] = input()
for i in range(w+):
print('#', end='')
print('#')
for i in range(h):
print('#' + x[i] + '#')
for i in range(w+2):
print('#', end='') | Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s555680476 | Runtime Error | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | h, w = map(int, input().split())
a = []
b = list([['#']*(w+2)]*(h+2)) #[]で囲うことが重要
for i in range(h):
a.append(list(input())) #splitを入れなければOK
for j in range(h):
for k in range(w):
b[j+1][k+1] = a[j][k]
print(b)
| Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s494769028 | Runtime Error | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | h, w = map(int, input().split())
a = []
b = list([['#']*(w+2)]*(h+2)) #[]で囲うことが重要
for i in range(h):
a.append(list(input())) #splitを入れなければOK
for j in range(h):
for k in range(w)
b[j+1][k+1] = a[j][k]
print(b) | Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s599894102 | Runtime Error | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | H,W = map(int,input().split())
print('#'*(W+2)
for i in range(H):
a = input()
print('#'+a+'#')
print('#'*(W+2)) | Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s965846258 | Runtime Error | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | h, w = map(int, input().split())
for i in range(h+2):
if i == 0 or i == h+1:
print("#"*(w+2))
else:
print("#"+input()"#")
| Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the image surrounded by a box that consists of `#` and has a thickness
of 1.
* * * | s120077687 | Runtime Error | p03712 | Input is given from Standard Input in the following format:
H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW} | h,w=map(int,input().split());print("#"*w);print("\n".join(["#"input()"#"for _ in [0]*h]));print("#"*w) | Statement
You are given a image with a height of H pixels and a width of W pixels. Each
pixel is represented by a lowercase English letter. The pixel at the i-th row
from the top and j-th column from the left is a_{ij}.
Put a box around this image and output the result. The box should consist of
`#` and have a thickness of 1. | [{"input": "2 3\n abc\n arc", "output": "#####\n #abc#\n #arc#\n #####\n \n\n* * *"}, {"input": "1 1\n z", "output": "###\n #z#\n ###"}] |
Print the answer.
* * * | s097482327 | Wrong Answer | p02800 | Input is given from Standard Input in the following format:
H W
A_1
A_2
\vdots
A_H | print("fuck")
| Statement
We have an H \times W grid, where each square is painted white or black in the
initial state. Given are strings A_1, A_2, ..., A_H representing the colors of
the squares in the initial state. For each pair (i, j) (1 \leq i \leq H, 1
\leq j \leq W), if the j-th character of A_i is `.`, the square at the i-th
row and j-th column is painted white; if that character is `#`, that square is
painted black.
Among the 2^{HW} ways for each square in the grid to be painted white or
black, how many can be obtained from the initial state by performing the
operations below any number of times (possibly zero) in any order? Find this
count modulo 998,244,353.
* Choose one row, then paint all the squares in that row white.
* Choose one row, then paint all the squares in that row black.
* Choose one column, then paint all the squares in that column white.
* Choose one column, then paint all the squares in that column black. | [{"input": "2 2\n #.\n .#", "output": "15\n \n\nFor example, if we paint the second row black, the grid becomes:\n\n \n \n #.\n ##\n \n\n* * *"}, {"input": "3 3\n ...\n ...\n ...", "output": "230\n \n\n* * *"}, {"input": "2 4\n #...\n ...#", "output": "150\n \n\n* * *"}, {"input": "6 7\n .......\n .......\n .#.....\n ..#....\n .#.#...\n .......", "output": "203949910"}] |
Your program has to print in the following format for each dataset.
lunch _L_
dinner _D_
midnight _M_
_L_ is ratio of "ok" check printed to the total in lunch time. _D_ is ratio of
"ok" check printed to the total in dinner time. _M_ is ratio of "ok" check
printed to the total in midnight time. You can truncate digits number after
the decimal point of the ratio on the percentage. Lunch, dinner, and midnight
times are defined as follows:
Lunch time is 11:00 ~ 14:59.
Dinner time is 18:00 ~ 20:59.
Midnight time is 21:00 ~ 01:59.
If a check is not printed in the three range of time, you don't have to
process it. If no check is in the range of time, you should print "no guest". | s424834684 | Accepted | p00647 | The input consists of multiple datasets. The last dataset is followed by a
line containing a single zero. You don't have to process this data. The first
line of each dataset contains a single integer _n_.
_n_ (0 < _n_ ≤ 100) is the number of checks. Each of following _n_ lines gives
the details of a check in the following format.
_hh:mm MM_
_hh:mm_ is the clock time to print the check. _MM_ is minute of the clock time
to provide products. The clock time is expressed according to the 24 hour
clock.
For example, "eleven one PM" is expressed by "23:01".
You can assume that the all of products are provided within fifteen minutes.
The restaurant is open from AM 11:00 to AM 02:00. After AM 02:00, no check is
printed. Also at AM 02:00, no check is printed. | import math
while True:
n = int(input())
if n == 0:
break
name = ("lunch", "dinner", "midnight")
dic = {}
clear = {}
for s in name:
dic[s] = 0
clear[s] = 0
for _ in range(n):
start, time = input().split()
flag = (int(time) - int(start[3:])) % 60 <= 8
if "11:00" <= start <= "14:59":
dic["lunch"] += 1
if flag:
clear["lunch"] += 1
elif "18:00" <= start <= "20:59":
dic["dinner"] += 1
if flag:
clear["dinner"] += 1
elif "21:00" <= start <= "23:59" or "00:00" <= start <= "01:59":
dic["midnight"] += 1
if flag:
clear["midnight"] += 1
for key in ("lunch", "dinner", "midnight"):
if dic[key]:
print(key, math.floor(100 * clear[key] / dic[key]))
else:
print(key, "no guest")
| A: It's our delight!!
You are a student of University of Aizu. And you work part-time at a
restaurant.
Staffs of the restaurant are well trained to be delighted to provide more
delicious products faster.
The speed providing products particularly depends on skill of the staff. So,
the manager of the restaurant want to know how long it takes to provide
products.
Though some restaurants employ a system which calculates how long it takes to
provide products automatically, the restaurant where you work employs a system
which calculates it manually.
You, a student of University of Aizu, want to write a program to calculate it,
and you hope that your program makes the task easier. You are given the checks
in a day. If the length of time it takes to provide the products of a check is
shorter than or equal to 8 minutes, it is "ok" check. Write a program to
output the ratio of "ok" checks to the total in percentage. | [] |
Your program has to print in the following format for each dataset.
lunch _L_
dinner _D_
midnight _M_
_L_ is ratio of "ok" check printed to the total in lunch time. _D_ is ratio of
"ok" check printed to the total in dinner time. _M_ is ratio of "ok" check
printed to the total in midnight time. You can truncate digits number after
the decimal point of the ratio on the percentage. Lunch, dinner, and midnight
times are defined as follows:
Lunch time is 11:00 ~ 14:59.
Dinner time is 18:00 ~ 20:59.
Midnight time is 21:00 ~ 01:59.
If a check is not printed in the three range of time, you don't have to
process it. If no check is in the range of time, you should print "no guest". | s594019798 | Wrong Answer | p00647 | The input consists of multiple datasets. The last dataset is followed by a
line containing a single zero. You don't have to process this data. The first
line of each dataset contains a single integer _n_.
_n_ (0 < _n_ ≤ 100) is the number of checks. Each of following _n_ lines gives
the details of a check in the following format.
_hh:mm MM_
_hh:mm_ is the clock time to print the check. _MM_ is minute of the clock time
to provide products. The clock time is expressed according to the 24 hour
clock.
For example, "eleven one PM" is expressed by "23:01".
You can assume that the all of products are provided within fifteen minutes.
The restaurant is open from AM 11:00 to AM 02:00. After AM 02:00, no check is
printed. Also at AM 02:00, no check is printed. | while 1:
n = int(input())
if n == 0:
break
l = d = m = cl = cm = cd = 0
for i in range(n):
t, M = input().split()
M = int(M)
h, m = map(int, t.split(":"))
if m > M:
M += 60
a = M - m <= 8
if 11 <= h < 15:
cl += 1
l += a
elif 18 <= h < 21:
cd += 1
d += a
elif 21 <= h or h < 2:
cm += 1
m += a
print("lunch", l * 100 // cl if cl else "no guest")
print("dinner", d * 100 // cd if cd else "no guest")
print("midnight", m * 100 // cm if cm else "no guest")
| A: It's our delight!!
You are a student of University of Aizu. And you work part-time at a
restaurant.
Staffs of the restaurant are well trained to be delighted to provide more
delicious products faster.
The speed providing products particularly depends on skill of the staff. So,
the manager of the restaurant want to know how long it takes to provide
products.
Though some restaurants employ a system which calculates how long it takes to
provide products automatically, the restaurant where you work employs a system
which calculates it manually.
You, a student of University of Aizu, want to write a program to calculate it,
and you hope that your program makes the task easier. You are given the checks
in a day. If the length of time it takes to provide the products of a check is
shorter than or equal to 8 minutes, it is "ok" check. Write a program to
output the ratio of "ok" checks to the total in percentage. | [] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s132777302 | Accepted | p03591 | Input is given from Standard Input in the following format:
S | def examA():
S = SI()
ans = "No"
if S[:4] == "YAKI":
ans = "Yes"
print(ans)
import sys, copy, bisect, itertools, heapq, math
from heapq import heappop, heappush, heapify
from collections import Counter, defaultdict, deque
def I():
return int(sys.stdin.readline())
def LI():
return list(map(int, sys.stdin.readline().split()))
def LSI():
return list(map(str, sys.stdin.readline().split()))
def LS():
return sys.stdin.readline().split()
def SI():
return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float("inf")
if __name__ == "__main__":
examA()
| Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s638821121 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | s = input()
if s[:4] == "YAKI"
print("Yes")
else:
print("No") | Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s855748396 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | s = input()
if len(s) >= 4 && s[:4] == "YAKI":
print("Yes")
else:
print("No");
| Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s419776531 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | s = input()
if len(s)>=4 and s[:4] = "YAKI":
print("Yes")
else:
print("No") | Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s532595390 | Accepted | p03591 | Input is given from Standard Input in the following format:
S | print("Yes" if input()[0:4] == "YAKI" else "No")
| Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s687749682 | Accepted | p03591 | Input is given from Standard Input in the following format:
S | print("Yes") if input().startswith("YAKI") else print("No")
| Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s578577116 | Wrong Answer | p03591 | Input is given from Standard Input in the following format:
S | print("YNoes"[input()[:4] != "YAKI" :: 2])
| Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s410414400 | Wrong Answer | p03591 | Input is given from Standard Input in the following format:
S | print("YES" if input()[:4] == "YAKI" else "NO")
| Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s466945461 | Wrong Answer | p03591 | Input is given from Standard Input in the following format:
S | print("Yes" if input()[:4] == "YAKI" else "NO")
| Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s441669459 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | s = input()
ans = 0
if (len(s) >= 4):
if (s[0:4] == "YAKI"):
ans = 1
if(ans == 1)
print("Yes")
else:
print("No") | Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s536640172 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | s=input()
if s[0]==“Y” and s[1]==“A” and s[2]==“K” and s[3]==“I”:
print(“Yes”)
else:
print(“No”) | Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s712541757 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | s=input()
if len(s)<4:
a=“a”
else:
a=“s[0]”+ “s[1]”+ “s[2]”+ “s[3]”
if a==“YAKI”:
print(“Yes”)
else:
print(“No”) | Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s798668949 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | s=input()
if len(s)<4:print("No")
elif s[:3]=print("Yes")
else:print("No") | Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s205530435 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | S=input()
if S[:4]=='YAKI':
print('Yes')
else:
print('No')
| Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s891056107 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | ! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = input()
if S in "YAKI":
print("Yes")
else:
print("No") | Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s307604657 | Accepted | p03591 | Input is given from Standard Input in the following format:
S | print(("No", "Yes")[input().find("YAKI") == 0])
| Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s775208813 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | print("NYoe s"[int(input())[:4] :: 2])
| Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s065311024 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | a=input()
if a[0:4]=="YAKI":
print("Yes")
else
print("No") | Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s155887458 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | s = input()
if s[:4] = 'YAKI':
print('Yes')
else:
print('No') | Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s775341924 | Wrong Answer | p03591 | Input is given from Standard Input in the following format:
S | print(str.lower(input())[:4] == "yaki")
| Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
If S starts with `YAKI`, print `Yes`; otherwise, print `No`.
* * * | s213829902 | Runtime Error | p03591 | Input is given from Standard Input in the following format:
S | s=input()
print("Yes" if len(s)>=4 && s[:4]=="YAKI" else "No") | Statement
Ringo is giving a present to Snuke.
Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning
grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes
grilled things starting with `YAKI` in Japanese, and does not like other
things.
You are given a string S representing the Japanese name of Ringo's present to
Snuke. Determine whether S starts with `YAKI`. | [{"input": "YAKINIKU", "output": "Yes\n \n\n`YAKINIKU` starts with `YAKI`.\n\n* * *"}, {"input": "TAKOYAKI", "output": "No\n \n\n`TAKOYAKI` (a Japanese snack. _tako_ : octopus) does not start with `YAKI`.\n\n* * *"}, {"input": "YAK", "output": "No"}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.