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 maximum possible amount of the allowance.
* * * | s027425342 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | list = map(int, input().split())
anslist = sorted(list, reverse=True)
print(anslist[0] * 10 + anslist[1] + anslist[2])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s263430676 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | data = sorted(input().split(), reverse=True)
print(int(data[0] + data[1]) + int(data[2]))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s325493508 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | get = list(input().split())
get.sort()
get.reverse()
A = int(get[0] + get[1])
print(A + int(get[2]))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s358051458 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | res = sorted([int(x) for x in input().split()], reverse=True)
print(res[0] * 10 + res[1] + res[2])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s258272233 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | N = int(input())
if N == 1:
print("Hello World")
else if N == 2:
A, B = map(int, input().split())
print(A + B) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s909801932 | Wrong Answer | p03250 | Input is given from Standard Input in the following format:
A B C | S = list(input().split())
S.sort(reverse=True)
a = int("".join(S[:1]))
b = int(S[2])
print(a + b)
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s064661947 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | s=list(map(int,input().split())
s.sort()
print(max(10*s[0]+s[1]+s[2],s[0]+s[1]*10+s[2],s[0]+s[1]+s[2]*10)) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s437450307 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | import numpy as np
inp = np.asarray(input().split(), dtype=int)
inp = np.sort(inp)
print(inp[2]*10+np.sum(inp[:1]) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s543727048 | Wrong Answer | p03250 | Input is given from Standard Input in the following format:
A B C | v = input().split(" ")
a = v[0]
b = v[1]
c = v[2]
d = int(a + b) + int(c)
e = int(a) + int(b + c)
print(max(d, e))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s903127740 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | import numpy as np
inp = list(map(input().split(), int))
inp = np.sort(inp)
print(inp[0]*10+np.sum(inp[1:]) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s204067704 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | import numpy as np
inp = np.asarray(input().split(), dtype=int)
inp = np.sort(inp)
print(inp[0]*10+np.sum(inp[1:]) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s013776063 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | A = int(input())
B = int(input())
C = int(input())
a = 10 * A + B
b = 10 * B + C
print(max([a + C, A + b]))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s110189401 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | list1 = map(list(int, input().split()))
list1 = sorted(list1, reverse=True)
print(list1[0] * 10 + list[1] + list[2])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s977871509 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | import numpy as np
inp = list(map(input(), int))
inp = np.sort(inp)
print(inp[0]*10+np.sum(inp[1:]) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s574092662 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | Ms = [int(i) for i in input().split()]
Ms = sorted(Ms)
print(Ms[-1] * 10 + Ms[0] + Ms[1])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s953179987 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | P = sorted([int(x) for x in input().split()])
print(P[2] * 10 + P[1] + P[0])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s280169815 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | S = sorted(input().split(), reverse=True)
print(int(S[0] + S[1]) + int(S[2]))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s853257299 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | LX = list(input().split(" "))sort(reverse=True)
print(int(LX[0]+LX[1])+int(LX[2])) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s451307815 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | a, b, c = map(int, input().split())
print(10*a+b+c if 10*a+b+c a+10*b+c else a+10*b+c) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s279638864 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | a = [int(i) for i in input().split())]
a.sort()
print(a[2]*10+a[1]+a[0]) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s173879248 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | a,b,c=map(int,input().split())
x=[a,b,c]
x.sort()
print(int((x[2]+x[1])+x[0]) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s414618539 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | print((lambda a: sum(a) + max(a) * 9)(list(map(int, input().split()))))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s636842857 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | A, B, C = map(int.input().split())
print(max(A + B, B + C, C + A))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s531493441 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | a,b,c = sorted (map(int,input().split())
print(10*c+b+a) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s287640289 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | n = [int(x) for x in input().split()].sort()
print(10 * n[2] + n[1] + n[0])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s405236938 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | a=sort(list(int,input(),split())
b=str(a[2]+a[1])
print(int(b)+a[0]) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s051342238 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | l = list(map(int, input.split()))
print(sum(l) + max(l) * 9)
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s977758930 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | a,b,c=map(int,input().split())
k=max(a,b,c)
print(int(9k+a+b+c)) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s312541684 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | S=list(input().split())
AS=sorted(S)
print(int((S[2]+S[1])+int(S[0])) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s657098801 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | # A - Maximize the Formula
a, b, c = list(input().split())
l = []
l = sorted([a, b, c], reverse=True)
print(eval(l[0] + l[1] + "+" + l[2]))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s859666787 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | a = list[int(input().split()) for i in range(3)]
a.remove(max(a))
result = 0
for i in range(2):
result += a[i]
print(int(max(a) * 10 + result))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s515456087 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | a,b,c = map(int,input().split())
if a>=b and a>=c:
a=a*10
print(a+b+c)
elif b>=a and b>=c:
b=b*10
print(a+b+c)
else
c=c*10
print(a+b+c) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s348755662 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | A, B, C = map(int,input().split())
if A>B:
print(A*10 +B+C)
elif A<B:
print(A+B*10+C)
else:
if A*10+B+C>A+B*10+C:
print(A*10+B+C)
else:
print(A+B*10+C)
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s987429860 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | A, B, C = (int(x) for x in input().split())
int D = max(A, B, C)
if A == D :
print(A * 10 + B + c)
elif B == D:
print(B * 10 + A + C)
elif C == D
print(C * 10 + A + B) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s103666886 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | A, B, C = int(input())
int D = max(A, B, C)
if A == D :
print(A * 10 + B + c)
elif B == D:
print(B * 10 + A + C)
else :
print(C * 10 + A + B) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s564669861 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | A, B, C = int(input().split)
int D = max(A, B, C)
if A == D :
print(A * 10 + B + c)
elif B == D:
print(B * 10 + A + C)
elif C == D
print(C * 10 + A + B) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s169989234 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | from sys import stdin
a, b, c = [int(i) for i in stdin.readline().rstrip().split()]
print(max([10 * a + b + c, a + 10 * b + c, a + b + 10 * c])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s061315414 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | A, B, C = int(input().split())
int D = max(A, B, C)
if A == D :
print(A * 10 + B + c)
elif B == D:
print(B * 10 + A + C)
elif C == D
print(C * 10 + A + B) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s513217603 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | A, B, C = input()
print(max(int(A+B)+int(C),int(B+A)+int(C),int(A+C)+int(B), int(C+A)+int(B), int(B+C)int(A), int(C+B)+int(A))) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s063207800 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | iptA=list(map(int,input().split()))
X=list(map(int,input().split())).append(iptA[2])
Y=list(map(int,input().split())).append(iptA[3])
xmax,ymax=max(X),max(Y)
if xmax>=ymax:
print('War')
else:
print('No War') | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s722353446 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | print((lambda l: l[2] * 10 + l[0] + l[1])(sorted(list(map(int, input().split())))))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s650256886 | Wrong Answer | p03250 | Input is given from Standard Input in the following format:
A B C | a, b, c = map(str, input().split())
print(int(a + b) + int(c), int(a) + int(b + c))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s338760116 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | def com(n, m):
if n - m < m:
m = n - m
result = 1
mylist = [i for i in range(1, m + 1)]
j = 1
for i in range(1, m + 1):
result *= n + 1 - i
if j < m:
while result % mylist[j] == 0:
result //= mylist[j]
j += 1
if j >= m:
break
return result
def yakusuu(i, m):
_i = i
while i**2 <= m:
if m % i == 0:
return i
else:
i += 1
for j in range(_i - 1, 0, -1):
if m % j == 0:
break
return m // j
N, M = map(int, input().split())
soinsuubunkai = {}
tmp = 2
i = 2
_M = M
while tmp <= M:
tmp = yakusuu(tmp, M)
if tmp in soinsuubunkai:
soinsuubunkai[tmp] += 1
else:
soinsuubunkai[tmp] = 1
M //= tmp
if M == 1:
break
tmp = 1
for k in list(soinsuubunkai.values()):
tmp *= com(k + N - 1, k)
tmp %= 10**9 + 7
print(tmp)
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s407532313 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | A = int(input())
B = int(input())
C = int(input())
if A >= B and B >= C:
print(int(str(A) + str(B)) + C)
elif B > A and A > C:
print(int(str(B) + str(A)) + C)
elif A > C and C > B:
print(int(str(A) + str(C)) + B)
elif C > B and B > A:
print(int(str(C) + str(B)) + A)
elif B > C and B > A:
print(int(str(B) + str(C)) + A)
else:
print(int(str(C) + str(A)) + B)
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s086715518 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | S = input()
T = input()
alphs = "abcdefghijklmnopqrstuvwxyz"
flag = False
for alph in alphs:
S2 = S
indlist = []
while alph in S2:
i = S.index(alph)
indlist.append(i)
S2 = S2[i + 1 :]
if indlist != []:
T2 = T[indlist[0]]
for ind in indlist:
if T[ind] != T2:
print("No")
flag = True
break
if flag:
break
else:
for alph in alphs:
T3 = T
indlist = []
while alph in T3:
i = T.index(alph)
indlist.append(i)
T3 = T3[i + 1 :]
if indlist != []:
S3 = S[indlist[0]]
for ind in indlist:
if S[ind] != T3:
print("No")
flag = True
break
if flag:
break
else:
print("Yes")
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s333598340 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | X = sorted(list(map(int, input().split())))
A, B, C = X[0], X[1], X[2]
print(int(str(C) + str(B)) + A)
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s162673499 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | inputs = list(map(int, input().split()))
inputs.sort()
print(inputs[2] * 10 + inputs[1] + inputs[0])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s566224241 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | inpl = lambda: list(map(int, input().split()))
ABC = sorted(inpl())
print(ABC[0] + ABC[1] + 10 * ABC[2])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s522183438 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | line = list(map(int, input().split()))
line.sort(reverse=True)
print(line[0] * 10 + line[1] + line[2])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s355713449 | Wrong Answer | p03250 | Input is given from Standard Input in the following format:
A B C | S = list(map(int, input().split()))
AS = sorted(S)
print(int(str(S[2]) + str(S[1])) + int(S[0]))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s268879412 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | = list(input())
b = [int(i) for i in a]
c=sorted(b,reverse=True)
d =10*c[0]+c[1]+c[2]
print(d) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s195273229 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | num = map(int, input().split())
num = sorted(num, reverce=True)
print(num[0] * 10 + num[1] + num[2])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s277878065 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | list = [int(n) for n in input().split()]
m = max(list)
list.remove(m)
print(m * 10 + sum(list))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s660953303 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | l = list(map(int, input().split()))
a = max(l)
c = min(l)
b = sum(l) - a - c
print((a * 10 + b) + c)
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s477836172 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | iA, iB, iC = sorted([int(x) for x in input().split()])
print(10 * iC + iB + iA)
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s058233514 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | abc = sorted(map(int, input().split()))
print(abc[0] + int(str(abc[2]) + str(abc[1])))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s827680955 | Wrong Answer | p03250 | Input is given from Standard Input in the following format:
A B C | A, B, C = list(input().split())
print(max(int(A) + int(B + C), int(A + B) + int(C)))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s997267234 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | a,b,c=[int(i) for i in input().split()]
print(max(a,b,c)*9+a+b+c) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s455660276 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | x, y, z = sorted(map(int, input().split()))[::-1]
print(10 * x + y + z)
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s874552213 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | print(eval("+".join(sorted(input())) + "*10"))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s581832238 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | a, b, c = sorted(map(int, input().split()))[::-1]
print((a * 10) + b + c)
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s929373290 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | a, b, c = sorted(input().split())[::-1]
print(int(a + b) + int(c))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s447744719 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | X, Y, Z = sorted(map(int, input().split()))
print(X + Y + 10 * Z)
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s273286006 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | print(eval("+".join(input().sort()) + "*10"))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s112143813 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | in = list(map(int, input().split()))
print(max(in)*10+sum(in)-max(in)) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s867090790 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | a,b,c=[int(i) for i in input().split()
print(max(a,b,c)*9+a+b+c) | Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s248571129 | Wrong Answer | p03250 | Input is given from Standard Input in the following format:
A B C | M = list(map(int, input().split()))
print(M[2] * 10 + M[1] + M[0])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s213772616 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | num_list = [int(x) for x in input().split()]
num_list.sort(reverse=True)
print(num_list[0] * 10 + num_list[1] + num_list[2])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s780218785 | Accepted | p03250 | Input is given from Standard Input in the following format:
A B C | N = input().split()
K = []
for i in range(len(N)):
K.append(int(N[i]))
K.sort(reverse=True)
print(K[0] * 10 + K[1] + K[2])
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the maximum possible amount of the allowance.
* * * | s282438869 | Runtime Error | p03250 | Input is given from Standard Input in the following format:
A B C | x = split(input(), " ")
for i in range(len(x)):
if int(x[i]) >= int(x[i - 1]) and int(x[i]) >= int(x[i + 1]):
print(10 * int(x[i]) + int(x[i - 1]) + int(x[i + 1]))
| Statement
You have decided to give an allowance to your child depending on the outcome
of the game that he will play now.
The game is played as follows:
* There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
* The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
* Then, the amount of the allowance will be equal to the resulting value of the formula.
Given the values A, B and C printed on the integer panels used in the game,
find the maximum possible amount of the allowance. | [{"input": "1 5 2", "output": "53\n \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n \n\n* * *"}, {"input": "6 6 7", "output": "82"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s836471977 | Runtime Error | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | N = int(input())
A = list(map(int, input().split()))
count = 0
up = 0
down = 0
before = A[0]
tmp = 0
for i in range(1,N):
tmp = A[i]
if (up == 0) and (down == 0):
if tmp > before:
up = 1
before = tmp
elif tmp < before:
down = 1
before = tmp
else:
continue
elif up == 1:
if tmp < before:
count += 1
up = 0
before = tmp
elif down = 1:
if tmp > before:
count += 1
down = 0
before = tmp
count += 1
print(count)
| Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s769203347 | Runtime Error | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | N = int(input())
A = list(map(int,input().split()))
count = 0
up = 0
down = 0
before = A[0]
tmp = 0
for i in range(1,N):
tmp = A[i]
if (up == 0) and (down == 0):
if tmp > before:
up = 1
before = tmp
elif tmp < before:
down = 1
before = tmp
else:
continue
elif up == 1:
if tmp < before:
count += 1
up = 0
before = tmp
elif down = 1:
if tmp > before:
count += 1
down = 0
before = tmp
count += 1
print(count)
| Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s967031414 | Runtime Error | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | N = input()
A = input().split()
AD = True
EF = True
ANS = 0
for i in range(0,int(N)):
if i >= 1:
if A[i] >= A[i-1] and AD == False and EF == False:
EF = True
ANS += 1
elif A[i] <= A[i-1] and AD == True and EF == False:
EF = True
ANS += 1
if EF == True:
if A[i] >= A[i-1]:
AD = True
EF = False
elif A[i] =< A[i-1]:
AD = False
EF = False
print(ANS)
| Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s167722571 | Runtime Error | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | n, l, T = map(int, input().split())
s = [0 for i in range(n)]
for i in range(n):
s[i] = list(map(int, input().split()))
def f(w):
if w == 1:
return 1
elif w == 2:
return -1
t = 0
d = l
i_d = []
while t < T:
for i in range(n):
if i < n - 1:
if s[i][0] < s[i + 1][0] and s[i][1] == 1 and s[i + 1][1] == 2:
if s[i + 1][0] - s[i][0] < d:
d = s[i + 1][0] - s[i][0]
elif s[i][0] > s[i + 1][0] and s[i][1] == 1 and s[i + 1][1] == 2:
if s[i + 1][0] + l - s[i][0] < d:
d = s[i + 1][0] + l - s[i][0]
elif i == n - 1:
if s[i][0] < s[0][0] and s[i][1] == 1 and s[0][1] == 2:
if s[0][0] - s[i][0] < d:
d = s[0][0] - s[i][0]
elif s[i][0] > s[0][0] and s[i][1] == 1 and s[0][1] == 2:
if s[0][0] + l - s[i][0] < d:
d = s[0][0] + l - s[i][0]
for i in range(n):
if i < n - 1:
if s[i][0] < s[i + 1][0] and s[i][1] == 1 and s[i + 1][1] == 2:
if s[i + 1][0] - s[i][0] == d:
i_d.append(i)
elif s[i][0] > s[i + 1][0] and s[i][1] == 1 and s[i + 1][1] == 2:
if s[i + 1][0] + l - s[i][0] == d:
i_d.append(i)
elif i == n - 1:
if s[i][0] < s[0][0] and s[i][1] == 1 and s[0][1] == 2:
if s[0][0] - s[i][0] == d:
i_d.append(i)
elif s[i][0] > s[0][0] and s[i][1] == 1 and s[0][1] == 2:
if s[0][0] + l - s[i][0] == d:
i_d.append(i)
for j in range(n):
if t + d / 2 <= T:
s[j][0] += f(s[j][1]) * (d / 2)
if s[j][0] >= l:
s[j][0] -= l
elif s[j][0] < 0:
s[j][0] += l
else:
s[j][0] += f(s[j][1]) * (T - t)
if s[j][0] >= l:
s[j][0] -= l
elif s[j][0] < 0:
s[j][0] += l
for j in i_d:
if j < n - 1:
s[j][1], s[j + 1][1] = s[j + 1][1], s[j][1]
else:
s[j][1], s[0][1] = s[0][1], s[j][1]
t = t + d / 2
i_d.clear()
d = l
for i in range(n):
print(s[i][0])
| Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s325950404 | Wrong Answer | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | N, *A = map(int, open(0).read().split())
print(
1 + sum((i > j) & (j < k) | (i < j) & (j > k) for i, j, k in zip(A, A[1:], A[2:]))
)
| Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s766591380 | Wrong Answer | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | n = int(input())
l = [0] + list(map(int, input().split())) + [0]
a, s = 0, 0
for i in range(1, n + 1):
fa, fs = 1, 1
if l[i - 1] <= l[i]:
fa = 0
if l[n - i] >= l[n - i + 1]:
fs = 0
a += fa
s += fs
print(min(a, s) + 1)
| Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s396214312 | Runtime Error | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | N = int(input())
A = list(map(int, input().split()))
status = 0 # 0 = defalt, 1 = up, 2 = down
cnt = 1
for i in range(1,N):
if A[i-1] < A[i]: #up petern
if status == 0 or status == 1:
status = 1
else:
status = 0
cnt += 1
elif A[i-1] > A[i]:
if status == 0 or status == 2
status = 2
else:
status = 0
cnt += 1
else:
continue
print(cnt) | Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s278791239 | Runtime Error | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | N = int(input())
Alist = list(map(int, input().split()))
if N < 3:
print(1)
else:
ans = 1
last = Alist[0]
new_a = [last]
for i in range(N):
now = Alist[i]
if now != last:
new_a.append(now)
last = now
now = "up" if new_a[0] < new_a[1] else "down
f = now
for i in range(1, len(new_a)):
if new_a[i - 1] == new_a[i]:
continue
elif new_a[i - 1] < new_a[i]:
if now == "down":
now = "up"
elif new_a[i - 1] > new_a[i]:
if now == "up":
now = "down"
if now != f:
ans += 1
# print(i, now, ans)
print(ans + 1) | Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s677119389 | Runtime Error | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | N = int(input())
cnt = 0
L = list(map(int,input()..split()))
for i in range(N-2):
if (L[i] > L[i+1] < L[i+2]) or (L[i] < L[i+1] > L[i+2]):
cnt += 1
print(cnt) | Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s634071373 | Accepted | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from random import *
from functools import reduce, partial
def readline():
return list(map(int, input().split(" ")))
def identity(x):
"""Return the input itself."""
return x
def constant(c):
"""Return an function which always
returns the input constant c."""
def const_function(const, *args):
return const
return partial(const_function, c)
def inc(c=1):
"""Return a function which reads an input x and returns x + c as output.
By default, c equals 1."""
return lambda x: x + c
def add(*args):
"""Return the sum of the input."""
def add2(x, y):
return x + y
return reduce(add2, args)
def mapv(f, *lst):
"""Return a vector of the result of map."""
return list(map(f, *lst))
def vector(*args):
"""Return a vector of input parameters."""
return args
def sequence(n, f=constant(0)):
"""Return a vector of length n, and initialize the i'th
item with f(i).By default the vector will initialized with 0."""
return [f(i) for i in range(0, n)]
def matrix(n, m, f=constant(0)):
"""Return a 2-dim vector which contains n vectors with length m.
The j's item of vector i will be initialized by f(i,j).By default,
the vector will be initialized with 0."""
return [[f(i, j) for j in range(0, m)] for i in range(0, n)]
def flat(v):
"""Return a flat vector which contains the elements of v in their
origin order.If the input is not a vector, return a vector which
only contains the input."""
if not isinstance(v, list):
return [v]
if not v:
return []
return reduce(add, mapv(flat, v))
def partition(v, f=identity):
"""Partition vector v by f(v[i]).
e.g. partition([1,2,3,1,2,3],identity()) == {1:[1,1,1], 2:[2,2], 3:[3]}
By default, the vector will be partitioned by identity function."""
result = {}
for item in v:
key = f(item)
s = result.get(key)
if s:
s.append(item)
else:
result.update({key: [item]})
return result
def getValue(key):
"""Return a function which returns the value of key in a hash-map.
If the key do not exist, it will throw an error."""
return lambda x: x[key]
def mapValue(f, m):
"""Replace each value in hash-map m with f(value).
Return the new hash-map."""
res = {}
for key in m:
res.update({key: f(m[key])})
return res
n = int(input())
a = readline()
f = sequence(n)
g = sequence(n)
f[0], g[0] = 1, 1
for i in range(1, n):
f[i] = min(f[i - 1], g[i - 1] + 1)
g[i] = min(g[i - 1], f[i - 1] + 1)
if a[i] > a[i - 1]:
g[i] = min(f[i - 1] + 1, g[i - 1] + 1)
if a[i] < a[i - 1]:
f[i] = min(f[i - 1] + 1, g[i - 1] + 1)
print(min(f[n - 1], g[n - 1]))
| Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s565753836 | Runtime Error | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | import numpy as np
N, L, T = map(int, input().split())
xw_list = []
for n in range(N):
xw_list.append(list(map(int, input().split())))
dic = {k: v for k, v in enumerate(xw_list)}
sort_dic = sorted(dic.items(), key=lambda x: x[1])
# 1 : 時計回り、2 : 反時計回り
for t in range(T):
for n in range(N):
t_xw = sort_dic[n][1] # 対象アリ
# 移動
if t_xw[1] == 1:
t_xw[0] += 1
else:
t_xw[0] -= 1
# 周回した時の変換
if t_xw[0] < 0:
t_xw[0] = L + t_xw[0]
elif t_xw[0] > L:
t_xw[0] = t_xw[0] - L
# 衝突
for n in range(N):
# 座標前後のみで検索
t_xw = sort_dic[n][1] # 対象アリ
if n == 0:
next_xw = sort_dic[-1][1] # 前のアリ
# ato_xw = sort_dic[n+1][1] # 後のアリ
elif n == N - 1:
next_xw = sort_dic[n - 1][1] # 前のアリ
# ato_xw = sort_dic[0][1] # 後のアリ
else:
next_xw = sort_dic[n - 1][1] # 前のアリ
# ato_xw = sort_dic[n+1][1] # 後のアリ
# for next_xw in [mae_xw]:
# , ato_xw]:
# 1秒後に同じ場所 → 方向転換
if t_xw[0] == next_xw[0]:
t_xw[1] = next_xw[1]
next_xw[1] = t_xw[1]
# 0.5秒後にすれ違う
if np.abs(t_xw[0] - next_xw[0]) == 1 and t_xw[1] != next_xw[1]:
if (
t_xw[0] > next_xw[0] or (t_xw[0] == 0 and next_xw[0] == L - 1)
) and t_xw[1] == 1:
t_xw[0] -= 1
t_xw[1] = 2
next_xw[0] += 1
next_xw[1] = 1
elif (
next_xw[0] > t_xw[0] or (next_xw[0] == 0 and t_xw[0] == L - 1)
) and next_xw[1] == 1:
t_xw[0] += 1
t_xw[1] = 1
next_xw[0] -= 1
next_xw[1] = 2
for tup in sorted(sort_dic):
print(tup[1][0])
| Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s127523912 | Accepted | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | # coding=UTF-8
N = int(input())
mozir = input()
hyo = mozir.split(" ")
A = [int(mono) for mono in hyo]
subseq_nth = 0
subseq_mae = None
subseq_muki = None
for mono in A:
if subseq_mae == None:
subseq_nth += 1
subseq_mae = mono
# print('case 1')
else:
if subseq_muki == None:
if subseq_mae == mono:
subseq_mae = mono
# print('case 2')
elif subseq_mae > mono:
# 減少パターン
subseq_muki = -1
subseq_mae = mono
# print('case 3')
else:
subseq_muki = 1
subseq_mae = mono
# print('case 4')
elif (mono - subseq_mae) * subseq_muki >= 0:
# 増加減少の向きが合うとき
# ここでは横這いのときもok
subseq_mae = mono
# print('case 5')
else:
# そうで無ければ仕切り直し
subseq_mae = mono
subseq_nth += 1
subseq_muki = None
# print('case 6')
# 後処理
pass
print(subseq_nth)
| Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the minimum possible number of subarrays after division of A.
* * * | s100494276 | Wrong Answer | p03745 | Input is given from Standard Input in the following format:
N
A_1 A_2 ... A_N | n = int(input())
a = iter(map(int, input().split()))
p = 1
i, j = next(a), next(a, 0)
while j != 0:
k = next(a, 0)
# print(j,k)
if 0 not in (i, j, k) and (i < j > k or i > j < k):
p += 1
i, j = j, k
k = next(a, 0)
i, j = j, k
print(p)
| Statement
You are given an array A of length N. Your task is to divide it into several
contiguous subarrays. Here, all subarrays obtained must be sorted in either
non-decreasing or non-increasing order. At least how many subarrays do you
need to divide A into? | [{"input": "6\n 1 2 3 2 2 1", "output": "2\n \n\nOne optimal solution is to divide the array into [1,2,3] and [2,2,1].\n\n* * *"}, {"input": "9\n 1 2 1 2 1 2 1 2 1", "output": "5\n \n\n* * *"}, {"input": "7\n 1 2 3 2 1 999999999 1000000000", "output": "3"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s219017235 | Accepted | p03315 | Input is given from Standard Input in the following format:
S | import math
import queue
import bisect
import heapq
import time
import itertools
mod = int(1e9 + 7)
def swap(a, b):
return (b, a)
def my_round(a, dig=0):
p = 10**dig
return (a * p * 2 + 1) // 2 / p
def gcd(a, b): # 最大公約数
if a < b:
a, b = swap(a, b)
if b == 0:
return a
else:
return gcd(b, a % b)
def lcm(a, b): # 最小公倍数
return a / gcd(a, b) * b
def divisors(a): # 約数列挙
divisors = []
for i in range(1, int(a**0.5) + 1):
if a % i == 0:
divisors.append(i)
if i != a // i:
divisors.append(a // i)
return divisors
def is_prime(a): # 素数判定
if a < 2:
return False
elif a == 2:
return True
elif a % 2 == 0:
return False
sqrt_num = int(a**0.5)
for i in range(3, sqrt_num + 1, 2):
if a % i == 0:
return False
return True
def prime_num(a): # 素数列挙
pn = [2]
for i in range(3, int(a**0.5), 2):
prime = True
for j in pn:
if i % j == 0:
prime = False
break
if prime:
pn.append(i)
return pn
def prime_fact(a): # 素因数分解
sqrt = math.sqrt(a)
res = []
i = 2
if is_prime(a):
res.append(a)
else:
while a != 1:
while a % i == 0:
res.append(i)
a //= i
i += 1
return res
def main():
s = input()
ans = 0
for i in range(4):
if s[i] == "+":
ans += 1
else:
ans -= 1
print(ans)
return
if __name__ == "__main__":
main()
| Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s479636704 | Accepted | p03315 | Input is given from Standard Input in the following format:
S | import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate
def read_ints():
return list(map(int, read().split()))
def read_a_int():
return int(read())
def read_tuple(H):
"""
H is number of rows
"""
ret = []
for _ in range(H):
ret.append(tuple(map(int, read().split())))
return ret
def read_col(H):
"""
H is number of rows
A列、B列が与えられるようなとき
ex1)A,B=read_col(H) ex2) A,=read_col(H) #一列の場合
"""
ret = []
for _ in range(H):
ret.append(list(map(int, read().split())))
return tuple(map(list, zip(*ret)))
def read_matrix(H):
"""
H is number of rows
"""
ret = []
for _ in range(H):
ret.append(list(map(int, read().split())))
return ret
# return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため
MOD = 10**9 + 7
INF = 2**31 # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right # , insort_left, insort_right
# https://atcoder.jp/contests/abc101/tasks/abc101_a
S = read()[:-1]
ans = 0
for s in S:
ans += 1 if s == "+" else -1
print(ans)
| Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s012203933 | Accepted | p03315 | Input is given from Standard Input in the following format:
S | import functools
import os
INF = float("inf")
def inp():
return int(input())
def inpf():
return float(input())
def inps():
return input()
def inl():
return list(map(int, input().split()))
def inlf():
return list(map(float, input().split()))
def inls():
return input().split()
def debug(fn):
if not os.getenv("LOCAL"):
return fn
@functools.wraps(fn)
def wrapper(*args, **kwargs):
print(
"DEBUG: {}({}) -> ".format(
fn.__name__,
", ".join(
list(map(str, args))
+ ["{}={}".format(k, str(v)) for k, v in kwargs.items()]
),
),
end="",
)
ret = fn(*args, **kwargs)
print(ret)
return ret
return wrapper
s = input()
print(s.count("+") - s.count("-"))
| Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s478768072 | Runtime Error | p03315 | Input is given from Standard Input in the following format:
S | import sys
def main():
input = sys.stdin.readline
S = str(input().strip())
ans = 0
for c in S:
if c == +:
ans += 1
else:
ans -= 1
print(ans)
if __name__ == '__main__':
main() | Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s736670970 | Runtime Error | p03315 | Input is given from Standard Input in the following format:
S | s=input()
con=[0]*2
for i in range(4):
if s[i]=='+':
c[0]+=1
else:
c[1]+=1
print(c[0]-c[1]) | Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s170767083 | Runtime Error | p03315 | Input is given from Standard Input in the following format:
S | import numpy as np
# import pdb
tmp = list(map(int, input().strip().split(" ")))
N = tmp[0]
K = tmp[1]
A = list(map(int, input().strip().split(" ")))
A = np.asarray(A)
pos = np.argmin(A)
"""
pos = np.where(A == A.min())[0]
#pdb.set_trace()
tmp = -1
ans = 0
for pos_one in pos:
ans += np.ceil((pos_one - tmp - 1) / (K-1))
tmp = pos_one
ans += np.ceil((N - tmp - 1) / (K-1))
print(ans.astype(np.uint64))
"""
left = pos
right = N - pos - 1
if N <= K:
print(1)
elif right + 1 <= K and left + 1 <= K:
print(2)
elif right + 1 <= K:
left -= K - (right + 1)
left_count = np.ceil(left / (K - 1))
right_count = np.ceil(right / (K - 1))
print((left_count + right_count).astype(np.uint64))
elif left + 1 <= K:
right -= K - (left + 1)
left_count = np.ceil(left / (K - 1))
right_count = np.ceil(right / (K - 1))
print((left_count + right_count).astype(np.uint64))
else:
left_count = np.ceil(left / (K - 1))
hamide = K - (left % (K - 1)) - 1
right = right - hamide
right_count = np.ceil(right / (K - 1))
print((left_count + right_count).astype(np.uint64))
| Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s386333795 | Runtime Error | p03315 | Input is given from Standard Input in the following format:
S | S = input()
Steam = 0
minecraft = 0
for i in range()len(S):
if S[i] == "+":
minecraft += 1
else:
Steam += 1
L = minecraft * 1
P = Steam * -1
print(L + P) | Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s662781367 | Runtime Error | p03315 | Input is given from Standard Input in the following format:
S | s=input()
con=[0]*2
for i in raange(4):
if s[i]=='+':
c[0]+=1
else:
c[1]+=1
print(c[0]-c[1]) | Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s461232028 | Runtime Error | p03315 | Input is given from Standard Input in the following format:
S | serch_table = []
for i in range(100):
for j in range(1, 1000):
x = str(j) + "9" * i
x = int(x)
serch_table.append(x)
# print(serch_table)
L = []
for i in serch_table:
l = [x for x in str(i)]
x = sum(map(int, l))
l = [i / x, i]
L.append(l)
L = sorted(L)
M = []
tmp = -1
for i in L:
if tmp < i[1]:
M.append(i[1])
tmp = i[1]
# print(M,len(serch_table ))
N = int(input())
for i in range(N):
print(M[i])
| Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s939837380 | Accepted | p03315 | Input is given from Standard Input in the following format:
S | print(sum([1 if i == "+" else -1 for i in input()]))
| Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s503776707 | Accepted | p03315 | Input is given from Standard Input in the following format:
S | print(-4 + 2 * input().count("+"))
| Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s576328450 | Runtime Error | p03315 | Input is given from Standard Input in the following format:
S | s=row_input()
print(s.count(+)-s.count(-))
| Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s482822366 | Wrong Answer | p03315 | Input is given from Standard Input in the following format:
S | # asdf
| Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s619154968 | Accepted | p03315 | Input is given from Standard Input in the following format:
S | print(sum(0 - (si == "-") + (si == "+") for si in input()))
| Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s395977453 | Accepted | p03315 | Input is given from Standard Input in the following format:
S | print(eval("0" + input().replace("+", "+1").replace("-", "-1")))
| Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s282352139 | Runtime Error | p03315 | Input is given from Standard Input in the following format:
S | a=input().split()
plus = a.count(+)
minus = a.count(-)
result=plus-minus
print(result) | Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Print the integer in Takahashi's mind after he eats all the symbols.
* * * | s254739083 | Runtime Error | p03315 | Input is given from Standard Input in the following format:
S | s = map(int, input().split(1))
a = s.count(+)
b = s.count(-)
print(a - b) | Statement
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat
four symbols, each of which is `+` or `-`. When he eats `+`, the integer in
his mind increases by 1; when he eats `-`, the integer in his mind decreases
by 1.
The symbols Takahashi is going to eat are given to you as a string S. The i-th
character in S is the i-th symbol for him to eat.
Find the integer in Takahashi's mind after he eats all the symbols. | [{"input": "+-++", "output": "2\n \n\n * Initially, the integer in Takahashi's mind is 0.\n * The first integer for him to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The second integer to eat is `-`. After eating it, the integer in his mind becomes 0.\n * The third integer to eat is `+`. After eating it, the integer in his mind becomes 1.\n * The fourth integer to eat is `+`. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\n* * *"}, {"input": "-+--", "output": "-2\n \n\n* * *"}, {"input": "----", "output": "-4"}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.