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 Tak's total accommodation fee.
* * * | s081063240 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | import numpy as np
N, A = map(int, input().split())
x = list(map(int, input().split()))
X = max(x)
if X < A:
X = A
def check(j, k, s):
if dp[j][k][s] != -1:
return dp[j][k][s]
if j == 0 and k == 0 and s == 0:
dp[j][k][s] = 1
return 1
if j >= 1 and s < x[j - 1]:
a = check(j - 1, k, s)
dp[j][k][s] = a
return a
if j >= 1 and k >= 1 and s >= x[j - 1]:
a = check(j - 1, k, s) + check(j - 1, k - 1, s - x[j - 1])
dp[j][k][s] = a
return a
dp[j][k][s] = 0
return 0
dp = [[[-1] * (N * X + 1) for _ in range(N + 1)] for _ in range(N + 1)]
dp = np.array(dp)
# print (dp)
# for j in range(N+1):
# for k in range(N+1):
# for s in range(N*X + 1):
# print (j, k, s)
# dp[j][k][s] = check(j, k, s)
ans = 0
for k in range(1, N + 1):
ans += check(N, k, k * A)
# ans += dp[N][k][k * A]
print(ans)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s286418323 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n = int(input())
k = int(input())
x = int(input())
y = int(input())
sum = 0
if (n >= k):
sum = k*x + (n - k)*y
print(sum)
else:
sum = n*x
print(sum) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s020961289 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | #!/usr/bin/env python3
import sys, math, fractions, itertools
def solve(N: int, A: int, x: "List[int]"):
X = max(x)
dp = [
[[0 for _ in range(max(N * X + 1, N * A + 1))] for _ in range(N + 1)]
for _ in range(N + 1)
]
dp[0][0][0] = 1
for n in range(N + 1):
for m in range(N + 1):
for k in range(N * X + 1):
if n >= 1 and k < x[n - 1]:
dp[n][m][k] = dp[n - 1][m][k]
elif n >= 1 and m >= 1 and k >= x[n - 1]:
dp[n][m][k] = dp[n - 1][m][k] + dp[n - 1][m - 1][k - x[n - 1]]
s = 0
for i in range(1, N + 1):
s += dp[N][i][i * A]
print(s)
return
# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)
def main():
def iterate_tokens():
for line in sys.stdin:
for word in line.split():
yield word
tokens = iterate_tokens()
N = int(next(tokens)) # type: int
A = int(next(tokens)) # type: int
x = [int(next(tokens)) for _ in range(N)] # type: "List[int]"
solve(N, A, x)
if __name__ == "__main__":
main()
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s396922470 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n = int(input())
k = int(input())
x = int(input())
y = int(input())
sum = 0
if (n >= k):
sum = k*x + (n - k)*y
print(sum)
else:
sum = n*x
print(sum) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s242296202 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n = int(input())
k = int(input())
x = int(input())
y = int(input())
sum = 0
if n >= k:
sum = k*x + (n - k)*y
print(sum)
else:
sum = n*x
print(sum) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s506285217 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | def solve():
def recur(i, n, total):
# print("i, n, total", i, n, total)
if not TABLE[i][n][total] == -1:
# print('cache!')
return TABLE[i][n][total]
if not i < N:
if n > 0 and total == A * n:
TABLE[i][n][total] = 1
return 1
TABLE[i][n][total] = 0
return 0
ans1 = recur(i + 1, n, total)
ans2 = recur(i + 1, n + 1, total + XS[i])
# print(ans1, ans2)
return ans1 + ans2
N, A = tuple(map(int, input().split()))
XS = tuple(map(int, input().split()))
TABLE = []
for _ in range(N + 1):
lines = [[-1 for x in range(N * 50 + 1)] for y in range(N + 1)]
TABLE.append(lines)
return recur(0, 0, 0)
if __name__ == "__main__":
print(solve())
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s508376957 | Accepted | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | x = [int(input()) for i in range(4)]
print(min(x[0], x[1]) * x[2] + max(0, (x[0] - x[1])) * x[3])
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s880676775 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(int((c*(b-a)+d*(b))) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s536461904 | Wrong Answer | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | print("aaa")
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s302771090 | Wrong Answer | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | l = [int(input()) for _ in range(4)]
print(l[1] * l[2] + (l[0] - l[1]) * l[3])
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s629950488 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | N,K,X,Y=[int(input()) for i in range(4)]
if(K>N):
N=K
else:
Z=K*X+(N-K)*Y
print(Z) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s437177764 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | a = int(input())
b = int(input())
c = int(input())
d = int(input())
x = a - b
y = b * c
z = x * d
if a > b:
print(y + z)
else:
print(y) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s097816758 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(x*n if n=<k else k*x+(n-k)*y)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s057367398 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n=int(input())
k=int(input())
x=int(input())
y=int(input())
if n=<k:
ans=n*x
else:
ans=k*x+y*(n-k)
print(ans) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s615781699 | Accepted | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, k, x, y = [int(input()), int(input()), int(input()), int(input())]
print(min(n, k) * x + (n - min(n, k)) * y)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s089910501 | Wrong Answer | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | list = [int(input()) for i in range(4)]
print(list[1] * list[2] + (list[0] - list[1]) * list[3])
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s953436680 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n = input()
k = input()
x = input()
y = input()
return x * n if n < k
return x * k + y * (n - k) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s604411831 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, k, x, y = [map(int(input()), for i in range(4))]
print(x*n - (x - y)*max(0, n - k))
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s915437836 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n,k,x,y=[int(input()) for_ in range(4)]
print(min(n, k)*x+max(n-k,0)*y) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s869109748 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n = int(input())
k = int(input())
x = int(input())
y = int(input())
return x * n if n < k
return x * k + y * (n - k) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s172921813 | Accepted | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, k, x, y = map(int, [input() for i in range(4)])
print(k * x + y * (n - k) if n > k else n * x)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s489141644 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, k, x, y = input()
if k >= n:
print(x * k)
elif k < n:
print((x * k) + (n - k) * y)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s508346532 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n = int(input())
k, x, y = [int(input()) for i in range(n)]
print(k * x + (n - k) * y) if n > k else print(k * x)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s358574245 | Accepted | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | from itertools import combinations, product
def gcd(a, b):
if a < b:
a, b = b, a
while b != 0:
a, b = b, a % b
return a
def lcm(a, b):
return a * b // gcd(a, b)
def get(fmt):
ps = input().split()
r = []
for p, t in zip(ps, fmt):
if t == "i":
r.append(int(p))
if t == "f":
r.append(float(p))
if t == "s":
r.append(p)
if len(r) == 1:
r = r[0]
return r
def put(*args, **kwargs):
print(*args, **kwargs)
def rep(n, f, *args, **kwargs):
return [f(*args, **kwargs) for _ in range(n)]
def rep_im(n, v):
return rep(n, lambda: v)
YES_NO = ["NO", "YES"]
N, K, X, Y = rep(4, get, "i")
p = N * X - max(N - K, 0) * (X - Y)
put(p)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s340353459 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, a = map(int, input().split())
x = list(map(int, input().split()))
# dp[j][k][s] = (x0...xj からk枚選んでxiの合計をsにするような選び方の総数)
dp = [[[0 for s in range(a * n + 1)] for k in range(n + 1)] for j in range(n)]
for j in range(n):
dp[j][0][0] = 1
if x[0] <= a * n:
dp[j][1][x[0]] = 1
for j in range(n - 1):
for k in range(n + 1):
for s in range(a * n + 1):
if k > j + 2:
dp[j + 1][k][s] = 0
elif s >= x[j + 1] and k >= 1:
dp[j + 1][k][s] = dp[j][k][s] + dp[j][k - 1][s - x[j + 1]]
else:
dp[j + 1][k][s] = dp[j][k][s]
res = 0
for i in range(1, n + 1):
res += dp[n - 1][i][a * i]
print(1)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s700088608 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n = input()
ini = input()
ini_pri=input()
left_pri=input()
ans = 0
for i in range(n):
if i < ini:
ans += ini_pri
else:
ans += left_pri
print(ans) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s104761099 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | import sys
nN = int(input())
nK = int(input())
nX = int(input())
nY = int(input())
nE = 0
if nN =< nK:
nAns = nX * nN
print(nAns)
sys.exit()
nE = nN - nK
nAns = nX * nN + nY * nE
print(nAns)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s905532213 | Accepted | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | N, K, X, Y = eval("int(input())," * 4)
print(K * X + (N - K) * Y if (N - K) > 0 else N * X)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s783759245 | Accepted | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, k, x, y = (int(input()) for _ in [0] * 4)
print(n * x if n < k else k * x + (n - k) * y)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s988250733 | Accepted | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | N, K, X, Y = map(int, open(0))
print([N * X, K * X + (N - K) * Y][K < N])
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s875435294 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | N,K,X,Y=map(int,input().split(/n))
if N>K:
print(K*X+(N-K)*Y)
else:
print(N*X) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s072657130 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, k, x, y = [(int(input()) for i in range(4))]
print(x * n - (x - y) * max(0, n - k))
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s070753634 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, k, x, y = map(int, input().split)
print((k * x) + ((n - k) * y))
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s842056703 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | N, K, X, Y=[int(input()) for i in range(4)]
if n=<K:
print(K*X)
else:
print(K*X+Y*(N-K)) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s585009397 | Wrong Answer | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | # coding;utf-8
n = []
for i in range(4):
n.append(int(input()))
m = 0
if n[0] - n[1] < 0:
m = 0
else:
m = n[0] - n[1]
print(n[2] * n[1] + n[3] * m)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s636882289 | Accepted | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | (N,) = list(map(int, input().split()))
(K,) = list(map(int, input().split()))
(X,) = list(map(int, input().split()))
(Y,) = list(map(int, input().split()))
print(X * min(K, N) + Y * max(0, N - K))
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s544552459 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1,n+1):
if i =< k:
ans += x
else:
ans += y
print(ans) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s841565771 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | hotel=int(input())
hotel2=int(input())
hotel3=int(input())
hotel4=int(input())
sum1=int(hotel)*int(hotel2)
sum2=int(hotel39*int(hotel4)
fee=int(sum1)+int(sum1)
print(str(fee)) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s143958165 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | import sys
if sys.platform =='ios':
sys.stdin=open('input_file.txt')
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
print(N*X-(max((N-K),0)*(X-Y))
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s227152224 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | import collections
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
ans = 0
for i in range(N):
if i < K:
ans += X
else:
ans += Y
print(ans) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s098443936 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if K <= N:
answer = N * X
elif K > N:
answer = (K * X) + (N - K) * Y:
print(answer) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s733237279 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | stay = int(input())
change_day = int(input())
first_cost = int(input())
change_cost = int(input())
total_cost = 0
for i in range(stay):
if(i < change_day):
total_cost += first_cost
else:
total_cost += change_cost
print(total_cost) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s532618144 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | N = int(input()) #5
K = int(input()) #3
X = int(input())
Y = int(input())
total = 0
for a in range(1, 6): #6 , 1, 2, 3, 4, 5
if a <= K:
total += X
else:
total += Y
print(total)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s766494441 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | import collections
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
ans = 0
for i in range(N):
if i < K:
ans += X
else:
ans += Y
print(ans) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s005188025 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
for i in range(1:n):
if i =< k:
ans += x
else:
ans += y
print(ans) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s235198512 | Wrong Answer | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | days_to_stay = int(input())
special_days = int(input())
special_price = int(input())
normal_price = int(input())
payment = 0
if days_to_stay <= special_days:
payment = days_to_stay * special_price
else:
payment = (
days_to_stay - special_days
) * normal_price + days_to_stay * special_price
print(payment)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s637539713 | Accepted | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | d = [int(input()) for i in range(4)]
s = d[0] - d[1]
print(d[1] * d[2] + s * (d[3] if s > 0 else d[2]))
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s581358956 | Wrong Answer | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | lis = [int(input()) for i in range(4)]
print(lis[1] * lis[2] + (lis[0] - lis[1]) * lis[3])
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s934349940 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | N, K, X, Y = [input() for _ in range(4)]
print(min([N, K]) * X + max([N - K, 0]) * Y)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s601837434 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, k, x, y = int(input())
if n >= k:
l = n - k
print(k*x + l*y)
else:
print(n*x)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s693577525 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, k, x, y = [(int(input()), for i in range(4))]
print(x*n - (x - y)*max(0, n-k))
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s857022694 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, k, x, y = int(input.split()) for _ in range(4)
print(k * x + (n - k) * y) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s401416265 | Accepted | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | l = [int(input()) for i in range(4)]
# n,k,x,y
if l[0] <= l[1]:
print(l[0] * l[2])
else:
print(l[1] * l[2] + (l[0] - l[1]) * l[3])
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s275753586 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | l = [int(input) for i range(4)]
if l[0] <= l[1]:
sum = l[0] * l[2]
else:
sum = l[1] * l[2] + (l[0]-l[1]) * l[3]
print(sum) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s584936908 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | int N = input()
int K = input()
int X = input()
int Y = input()
int fee
if(N <= K):
fee=N*X
else:
fee=X*K + Y*(N-K)
print(fee)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s049357503 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n,k,x,y=map(int,input().split() for i in range(4)]
if n>k:
print(x*k+y*(n-k))
else:
print(x*k)
| Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s822788279 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n = int(input())
k = int(input())
x = int(input())
y = int(input())
if k >= n:
print(k*x)
else:
print(k*x+(n-k)*y) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s792578702 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N > K:
print(K*X + (N-K)*Y)
else :
print(N* | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s063652482 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, k, x, y = int(input().split()) for _ in range(4)
t = 0
if n - k > 0:
t = (n - k) * y
print(k * x + t) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print Tak's total accommodation fee.
* * * | s563442205 | Runtime Error | p04011 | The input is given from Standard Input in the following format:
N
K
X
Y | n, k, x, y = int(input().split()) for _ in range(4)
t = 0
if n - k > 0:
t = (n - k) * y
print(n * x + t) | Statement
There is a hotel with the following accommodation fee:
* X yen (the currency of Japan) per night, for the first K nights
* Y yen per night, for the (K+1)-th and subsequent nights
Tak is staying at this hotel for N consecutive nights. Find his total
accommodation fee. | [{"input": "5\n 3\n 10000\n 9000", "output": "48000\n \n\nThe accommodation fee is as follows:\n\n * 10000 yen for the 1-st night\n * 10000 yen for the 2-nd night\n * 10000 yen for the 3-rd night\n * 9000 yen for the 4-th night\n * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n 3\n 10000\n 9000", "output": "20000"}] |
Print the correct choice.
* * * | s168131586 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | a = sorted([int(input()) for i in range(2)])
print("1" if a == [2, 3] else "2" if a == [1, 3] else "3")
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s990005754 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | i = int(input())
a = list(input().split(" "))
n = len(a[0])
for i in range(0, n):
print(a[0][i] + a[1][i], end="")
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s313883578 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | S = input()
S += input()
print(*[a for a in "123" if a not in S])
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s032271746 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | a = [1, 2, 3] - int(input())
print(list(a - int(input()))[0])
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s741211064 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | A, B = [int(input()) for i in range(2)]
print(6 // A // B)
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s781257119 | Wrong Answer | p02829 | Input is given from Standard Input in the following format:
A
B | 3
1
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s014796273 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | a = {1, 2, 3} - int(input())
print(a - int(input()))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s006085128 | Wrong Answer | p02829 | Input is given from Standard Input in the following format:
A
B | S = set(int(input()) for i in range(2))
print({1, 2, 3} - S)
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s741248576 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | # from collections import Counter, defaultdict
# n = int(input())
# li = list(map(int, input().split()))
# n = int(input())
# a, b, c = map(int, input().split())
# d = defaultdict(lambda: 0)
s = set([1, 2, 3])
s.discard(int(input()))
s.discard(int(input()))
print(*s)
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s057231503 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | choice = [1, 2, 3]
internal = list(map(int, input().split()))
choice.remove(internal[0])
choice.remove(internal[1])
print(choice[0])
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s571612319 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | # -*- coding: utf-8 -*-
#############
# Libraries #
#############
import sys
input = sys.stdin.readline
import math
from collections import deque
from fractions import gcd
from functools import lru_cache
#############
# Constants #
#############
MOD = 10**9 + 7
INF = float("inf")
#############
# Functions #
#############
######INPUT######
def inputI():
return int(input().strip())
def inputS():
return input().strip()
def inputIL():
return list(map(int, input().split()))
def inputSL():
return list(map(str, input().split()))
def inputILs(n):
return list(int(input()) for _ in range(n))
def inputSLs(n):
return list(input().strip() for _ in range(n))
def inputILL(n):
return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n):
return [list(map(str, input().split())) for _ in range(n)]
#####Inverse#####
def inv(n):
return pow(n, MOD - 2, MOD)
######Combination######
kaijo_memo = []
def kaijo(n):
if len(kaijo_memo) > n:
return kaijo_memo[n]
if len(kaijo_memo) == 0:
kaijo_memo.append(1)
while len(kaijo_memo) <= n:
kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
return kaijo_memo[n]
gyaku_kaijo_memo = []
def gyaku_kaijo(n):
if len(gyaku_kaijo_memo) > n:
return gyaku_kaijo_memo[n]
if len(gyaku_kaijo_memo) == 0:
gyaku_kaijo_memo.append(1)
while len(gyaku_kaijo_memo) <= n:
gyaku_kaijo_memo.append(
gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo), MOD - 2, MOD) % MOD
)
return gyaku_kaijo_memo[n]
def nCr(n, r):
if n == r:
return 1
if n < r or r < 0:
return 0
ret = 1
ret = ret * kaijo(n) % MOD
ret = ret * gyaku_kaijo(r) % MOD
ret = ret * gyaku_kaijo(n - r) % MOD
return ret
######Factorization######
def factorization(n):
arr = []
temp = n
for i in range(2, int(-(-(n**0.5) // 1)) + 1):
if temp % i == 0:
cnt = 0
while temp % i == 0:
cnt += 1
temp //= i
arr.append([i, cnt])
if temp != 1:
arr.append([temp, 1])
if arr == []:
arr.append([n, 1])
return arr
#####LCM#####
def lcm(a, b):
return a * b // gcd(a, b)
#############
# Main Code #
#############
a, b = inputIL()
print(6 - a - b)
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s095591496 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | ar = ["1", "2", "3"]
ar.remove(input())
ar.remove(input())
print(ar[0])
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s630154911 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | print(6 - sum([int(input()) for _ in range(2)]))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s755578158 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | l = [int(input()) for _ in range(2)]
print(l[0] ^ l[1])
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s133832841 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | print(6 - input() - input())
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s683774711 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | input1 = [int(input()) for i in range(2)]
numbers = [m for m in range(1, 4)]
for n in input1:
numbers.remove(n)
print(numbers[0])
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s490564552 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | N, u, v = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N - 1)]
x = [[] for _ in range(N)]
for ab in AB:
a = ab[0]
b = ab[1]
x[a - 1].append(b - 1)
x[b - 1].append(a - 1)
flag1 = [False] * N
flag2 = [False] * N
length1 = [0] * N
length2 = [0] * N
go = [v - 1]
while go != []:
a = go.pop()
if flag1[a]:
continue
else:
flag1[a] = True
for i in x[a]:
if flag1[i]:
continue
else:
length1[i] = length1[a] + 1
go.append(i)
go = [u - 1]
while go != []:
a = go.pop()
if flag2[a]:
continue
else:
flag2[a] = True
for i in x[a]:
if flag2[i]:
continue
else:
length2[i] = length2[a] + 1
go.append(i)
print(max(length1))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s121265819 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | a = input().split()
A = int(a[0])
B = int(a[1])
li = [2]
li2 = []
p = 0
if B > A:
c = A
A = B
B = A
for i in range(3, int(A**0.5) + 1):
for j in range(2, i + 1):
if j == i:
li.append(i)
if i % j == 0:
break
while p == 0:
for s in li:
if A % s == 0 and B % s == 0:
A /= s
B /= s
li2.append(s)
break
if A % s == 0 and B % s != 0:
A /= s
li2.append(s)
break
if A % s != 0 and B % s == 0:
B /= s
li2.append(s)
break
if s == li[-1]:
p = 1
n = 1
for m in li2:
n *= m
print(n)
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s432325727 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | N, u, v = map(int, input().split())
u -= 1
v -= 1
e_list = [[] for _ in range(N)]
for _ in range(N - 1):
a, b = map(int, input().split())
a -= 1
b -= 1
e_list[a].append(b)
e_list[b].append(a)
def calc_depth_table(v):
queue = [[v, None, 0]]
depth_table = [0] * N
depth_table[v] = 0
while queue:
cur, pre, depth = queue.pop()
depth += 1
for n in e_list[cur]:
if n != pre:
queue.append([n, cur, depth])
depth_table[n] = depth
return depth_table
def calc_depth_table2(depth_from_v, u):
queue = [[u, None, 0, depth_from_v[u], u]]
depth_table = [0] * N
depth_table[u] = (0, depth_from_v[u], u)
while queue:
cur, pre, depth, min_depth_from_v, min_depth_point = queue.pop()
depth += 1
for n in e_list[cur]:
if n != pre:
depth2 = depth_from_v[n]
if min_depth_from_v > depth2:
new_min_depth = depth2
new_min_depth_point = n
else:
new_min_depth = min_depth_from_v
new_min_depth_point = min_depth_point
queue.append([n, cur, depth, new_min_depth, new_min_depth_point])
depth_table[n] = (depth, new_min_depth, new_min_depth_point)
return depth_table
depth_from_v = calc_depth_table(v)
depth_from_u = calc_depth_table2(depth_from_v, u)
# print(depth_from_v)
# print(depth_from_u)
max_count = 0
for i in range(N):
a_dist = depth_from_v[i]
t_dist, a_hit_dist, hit_pos = depth_from_u[i]
t_hit_dist = depth_from_u[hit_pos][0]
# print(t_hit_dist, a_hit_dist)
if t_hit_dist < a_hit_dist:
# print(t_hit_dist, a_hit_dist)
# if (a_hit_dist - t_hit_dist) % 2 == 1:
if max_count < a_dist - 1:
max_count = a_dist - 1
# else:
#
print(max_count)
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s540078837 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | a_list = [1, 2, 3]
p = input()
q = input()
a_list.remove(int(p))
a_list.remove(int(q))
print(a_list[0])
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s766816574 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | AB = [int(i) for i in input().split()]
nums = [1, 2, 3]
nums.remove(AB[0])
nums.remove(AB[1])
print(nums[0])
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s638559281 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | A = int(input())
B = int(input())
if A+B = 3:
print (3)
elif A+B=4:
print (2)
else:
print (1)
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s412029166 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | print("".join(str(x) for x in ({1, 2, 3} - {int(input()), int(input())})))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s252639442 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | print("".join(str(a) for a in ({1, 2, 3} - {int(input()), int(input())})))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s727158042 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | ab = [int(input()) for x in range(2)]
print(6 - sum(ab))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s277372973 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | print(min(3, 7 - (1 << (int(input()) - 1)) - (1 << (int(input()) - 1))))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s735855475 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | a = {1, 2, 3}
a.remove(int(input()))
a.remove(int(input()))
print(list(a)[2])
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s188511493 | Wrong Answer | p02829 | Input is given from Standard Input in the following format:
A
B | a = 0
for i in range(1):
a = a + int(input())
print(int(6 - a))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s266821906 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | a, b = [int(x) for x in input().split()]
print(str(6 - a + b))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s094356908 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | print(6 - sum(map(int, open(0))))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s789846917 | Wrong Answer | p02829 | Input is given from Standard Input in the following format:
A
B | print(6 - sum(list(map(int, input().split()))))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s986240046 | Wrong Answer | p02829 | Input is given from Standard Input in the following format:
A
B | a = [int(x) for x in input().split()]
print(6 - sum(a))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s954218247 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | a1 = input()
a2 = input()
print(6 - a1 - a2)
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s313710208 | Wrong Answer | p02829 | Input is given from Standard Input in the following format:
A
B | n = int(input())
t = int(input())
print(3 - n - t)
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s714855429 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | print(6 - int(input) - int(input))
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s441679363 | Accepted | p02829 | Input is given from Standard Input in the following format:
A
B | # -*- coding: utf-8 -*-
import sys
def input():
return sys.stdin.readline().strip()
def list2d(a, b, c):
return [[c] * b for i in range(a)]
def list3d(a, b, c, d):
return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e):
return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1):
return int(-(-x // y))
def INT():
return int(input())
def MAP():
return map(int, input().split())
def LIST(N=None):
return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes():
print("Yes")
def No():
print("No")
def YES():
print("YES")
def NO():
print("NO")
sys.setrecursionlimit(10**9)
INF = 10**18
MOD = 10**9 + 7
li = LIST(2)
if 1 not in li:
print(1)
elif 2 not in li:
print(2)
else:
print(3)
| Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s704071182 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | a = int(input())
b = int(input())
if a,b == (1,2) or a,b == (2,1):
print("3")
elif a,b == (1,3) or a,b == (3,1):
print("2")
else:
print("1") | Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s707860636 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | if A=1 B=2:
"print(3)"
if A=1 B=3:
"print(2)"
if A=2 B=3:
"print(1)"
if A=2 B=1:
"print(3)"
if A=3 B=1:
print(2)
if A=3 B=2:
print(1) | Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s719025738 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | A=input()
B=input()
if A=1 and B=2:
print(3)
if A=2 and B=3:
print(1)
if A=3 and B=1:
print(2)
if A=2 and B=1:
print(3)
if A=3 and B=2:
print(1)
if A=1 and B=3:
print(2) | Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Print the correct choice.
* * * | s668856294 | Runtime Error | p02829 | Input is given from Standard Input in the following format:
A
B | #include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <cmath>
#include <bitset>
#include <queue>
#include <set>
#include <numeric>
#include <unordered_set>
using namespace std;
#define ef emplace_front
#define eb emplace_back
#define mp make_pair
#define MOD 1000000007
typedef long double f80;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
typedef vector<vb> vvb;
typedef vector<vc> vvc;
typedef vector<vs> vvs;
typedef float f32;
typedef double f64;
typedef long double f80;
typedef unordered_set<int> usi;
typedef set<int> si;
int main()
{
cin.tie(0);
ios::sync_with_stdio(0);
int a,b;
cin>>a>>b;
if (a!=1 && b!=1) cout<<1;
else if (a!=2&&b!=2) cout<<2;
else cout<<3;
} | Statement
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B
are both wrong.
Print the correct choice for this problem. | [{"input": "3\n 1", "output": "2\n \n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\n* * *"}, {"input": "1\n 2", "output": "3"}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.