category
stringclasses 5
values | question
stringlengths 20
555
| answer
stringlengths 1
20
| solution_abst
stringlengths 1
287
| solution_code
stringlengths 27
5.97k
|
---|---|---|---|---|
Correspondence | For the natural number A, the quotient of A divided by 9 is 6 and the remainder is 5. What is the value of A? | 59 | 9 6 [OP_MUL] 5 [OP_ADD] | var_a = 9
var_b = 6
var_c = var_a * var_b
var_d = 5
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | Find the sum of all multiples of 9 that are less than 80. | 324 | 1 80 1 [OP_SUB] 1 [OP_LIST_ARANGE] 9 [OP_LIST_DIVISIBLE] [OP_LIST_SUM] | var_a = 1
var_b = 80
var_c = 1
var_d = var_b - var_c
var_e = 1
list_a = [i for i in range(var_a, var_d + 1, var_e)]
var_f = 9
list_b = []
var_f = int(var_f)
for i in list_a:
i = int(i)
if i % var_f == 0:
list_b.append(i)
list_b = [float(i) for i in list_b]
var_g = sum(list_b)
print(int(var_g)) |
Possibility | Dongju selects a piece of paper with a number written on it, and wants to make a three-digit number by placing the first selected number in the hundreds place, the second selected in the tens place, and the third selected in the units place. If the numbers written on each paper was 1, 6, and 8, respectively, find the sum of the second smallest and third smallest three-digit numbers that Dongju can make. However, you cannot select the same numbered paper multiple times. | 804 | [OP_LIST_SOL] 1 6 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 [OP_LIST_MIN] 3 [OP_LIST_MIN] [OP_ADD] | var_a = 1
var_b = 6
var_c = 8
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 2
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
var_g = 3
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f + var_h
print(int(var_i)) |
Possibility | Among the numbers that you can make using all of the numbers 1, 2, 6, and 8 once each, find the sum of the second largest four-digit number and the third smallest four-digit number. | 10240 | [OP_LIST_SOL] 1 2 6 8 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 2 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_ADD] | var_a = 1
var_b = 2
var_c = 6
var_d = 8
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_e))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_f = 2
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
var_h = 3
list_d=list_b.copy()
list_d.sort()
var_i = list_d[var_h-1]
var_j = var_g + var_i
print(int(var_j)) |
Geometry | How many diagonals can you draw in a decagon? | 35 | 10 10 3 [OP_SUB] [OP_MUL] 2 [OP_DIV] | var_a = 10
var_b = 10
var_c = 3
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 2
var_g = var_e / var_f
print(int(var_g)) |
Arithmetic calculation | The length of one span of Jinseo is about 12 centimeters (cm). When Jinseo measured the length of the shorter side of the bookshelf, it was about two spans. How many centimeters (cm) is the short side of the bookshelf? | 24 | 12 2 [OP_MUL] | var_a = 12
var_b = 2
var_c = var_a * var_b
print(int(var_c)) |
Possibility | What is the difference between the largest number and the smallest number that can be made by selecting four from the number magnets 2, 0, 3, 5, and 8 and arranging them in a row to form a four-digit number? | 6497 | [OP_LIST_SOL] 2 0 3 5 8 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] | var_a = 2
var_b = 0
var_c = 3
var_d = 5
var_e = 8
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_f))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = 1
list_d=list_b.copy()
list_d.sort()
var_j = list_d[var_i-1]
var_k = var_h - var_j
print(int(var_k)) |
Geometry | Jiho's classmates are standing on the playground. When the students made a big square by matching the front, back, left, and right spacing, there were 3 people left. It is said that 44 more students are needed to increase each horizontal and vertical side of the square by 2 columns. How many students are in Jiho's class? | 103 | 41 3 [OP_ADD] 4 [OP_SUB] 4 [OP_DIV] 2 [OP_POW] 3 [OP_ADD] | var_a = 41
var_b = 3
var_c = var_a + var_b
var_d = 4
var_e = var_c - var_d
var_f = 4
var_g = var_e / var_f
var_h = 2
var_i = var_g ** var_h
var_j = 3
var_k = var_i + var_j
print(int(var_k)) |
Correspondence | A number divided by 10 is 6. Yoongi got the result by subtracting 15 from a certain number. What is the result he got? | 45 | 6 10 [OP_MUL] 15 [OP_SUB] | var_a = 6
var_b = 10
var_c = var_a * var_b
var_d = 15
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | A85-2B=364. How much is A? | 3 | A85-2B=364 A [OP_DIGIT_UNK_SOLVER] | var_a = 'A85-2B=364'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Arithmetic calculation | This year, the age difference between Minsu and his mother is 28 years old, and after 13 years, the age of his mother will be twice that of Minsu. Find the age of Minsu this year. | 15 | 13 28 13 [OP_SUB] 2 [OP_MUL] [OP_ADD] 2 1 [OP_SUB] [OP_DIV] 28 [OP_SUB] | var_a = 13
var_b = 28
var_c = 13
var_d = var_b - var_c
var_e = 2
var_f = var_d * var_e
var_g = var_a + var_f
var_h = 2
var_i = 1
var_j = var_h - var_i
var_k = var_g / var_j
var_l = 28
var_m = var_k - var_l
print(int(var_m)) |
Correspondence | You wanted to subtract 46 from a number, but you accidentally subtract 59 and get 43. How much do you get from the correct calculation? | 56 | 43 59 [OP_ADD] 46 [OP_SUB] | var_a = 43
var_b = 59
var_c = var_a + var_b
var_d = 46
var_e = var_c - var_d
print(int(var_e)) |
Possibility | Jeonghee, Cheolsu, Eunsu, and Minjun went to the cinema to watch a horror movie. If Eunsu and Minjun, who can't watch horror movies, don't sit next to each other, find the number of cases in which four people sit in a row. (However, there are four seats and all are attached.) | 12 | [OP_LIST_SOL] Jeonghee Cheolsu Eunsu Minjun [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_LIST_SOL] Eunsu [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_LIST_SOL] Eunsu Minjun [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_MUL] [OP_SUB] | var_a = 'Jeonghee'
var_b = 'Cheolsu'
var_c = 'Eunsu'
var_d = 'Minjun'
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = len(list_a)
var_f = len(list_a)
var_g = 1
var_e = int(var_e)
var_f = int(var_f)
for i, elem in enumerate(range(var_f)):
var_g = var_g * (var_e-i)
var_h = 'Eunsu'
list_b= []
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
list_b.reverse()
list_c = list(set(list_a) - set(list_b))
var_i = len(list_c)
var_j = len(list_c)
var_k = 1
var_i = int(var_i)
var_j = int(var_j)
for i, elem in enumerate(range(var_j)):
var_k = var_k * (var_i-i)
var_l = 'Eunsu'
var_m = 'Minjun'
list_d= []
if "/" in str(var_m):
var_m = eval(str(var_m))
list_d.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_d.append(var_l)
list_d.reverse()
var_n = len(list_d)
var_o = len(list_d)
var_p = 1
var_n = int(var_n)
var_o = int(var_o)
for i, elem in enumerate(range(var_o)):
var_p = var_p * (var_n-i)
var_q = var_k * var_p
var_r = var_g - var_q
print(int(var_r)) |
Possibility | Three caterpillars came across a forked road. Each caterpillar must choose the path between left and right. Find the number of ways the last caterpillar chooses the left path. | 4 | 2 2 [OP_MUL] | var_a = 2
var_b = 2
var_c = var_a * var_b
print(int(var_c)) |
Possibility | The owner of the snack shop said that for a special occasion, he would give out cookies equal to the three-digit number made by using 1, 7, and 0 all at least once. What number should Haneul make to receive the most sweets? | 710 | [OP_LIST_SOL] 7 1 0 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] | var_a = 7
var_b = 1
var_c = 0
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = len(list_a)
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
print(int(var_f)) |
Comparison | Jungkook is the 5th place. Find the number of people who crossed the finish line faster than Jungkook. | 4 | 5 1 [OP_SUB] | var_a = 5
var_b = 1
var_c = var_a - var_b
print(int(var_c)) |
Geometry | A parallelogram was cut to form a trapezoid, the lower side being 4 centimeters (cm) longer than the upper side. If the upper side is 12 centimeters (cm) and the height is 10 centimeters (cm), how much is the area of this trapezoid? | 140 | 12 12 4 [OP_ADD] [OP_ADD] 10 [OP_MUL] 2 [OP_DIV] | var_a = 12
var_b = 12
var_c = 4
var_d = var_b + var_c
var_e = var_a + var_d
var_f = 10
var_g = var_e * var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i)) |
Possibility | There are five cards of numbers 1, 3, 5, 7, and 9. What is the second largest number less than 500 of the three-digit natural numbers that can be created using this card? (However, a card can be used repeatedly.) | 397 | [OP_LIST_SOL] 1 3 5 7 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PRODUCT] 500 [OP_LIST_LESS] 2 [OP_LIST_MAX] | var_a = 1
var_b = 3
var_c = 5
var_d = 7
var_e = 9
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=var_f))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_g = 500
list_c = []
for i in list_b:
if i < var_g:
list_c.append(i)
var_h = 2
list_d=list_c.copy()
list_d.sort()
var_i = list_d[-var_h]
print(int(var_i)) |
Geometry | Farm A has a rectangular shape measuring 6 kilometers (km) by 9 kilometers (km), and Farm B has a square shape measuring 8 kilometers (km) by 8 km by 8 kilometers (km). The owners of both farms want to build a fence around the perimeter of the farm by putting together wooden planks of the same length. Which farm needs more planks? | B | [OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] 6 9 [OP_ADD] 8 8 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'A'
var_b = 'B'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 6
var_d = 9
var_e = var_c + var_d
var_f = 8
var_g = 8
var_h = var_f + var_g
list_b= []
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l) |
Arithmetic calculation | The exchange rate refers to the rate at which one country's currency is exchanged for another country's currency. Soojeong came back from a trip to the U.S. and exchanged the remaining 140 dollars for 158,760 won in Korean money at the bank today. What is the exchange rate of the Korean Won to the US Dollar today?
| 1134 | 158760 140 [OP_DIV] | var_a = 158760
var_b = 140
var_c = var_a / var_b
print(int(var_c)) |
Comparison | Jian has 3 notebooks in his bag, Doyun has 5 notebooks in his bag, and Siu has 2 notebooks in his bag. Who has the second most notebooks? | Jian | [OP_LIST_SOL] 지안 도윤 시우 [OP_LIST_EOL] [OP_LIST_SOL] 3 5 2 [OP_LIST_EOL] 2 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = '지안'
var_b = '도윤'
var_c = '시우'
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 3
var_e = 5
var_f = 2
list_b= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
var_g = 2
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j) |
Correspondence | Seungyeon is wrapping the box with ribbon tape. If 28 identical boxes are wrapped with the ribbon tape that is 82.04 meters (m) long and there should be no tape left after wrapping, how many meters (m) of ribbon tape are needed to wrap one box? | 2.93 | 82.04 28 [OP_DIV] | var_a = 82.04
var_b = 28
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Comparison | The four students, Jimin, Yoongi, Taehyung, and Namjoon, are of different ages. Yoongi is older than Namjoon, and Jimin is older than Taehyung but younger than Namjoon. Who is the youngest among the 4 people? | Taehyung | [OP_LIST_SOL] Jimin Yoongi Taehyung Namjoon [OP_LIST_EOL] [OP_LIST_SOL] Jimin Taehyung > Jimin Namjoon < Yoongi Namjoon > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = 'Jimin'
var_b = 'Yoongi'
var_c = 'Taehyung'
var_d = 'Namjoon'
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 'Jimin'
var_f = 'Taehyung'
var_g = '>'
var_h = 'Jimin'
var_i = 'Namjoon'
var_j = '<'
var_k = 'Yoongi'
var_l = 'Namjoon'
var_m = '>'
list_b= []
if "/" in str(var_m):
var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_n = len(list_c)
var_o = list_c[var_n-1]
print(var_o) |
Comparison | A country has a total of 3 islands. Each island has 12 ships, and each ship has 24 crew members. Find the number of crew members working on all the islands in this country. | 864 | 3 12 [OP_MUL] 24 [OP_MUL] | var_a = 3
var_b = 12
var_c = var_a * var_b
var_d = 24
var_e = var_c * var_d
print(int(var_e)) |
Possibility | We want to simultaneously draw three different numbers from among the natural numbers less than 10. Find the number of ways in which the sum of three numbers is 14. | 48 | 1 10 1 [OP_SUB] 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] 14 [OP_LIST_LESS_EQUAL] 14 [OP_LIST_MORE_EQUAL] [OP_LIST_LEN] | var_a = 1
var_b = 10
var_c = 1
var_d = var_b - var_c
var_e = 1
list_a = [i for i in range(var_a, var_d + 1, var_e)]
var_f = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_f))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
list_c=[]
for i in list_b:
var_g = 0
i = int(i)
while i//10 > 0:
var_g = var_g + i%10
i = i//10
var_g = var_g + i%10
list_c.append(var_g)
var_h = 14
list_d = []
for i in list_c:
if i <= var_h:
list_d.append(i)
var_i = 14
list_e = []
for i in list_d:
if i >= var_i:
list_e.append(i)
var_j = len(list_e)
print(int(var_j)) |
Arithmetic calculation | My mother is 43 years old this year. A few years ago, her age was five times her daughter's age, who is 11 years old this year. Find how many years ago it was. | 3 | 5 11 [OP_MUL] 43 [OP_SUB] 5 1 [OP_SUB] [OP_DIV] | var_a = 5
var_b = 11
var_c = var_a * var_b
var_d = 43
var_e = var_c - var_d
var_f = 5
var_g = 1
var_h = var_f - var_g
var_i = var_e / var_h
print(int(var_i)) |
Geometry | Yuran wants to buy a gift box that is 9 centimeters (cm) wide, 4 centimeters (cm) long, and 7 centimeters (cm) high. What is the volume in cubic centimeters (cm) of the gift box Yuran is buying? | 252 | 9 4 [OP_MUL] 7 [OP_MUL] | var_a = 9
var_b = 4
var_c = var_a * var_b
var_d = 7
var_e = var_c * var_d
print(int(var_e)) |
Comparison | Jungkook, Jimin, Seokjin, Taehyung, and Namjoon are standing side by side. Jungkook is standing next to Jimin's right side, and Seokjin is standing next to Jimin's left side. Also, Namjoon is standing to the left of Seokjin, and Jungkook is standing to the left of Taehyung. Who's standing on the furthest right? | Taehyung | [OP_LIST_SOL] Jungkook Jimin Seokjin Taehyung Namjoon [OP_LIST_EOL] [OP_LIST_SOL] Jungkook Jimin > Seokjin Jimin < Namjoon Seokjin < Jungkook Taehyung < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET] | var_a = 'Jungkook'
var_b = 'Jimin'
var_c = 'Seokjin'
var_d = 'Taehyung'
var_e = 'Namjoon'
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 'Jungkook'
var_g = 'Jimin'
var_h = '>'
var_i = 'Seokjin'
var_j = 'Jimin'
var_k = '<'
var_l = 'Namjoon'
var_m = 'Seokjin'
var_n = '<'
var_o = 'Jungkook'
var_p = 'Taehyung'
var_q = '<'
list_b= []
if "/" in str(var_q):
var_q = eval(str(var_q))
list_b.append(var_q)
if "/" in str(var_p):
var_p = eval(str(var_p))
list_b.append(var_p)
if "/" in str(var_o):
var_o = eval(str(var_o))
list_b.append(var_o)
if "/" in str(var_n):
var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_m):
var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_r = 1
var_s = list_c[var_r-1]
print(var_s) |
Correspondence | When a number is multiplied by 14, it is 458.64. When a number is divided by 17, round the remainder to two decimal places. | 15.76 | 458.64 14 [OP_DIV] 17 [OP_MOD] 2 [OP_ROUND] | var_a = 458.64
var_b = 14
var_c = var_a / var_b
var_d = 17
var_e = var_c % var_d
var_f = 2
var_g = round(float(var_e)+1e-10, var_f)
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Arithmetic calculation | Hyunggyu jumps rope 215 times every day. If Taewoo jumps 0.32 times the number of rope jumps made by Hyeonggyu, how many times does Taewoo jump rope a day? | 68.8 | 215 0.32 [OP_MUL] | var_a = 215
var_b = 0.32
var_c = var_a * var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Correspondence | There are two different numbers A and B. Find B from the two-digit subtraction equation, 9A-B4=34. | 6 | 9A-B4=34 B [OP_DIGIT_UNK_SOLVER] | var_a = '9A-B4=34'
var_b = 'B'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Possibility | How many three-digit numbers can you make from three different numbers of the numbers 1, 3, 6, and 7? | 24 | [OP_LIST_SOL] 1 3 6 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 1
var_b = 3
var_c = 6
var_d = 7
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_e))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_f = len(list_b)
print(int(var_f)) |
Arithmetic calculation | There are pieces of ribbon each of which is 30 centimeters (cm) long. I tied 15 pieces of ribbon to each other to make a long piece of ribbon. If 2 centimeters (cm) of a piece of ribbon is used to tie the ribbon, what is the length of the piece of ribbon made? | 422 | 30 15 [OP_MUL] 15 1 [OP_SUB] 2 [OP_MUL] [OP_SUB] | var_a = 30
var_b = 15
var_c = var_a * var_b
var_d = 15
var_e = 1
var_f = var_d - var_e
var_g = 2
var_h = var_f * var_g
var_i = var_c - var_h
print(int(var_i)) |
Correspondence | Find A that satisfies 32×A×A×A=42592 | 11 | 32×A×A×A=42592 A [OP_NUM_UNK_SOLVER] | var_a = '32×A×A×A=42592'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 0
candidate_num = [i for i in range(51)]
candi = list(itertools.product(candidate_num, repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
if term_list[i] == '':
new_eq += str(term_list[i])+op_list[i]
else:
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
if '=' in new_eq and '>' not in new_eq and '<' not in new_eq:
new_eq=new_eq.replace('==','=')
new_eq=new_eq.replace('>','')
new_eq=new_eq.replace('<','')
new_eq=new_eq.split('=')
for i in range(len(new_eq)-1):
eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1]))
if not eval_result:
break
else:
eval_result = eval(new_eq)
except:
eval_result = False
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Arithmetic calculation | A pink rabbit and a white rabbit is running a race. The pink rabbit ran at a speed of 15 kilometers per hour (km), and the white rabbit ran at a speed of 10 kilometers per hour (km), arriving 30 minutes later than the pink rabbit. Find the time it took for the pink rabbit to arrive. | 1 | 10 30 60 [OP_DIV] [OP_MUL] 15 10 [OP_SUB] [OP_DIV] | var_a = 10
var_b = 30
var_c = 60
var_d = var_b / var_c
var_e = var_a * var_d
var_f = 15
var_g = 10
var_h = var_f - var_g
var_i = var_e / var_h
print(int(var_i)) |
Arithmetic calculation | Taehyung is trying to get to his grandmother's house, which is 300 kilometers (km) away on a motorcycle at 60 kilometers (km) per hour. Find how far Taehyung needs to go when 2 hours have passed since he left. | 180 | 300 60 2 [OP_MUL] [OP_SUB] | var_a = 300
var_b = 60
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
print(int(var_e)) |
Arithmetic calculation | Taehyung has 45 candies. If he plans to give 5 candies to his friends, how many friends can get candies in maximum? | 9 | 45 5 [OP_FDIV] | var_a = 45
var_b = 5
var_c = var_a // var_b
print(int(var_c)) |
Possibility | How many multiples of 4 are there among the four-digit numbers made using the number cards 1, 3, 5, and 6 once? | 6 | [OP_LIST_SOL] 1 3 5 6 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 4 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 1
var_b = 3
var_c = 5
var_d = 6
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_e))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_f = 4
list_c = []
var_f = int(var_f)
for i in list_b:
i = int(i)
if i % var_f == 0:
list_c.append(i)
var_g = len(list_c)
print(int(var_g)) |
Possibility | Among Rat, Cow, Tiger, Rabbit, Dragon, and Snake, find the number of cases in which the rat is placed at the very front, the snake at the very back, and the rest are placed in one line. | 24 | [OP_LIST_SOL] Rat Cow Tiger Rabbit Dragon Snake [OP_LIST_EOL] [OP_LIST_SOL] Rat [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_SOL] Snake [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] | var_a = 'Rat'
var_b = 'Cow'
var_c = 'Tiger'
var_d = 'Rabbit'
var_e = 'Dragon'
var_f = 'Snake'
list_a= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_a.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_g = 'Rat'
list_b= []
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
list_c = list(set(list_a) - set(list_b))
var_h = 'Snake'
list_d= []
if "/" in str(var_h):
var_h = eval(str(var_h))
list_d.append(var_h)
list_d.reverse()
list_e = list(set(list_c) - set(list_d))
var_i = len(list_e)
var_j = len(list_e)
var_k = 1
var_i = int(var_i)
var_j = int(var_j)
for i, elem in enumerate(range(var_j)):
var_k = var_k * (var_i-i)
print(int(var_k)) |
Arithmetic calculation | A car that requires 0.14 liters (l) of gasoline to run 1 kilometer (km) ran for 2 hours and 30 minutes at 93.6 kilometers (km) per hour. How many liters of gasoline did it use? | 32.76 | 0.14 93.6 [OP_MUL] 2 30 60 [OP_DIV] [OP_ADD] [OP_MUL] | var_a = 0.14
var_b = 93.6
var_c = var_a * var_b
var_d = 2
var_e = 30
var_f = 60
var_g = var_e / var_f
var_h = var_d + var_g
var_i = var_c * var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Possibility | There are 5 different people. Everyone wanted to be an executive, so you decided to have 1 chairman, 1 vice-president, 1 secretary, 1 secretary, and 1 manager. Find the possible number of cases for assigning the position. | 120 | 5 1 1 [OP_ADD] 1 [OP_ADD] 1 [OP_ADD] 1 [OP_ADD] [OP_PERM] | var_a = 5
var_b = 1
var_c = 1
var_d = var_b + var_c
var_e = 1
var_f = var_d + var_e
var_g = 1
var_h = var_f + var_g
var_i = 1
var_j = var_h + var_i
var_k = 1
var_a = int(var_a)
var_j = int(var_j)
for i, elem in enumerate(range(var_j)):
var_k = var_k * (var_a-i)
print(int(var_k)) |
Correspondence | When 3+6AB=691, what number should go in B? | 8 | 3+6AB=691 B [OP_DIGIT_UNK_SOLVER] | var_a = '3+6AB=691'
var_b = 'B'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Possibility | There are two types of Korean language workbooks and four types of math workbooks. When choosing one book among them, in how many cases can you choose Korean workbook or math workbook? | 6 | 2 4 [OP_ADD] 1 [OP_COMB] | var_a = 2
var_b = 4
var_c = var_a + var_b
var_d = 1
var_e = 1
var_c = int(var_c)
var_d = int(var_d)
for i, elem in enumerate(range(var_d)):
var_e = var_e * (var_c-i)
for i, elem in enumerate(range(var_d)):
var_e = var_e / (i+1)
print(int(var_e)) |
Geometry | A regular hexagon with an area of 21.12 square centimeters (cm2) is divided into six pieces. If the cut pieces have the same shape and size, find the area of one piece in square centimeters (cm2). | 3.52 | 21.12 6 [OP_DIV] | var_a = 21.12
var_b = 6
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Correspondence | There are a total of 928 baduk stones and 713 of them are colored white. Find the difference between the number of white stones and black stones. | 498 | 713 928 713 [OP_SUB] [OP_SUB] | var_a = 713
var_b = 928
var_c = 713
var_d = var_b - var_c
var_e = var_a - var_d
print(int(var_e)) |
Possibility | The smallest two-digit number that can be formed by two of 0, 3, 4, 6, and 8 is subtracted by a certain number and it became 7. Find the number. | 23 | [OP_LIST_SOL] 0 3 4 6 8 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] 7 [OP_SUB] | var_a = 0
var_b = 3
var_c = 4
var_d = 6
var_e = 8
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 2
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_f))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = 7
var_j = var_h - var_i
print(int(var_j)) |
Correspondence | When you multiply a number by 7, it becomes 98. What is that number? | 14 | 98 7 [OP_DIV] | var_a = 98
var_b = 7
var_c = var_a / var_b
print(int(var_c)) |
Arithmetic calculation | There are three numbers 10, 11, and 12. What is the difference between the smallest number and the second smallest number? | 1 | [OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_SUB] [OP_ABS] | var_a = 10
var_b = 11
var_c = 12
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 1
list_b=list_a.copy()
list_b.sort()
var_e = list_b[var_d-1]
var_f = 2
list_c=list_a.copy()
list_c.sort()
var_g = list_c[var_f-1]
var_h = var_e - var_g
var_i = abs(var_h)
print(int(var_i)) |
Arithmetic calculation | There are 42 chickens and 48 ducks on the farm, and there are as many geese as there are chickens. How many ducks are fewer than the number of chickens and geese combined? | 36 | 42 42 [OP_ADD] 48 [OP_SUB] | var_a = 42
var_b = 42
var_c = var_a + var_b
var_d = 48
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | When a number is divided by 6, it becomes 1/10. What is the value of the number divided by 3/25? | 5 | 1/10 6 [OP_MUL] 3/25 [OP_DIV] | var_a = 0.1
var_b = 6
var_c = var_a * var_b
var_d = 0.12
var_e = var_c / var_d
print(int(eval('{:.2f}'.format(round(var_e+1e-10,2))))) |
Geometry | You want to place tissue paper with a radius of 2 centimeters (cm) inside a square box with a side length of 8 centimeters (cm) without overlapping. How many toilet papers can be put on one floor? | 4 | 8 2 2 [OP_MUL] [OP_DIV] 2 [OP_POW] | var_a = 8
var_b = 2
var_c = 2
var_d = var_b * var_c
var_e = var_a / var_d
var_f = 2
var_g = var_e ** var_f
print(int(var_g)) |
Correspondence | A3B-41=591. How much is A? | 6 | A3B-41=591 A [OP_DIGIT_UNK_SOLVER] | var_a = 'A3B-41=591'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Arithmetic calculation | What is the smallest two-digit number that is a multiple of 3 and a multiple of 5 at the same time? | 15 | 10 99 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN] | var_a = 10
var_b = 99
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
list_b = []
var_d = int(var_d)
for i in list_a:
i = int(i)
if i % var_d == 0:
list_b.append(i)
var_e = 5
list_c = []
var_e = int(var_e)
for i in list_b:
i = int(i)
if i % var_e == 0:
list_c.append(i)
var_f = 1
list_d=list_c.copy()
list_d.sort()
var_g = list_d[var_f-1]
print(int(var_g)) |
Correspondence | I should have subtracted 23, but I mistakenly subtracted 32 from some number and got 25. How much do you get when calculated correctly? | 34 | 25 32 [OP_ADD] 23 [OP_SUB] | var_a = 25
var_b = 32
var_c = var_a + var_b
var_d = 23
var_e = var_c - var_d
print(int(var_e)) |
Geometry | The rectangular shape of the ttakji's area is 1.77 square centimeters (cm2). If the width of this ttakji is 3 centimeters (cm), how many centimeters (cm) will the length be? | 0.59 | 1.77 3 [OP_DIV] | var_a = 1.77
var_b = 3
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Possibility | Find the sum of the largest number and the third largest number when selecting three of 1, 3, 4, and 7 to form a three-digit number with 3 in the tens place. | 1171 | [OP_LIST_SOL] 1 3 4 7 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 10 3 [OP_LIST_SEARCH_FIXED_DIGIT] 1 [OP_LIST_MAX] 3 [OP_LIST_MAX] [OP_ADD] | var_a = 1
var_b = 3
var_c = 4
var_d = 7
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_e))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_f = 10
var_g = 3
list_c = []
var_f = int(var_f)
var_g = int(var_g)
for i in list_b:
i = int(i)
if (i//var_f)%10 == var_g:
list_c.append(i)
var_h = 1
list_d=list_c.copy()
list_d.sort()
var_i = list_d[-var_h]
var_j = 3
list_e=list_c.copy()
list_e.sort()
var_k = list_e[-var_j]
var_l = var_i + var_k
print(int(var_l)) |
Arithmetic calculation | You have five numbers 10, 11, 12, 13, and 14. What is the sum of the largest number and the second smallest number? | 25 | [OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_ADD] | var_a = 10
var_b = 11
var_c = 12
var_d = 13
var_e = 14
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 1
list_b=list_a.copy()
list_b.sort()
var_g = list_b[-var_f]
var_h = 2
list_c=list_a.copy()
list_c.sort()
var_i = list_c[var_h-1]
var_j = var_g + var_i
print(int(var_j)) |
Arithmetic calculation | When 14.23 is divided by 4.7, find the value to two decimal places. | 3.03 | 14.23 4.7 [OP_DIV] 2 [OP_ROUND] | var_a = 14.23
var_b = 4.7
var_c = var_a / var_b
var_d = 2
var_e = round(float(var_c)+1e-10, var_d)
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Arithmetic calculation | How many three-digit numbers are divisible by the two numbers - 4 and 5? | 45 | 100 999 1 [OP_LIST_ARANGE] 4 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 100
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 4
list_b = []
var_d = int(var_d)
for i in list_a:
i = int(i)
if i % var_d == 0:
list_b.append(i)
var_e = 5
list_c = []
var_e = int(var_e)
for i in list_b:
i = int(i)
if i % var_e == 0:
list_c.append(i)
var_f = len(list_c)
print(int(var_f)) |
Comparison | It rained 135 millimeters (mm) yesterday and 12 centimeters (cm) 7 millimeters (mm) today. Find the answer on which day it rained more between yesterday and today. | yesterday | [OP_LIST_SOL] yesterday today [OP_LIST_EOL] [OP_LIST_SOL] 135 12 10 [OP_MUL] 7 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'yesterday'
var_b = 'today'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 135
var_d = 12
var_e = 10
var_f = var_d * var_e
var_g = 7
var_h = var_f + var_g
list_b= []
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l) |
Correspondence | When you multiply a number by 2, you get 18. What is the value of this number when you subtract 4? | 5 | 18 2 [OP_DIV] 4 [OP_SUB] | var_a = 18
var_b = 2
var_c = var_a / var_b
var_d = 4
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | It is said that it takes an hour to make 8 toys from one machine. How many hours would it take to make 200 toys using 5 machines? | 5 | 200 8 5 [OP_MUL] [OP_DIV] | var_a = 200
var_b = 8
var_c = 5
var_d = var_b * var_c
var_e = var_a / var_d
print(int(var_e)) |
Correspondence | I have to divide a number by 8, but I accidentally multiply a number by 6 is 96. What is the correct calculation result? | 2 | 96 6 [OP_DIV] 8 [OP_DIV] | var_a = 96
var_b = 6
var_c = var_a / var_b
var_d = 8
var_e = var_c / var_d
print(int(var_e)) |
Possibility | 16 teams are about to have a soccer match. Two teams have a game to eliminate the losing team, while only the winning team is allowed to proceed to the next game, and the team who won the last game wins the match. Find the total number of games. | 15 | 16 1 [OP_SUB] | var_a = 16
var_b = 1
var_c = var_a - var_b
print(int(var_c)) |
Correspondence | Multiplying a number by 11 and adding 1 equals 45. Find the number. | 4 | 45 1 [OP_SUB] 11 [OP_DIV] | var_a = 45
var_b = 1
var_c = var_a - var_b
var_d = 11
var_e = var_c / var_d
print(int(var_e)) |
Possibility | There are 5 types of hot coffee and 4 types of cold coffee in the cafe, and there are 3 types of cookies and 5 types of muffins. Find the number of cases where you order 1 coffee and 1 bread each. | 72 | 5 4 [OP_ADD] 3 5 [OP_ADD] [OP_MUL] | var_a = 5
var_b = 4
var_c = var_a + var_b
var_d = 3
var_e = 5
var_f = var_d + var_e
var_g = var_c * var_f
print(int(var_g)) |
Geometry | A cuboid box is 18 centimeters (cm) long, 10 centimeters (cm) wide, and 2 centimeters (cm) high. How many square centimeters (cm2) will be covered to paint the entire inside of this uncovered box? | 292 | 18 10 [OP_MUL] 10 2 [OP_MUL] 2 18 [OP_MUL] [OP_ADD] 2 [OP_MUL] [OP_ADD] | var_a = 18
var_b = 10
var_c = var_a * var_b
var_d = 10
var_e = 2
var_f = var_d * var_e
var_g = 2
var_h = 18
var_i = var_g * var_h
var_j = var_f + var_i
var_k = 2
var_l = var_j * var_k
var_m = var_c + var_l
print(int(var_m)) |
Possibility | You can go to the academy from school in 3 ways, and from the academy to the playground in 4 ways. In total, how many ways are there to get from school to the playground passing the academy? | 12 | 3 4 [OP_MUL] | var_a = 3
var_b = 4
var_c = var_a * var_b
print(int(var_c)) |
Correspondence | There is a number that is a multiple of 9. The quotient of a number divided by 9 is then divided again by 9, and the quotient is 25 and the remainder is 7. Find the number. | 2088 | 25 9 [OP_MUL] 7 [OP_ADD] 9 [OP_MUL] | var_a = 25
var_b = 9
var_c = var_a * var_b
var_d = 7
var_e = var_c + var_d
var_f = 9
var_g = var_e * var_f
print(int(var_g)) |
Comparison | As a result of the Korean language test in the school, Taehyung, Minju, Sangmin, Yoonjung, and Yoojung received the highest score in that order. Who got the highest score? | Taehyung | [OP_LIST_SOL] Taehyung Minju Sangmin Yoonjung Yoojung [OP_LIST_EOL] 1 [OP_LIST_GET] | var_a = 'Taehyung'
var_b = 'Minju'
var_c = 'Sangmin'
var_d = 'Yoonjung'
var_e = 'Yoojung'
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 1
var_g = list_a[var_f-1]
print(var_g) |
Comparison | There are 9 people standing in a line from shortest to tallest. Consider Hoseok is the shortest. Then what place does Hoseok take when the line is in order from tallest to shortest? | 9 | 9 1 [OP_SUB] 1 [OP_ADD] | var_a = 9
var_b = 1
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Geometry | What is the sum of the lengths of the four sides of a square with a side of 9 centimeters (cm), in cm (cm)? | 36 | 9 4 [OP_MUL] | var_a = 9
var_b = 4
var_c = var_a * var_b
print(int(var_c)) |
Geometry | Find the perimeter of a regular octagon with a side length of 12 meters (m), in meters (m). | 96 | 12 8 [OP_MUL] | var_a = 12
var_b = 8
var_c = var_a * var_b
print(int(var_c)) |
Correspondence | A is a number comprised of 1 group of 1000, 16 groups of 100, and 28 groups of 10. B is calculated as 3 jumps from 355 with an interval of 245. Find the value of A-B. | 1790 | 1000 1 [OP_MUL] 100 16 [OP_MUL] [OP_ADD] 10 28 [OP_MUL] [OP_ADD] 355 245 3 [OP_MUL] [OP_ADD] [OP_SUB] | var_a = 1000
var_b = 1
var_c = var_a * var_b
var_d = 100
var_e = 16
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 10
var_i = 28
var_j = var_h * var_i
var_k = var_g + var_j
var_l = 355
var_m = 245
var_n = 3
var_o = var_m * var_n
var_p = var_l + var_o
var_q = var_k - var_p
print(int(var_q)) |
Arithmetic calculation | A full bottle of milk weighs 1650 grams (g). After drinking 1/3 of the milk, I weighed the bottle again, which was 1250 grams (g). How many grams (g) does the bottle alone weigh? | 450 | 1650 1650 1250 [OP_SUB] 1 [OP_MUL] 1/3 [OP_DIV] [OP_SUB] | var_a = 1650
var_b = 1650
var_c = 1250
var_d = var_b - var_c
var_e = 1
var_f = var_d * var_e
var_g = 0.3333333333333333
var_h = var_f / var_g
var_i = var_a - var_h
print(int(var_i)) |
Arithmetic calculation | Find the sum of 100 consecutive odd numbers from 1. | 10000 | 1 100 1 [OP_SUB] 2 [OP_MUL] 1 [OP_ADD] 2 [OP_LIST_ARANGE] [OP_LIST_SUM] | var_a = 1
var_b = 100
var_c = 1
var_d = var_b - var_c
var_e = 2
var_f = var_d * var_e
var_g = 1
var_h = var_f + var_g
var_i = 2
list_a = [i for i in range(var_a, var_h + 1, var_i)]
list_a = [float(i) for i in list_a]
var_j = sum(list_a)
print(int(var_j)) |
Correspondence | A number is less than 10 and is not a multiple of 2 or 3. Which number is it out of 7, 8, 9, or 10? | 7 | [OP_LIST_SOL] 7 8 9 10 [OP_LIST_EOL] 2 [OP_LIST_DIVISIBLE] [OP_SET_DIFFERENCE] 3 [OP_LIST_DIVISIBLE] [OP_SET_DIFFERENCE] 10 [OP_LIST_LESS] 1 [OP_LIST_GET] | var_a = 7
var_b = 8
var_c = 9
var_d = 10
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 2
list_b = []
var_e = int(var_e)
for i in list_a:
i = int(i)
if i % var_e == 0:
list_b.append(i)
list_c = list(set(list_a) - set(list_b))
var_f = 3
list_d = []
var_f = int(var_f)
for i in list_c:
i = int(i)
if i % var_f == 0:
list_d.append(i)
list_e = list(set(list_c) - set(list_d))
var_g = 10
list_f = []
for i in list_e:
if i < var_g:
list_f.append(i)
var_h = 1
var_i = list_f[var_h-1]
print(int(var_i)) |
Possibility | The dice are rolled and the dots 2, 4, and 3 come out. How many three-digit numbers formed by using all the digits once are less than 340? | 3 | [OP_LIST_SOL] 2 4 3 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 340 [OP_LIST_LESS] [OP_LIST_LEN] | var_a = 2
var_b = 4
var_c = 3
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 340
list_c = []
for i in list_b:
if i < var_e:
list_c.append(i)
var_f = len(list_c)
print(int(var_f)) |
Arithmetic calculation | Find the sum of the digits of the even numbers from 600 to 800. | 1508 | 600 800 2 [OP_LIST_ARANGE] [OP_LIST_NUM2SUM] [OP_LIST_SUM] | var_a = 600
var_b = 800
var_c = 2
list_a = [i for i in range(var_a, var_b + 1, var_c)]
list_b=[]
for i in list_a:
var_d = 0
i = int(i)
while i//10 > 0:
var_d = var_d + i%10
i = i//10
var_d = var_d + i%10
list_b.append(var_d)
list_b = [float(i) for i in list_b]
var_e = sum(list_b)
print(int(var_e)) |
Correspondence | Seoyoon's teacher bought her class pizzas. There were 7 students in Seoyoon's class, and each student took 12 pieces, leaving 5 pieces. At this moment, Seoyoon's neighboring classmate came in to play, so it is decided to distribute the pizza again to 8 people including Seoyoon's friend. Find the number of remaining pizza slices at this time. | 1 | 12 7 [OP_MUL] 5 [OP_ADD] 8 [OP_MOD] | var_a = 12
var_b = 7
var_c = var_a * var_b
var_d = 5
var_e = var_c + var_d
var_f = 8
var_g = var_e % var_f
print(int(var_g)) |
Comparison | JungKook and Jimin walked up the stairs to the third floor. Jimin took the elevator from the 3rd floor to the 5th floor. Who has risen higher, Jung Kook or Jimin? | Jimin | [OP_LIST_SOL] Jungkook Jimin [OP_LIST_EOL] [OP_LIST_SOL] 3 5 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Jungkook'
var_b = 'Jimin'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 3
var_d = 5
list_b= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h) |
Correspondence | A is 348 and A is less than B by 173. C is greater than B by 299. Find C. | 820 | 348 173 [OP_ADD] 299 [OP_ADD] | var_a = 348
var_b = 173
var_c = var_a + var_b
var_d = 299
var_e = var_c + var_d
print(int(var_e)) |
Comparison | 20 cars of different colors are parked in a row. The black car is 16th from the right, and the white car is 11th from the left. How many cars are between the black and white cars? | 5 | 16 11 [OP_ADD] 20 [OP_SUB] 2 [OP_SUB] | var_a = 16
var_b = 11
var_c = var_a + var_b
var_d = 20
var_e = var_c - var_d
var_f = 2
var_g = var_e - var_f
print(int(var_g)) |
Correspondence | The number of students in Class 1 is 69 and the number of students in Class 2 is 86. When I asked the students in Class 1 and Class 2 to form groups, there were 5 students left in Class 1 and 6 students in Class 2. Find the maximum number of people in a group. | 16 | 69 5 [OP_SUB] 86 6 [OP_SUB] [OP_GCD] | var_a = 69
var_b = 5
var_c = var_a - var_b
var_d = 86
var_e = 6
var_f = var_d - var_e
var_g = math.gcd(int(var_f), int(var_c))
print(int(var_g)) |
Arithmetic calculation | Thirty sheets of 25 centimeters (cm) long paper strips were overlapped by 6 centimeters (cm) each and made a long line. Find the total length in centimeters (cm) of the 30 strips of paper glued together. | 576 | 25 25 6 [OP_SUB] 30 1 [OP_SUB] [OP_MUL] [OP_ADD] | var_a = 25
var_b = 25
var_c = 6
var_d = var_b - var_c
var_e = 30
var_f = 1
var_g = var_e - var_f
var_h = var_d * var_g
var_i = var_a + var_h
print(int(var_i)) |
Correspondence | What number must go into A to make 632-5AB=41? | 9 | 632-5AB=41 A [OP_DIGIT_UNK_SOLVER] | var_a = '632-5AB=41'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Comparison | A is 3 groups of 10 and 7 individual units, and B is the number obtained by subtracting 1 from 40. Which is smaller, A or B? | A | [OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] 10 3 [OP_MUL] 7 [OP_ADD] 40 1 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'A'
var_b = 'B'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 10
var_d = 3
var_e = var_c * var_d
var_f = 7
var_g = var_e + var_f
var_h = 40
var_i = 1
var_j = var_h - var_i
list_b= []
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
var_k = 1
list_c=list_b.copy()
list_c.sort()
var_l = list_c[var_k-1]
var_m = list_b.index(var_l)+1
var_n = list_a[var_m-1]
print(var_n) |
Geometry | A rectangle-shaped notebook and a square-shaped notebook have the same area. If the lengths of the two sides of the notebook are 9 centimeters (cm) and 16 centimeters (cm), respectively. How many centimeters (cm) are the length of one side of the notebook? | 12 | 9 16 [OP_MUL] 1/2 [OP_POW] | var_a = 9
var_b = 16
var_c = var_a * var_b
var_d = 0.5
var_e = var_c ** var_d
print(int(var_e)) |
Geometry | You have a rectangle with a perimeter of 40 centimeters (cm). If the width of this rectangle is 8 centimeters (cm), how many centimeters (cm) is the length? | 12 | 40 2 [OP_DIV] 8 [OP_SUB] | var_a = 40
var_b = 2
var_c = var_a / var_b
var_d = 8
var_e = var_c - var_d
print(int(var_e)) |
Possibility | Find how many multiples of 4 are less than 30. | 7 | 1 30 1 [OP_SUB] 1 [OP_LIST_ARANGE] 4 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 1
var_b = 30
var_c = 1
var_d = var_b - var_c
var_e = 1
list_a = [i for i in range(var_a, var_d + 1, var_e)]
var_f = 4
list_b = []
var_f = int(var_f)
for i in list_a:
i = int(i)
if i % var_f == 0:
list_b.append(i)
var_g = len(list_b)
print(int(var_g)) |
Arithmetic calculation | There are 9 dogs and 23 cats. How many more cats are there than dogs? | 14 | 23 9 [OP_SUB] | var_a = 23
var_b = 9
var_c = var_a - var_b
print(int(var_c)) |
Arithmetic calculation | There are 45 apples. There are 21 fewer pears than apples. How many tangerines are there if there are 18 fewer pears than tangerines? | 42 | 45 21 [OP_SUB] 18 [OP_ADD] | var_a = 45
var_b = 21
var_c = var_a - var_b
var_d = 18
var_e = var_c + var_d
print(int(var_e)) |
Possibility | You want to put 5 different books A, B, C, D, and E on a bookshelf. When A, B, and C are placed on the left side in such order, find the number of ways to place books on the bookshelf. | 2 | [OP_LIST_SOL] A B C D E [OP_LIST_EOL] [OP_LIST_SOL] A B C [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] | var_a = 'A'
var_b = 'B'
var_c = 'C'
var_d = 'D'
var_e = 'E'
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 'A'
var_g = 'B'
var_h = 'C'
list_b= []
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
list_c = list(set(list_a) - set(list_b))
var_i = len(list_c)
var_j = len(list_c)
var_k = 1
var_i = int(var_i)
var_j = int(var_j)
for i, elem in enumerate(range(var_j)):
var_k = var_k * (var_i-i)
print(int(var_k)) |
Comparison | Two students, Yoongi and Jungkook, have numbers 7 and 6, respectively. Whose number is smaller? | Jungkook | [OP_LIST_SOL] Yoongi Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 7 6 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Yoongi'
var_b = 'Jungkook'
list_a= []
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_c = 7
var_d = 6
list_b= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h) |
Arithmetic calculation | 10's are 21, 1's are 8, 0.1's are 5, and 0.01's are 34 in a certain number. How much is this number? | 218.84 | 10 21 [OP_MUL] 1 8 [OP_MUL] [OP_ADD] 0.1 5 [OP_MUL] [OP_ADD] 0.01 34 [OP_MUL] [OP_ADD] | var_a = 10
var_b = 21
var_c = var_a * var_b
var_d = 1
var_e = 8
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 0.1
var_i = 5
var_j = var_h * var_i
var_k = var_g + var_j
var_l = 0.01
var_m = 34
var_n = var_l * var_m
var_o = var_k + var_n
print('{:.2f}'.format(round(var_o+1e-10,2))) |
Possibility | Given 3 number cards with 6, 3, and 8 written on them, find the sum of the largest and smallest three-digit numbers that can be formed by using each card only once. | 1231 | [OP_LIST_SOL] 6 3 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD] | var_a = 6
var_b = 3
var_c = 8
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 1
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f + var_h
print(int(var_i)) |
Arithmetic calculation | How many three-digit numbers are common multiples of 4 and 5? | 45 | 100 999 1 [OP_LIST_ARANGE] 4 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 100
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 4
list_b = []
var_d = int(var_d)
for i in list_a:
i = int(i)
if i % var_d == 0:
list_b.append(i)
var_e = 5
list_c = []
var_e = int(var_e)
for i in list_b:
i = int(i)
if i % var_e == 0:
list_c.append(i)
var_f = len(list_c)
print(int(var_f)) |
Arithmetic calculation | Yewon ran at a speed of 180 meters (m) in 30 seconds. How many meters (m) did Yewon run in 1 minute? | 360 | 1 60 [OP_MUL] 30 [OP_DIV] 180 [OP_MUL] | var_a = 1
var_b = 60
var_c = var_a * var_b
var_d = 30
var_e = var_c / var_d
var_f = 180
var_g = var_e * var_f
print(int(var_g)) |
Correspondence | There is a number that is divisible by 5 and the resulting quotient is 4. Subtract 10 from that particular number, and then multiply by 3, and then subtract 18. What is the answer? | 12 | 4 5 [OP_MUL] 10 [OP_SUB] 3 [OP_MUL] 18 [OP_SUB] | var_a = 4
var_b = 5
var_c = var_a * var_b
var_d = 10
var_e = var_c - var_d
var_f = 3
var_g = var_e * var_f
var_h = 18
var_i = var_g - var_h
print(int(var_i)) |
Correspondence | Subtracting 7/3 from a number equals 3/2. What is the result if you add 7/3 to that number? | 6.17 | 3/2 7/3 [OP_ADD] 7/3 [OP_ADD] | var_a = 1.5
var_b = 2.3333333333333335
var_c = var_a + var_b
var_d = 2.3333333333333335
var_e = var_c + var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
End of preview. Expand
in Dataset Viewer.
DMath (Diverse Math Word Problems)
This repository provides DMath (Diverse Math Word Problems), a collection of 10K high-quality grade school-level math word problems for the paper "It Ain’t Over: A Multi-aspect Diverse Math Word Problem Dataset".
Details of the dataset
DMath is a multi-aspect diverse MWP dataset, which has the following key features:
- It fully covers problem types across five categories. These include arithmetic calculation (ARI), comparison (COM), correspondence (COR), geometry(GEO), and possibility (POS).
- It consists of about 10,000 problems manually created by 43 human workers covering various lexical usage patterns on natural language narratives and expression trees.
- It supports bilingual input languages, i.e., English and Korean.
- It offers the annotation of expression trees and Python code as intermediate solutions.
In summary, DMath offers a wide range of diversity in problem types, lexical usage patterns, languages, and intermediate solution forms.
Statistics of the dataset
The table below shows the number of samples per category on DMath.
ARI | COM | COR | POS | GEO | Total | |
---|---|---|---|---|---|---|
Train | 2,476 | 1,338 | 1,656 | 1,417 | 1,056 | 7,943 |
Test | 669 | 334 | 402 | 383 | 291 | 2,079 |
Total | 3,145 | 1,672 | 2,058 | 1,800 | 1,347 | 10,002 |
Data format
You can see a sample of the data here.
"1": {
"category": "Geometry",
"question_ko": "테이프를 일직선으로 쭉 붙이려고 한다. 잘라낸 3개의 테이프가 각각 36센티미터(㎝), 42센티미터(㎝), 48센티미터(㎝)이고 같은 부분만큼 겹쳐서 붙이면 총 길이가 97센티미터(㎝)이다. 겹쳐진 부분의 길이는 얼마인지 구하시오.",
"question_en": "We are trying to stick a tape in a straight line. The three tapes cut are 36 centimeters (cm), 42 centimeters (cm), and 48 centimeters (cm) respectively, and if the same part is overlapped and attached, the total length is 97 centimeters (cm). Find the length of the overlapping part.",
"answer_ko": "14.5",
"answer_en": "14.5",
"solution_abst_ko": "36 42 [OP_ADD] 48 [OP_ADD] 97 [OP_SUB] 3 1 [OP_SUB] [OP_DIV]",
"solution_abst_en": "36 42 [OP_ADD] 48 [OP_ADD] 97 [OP_SUB] 3 1 [OP_SUB] [OP_DIV]",
"solution_code_ko": "var_a = 36\nvar_b = 42\nvar_c = var_a + var_b\nvar_d = 48\nvar_e = var_c + var_d\nvar_f = 97\nvar_g = var_e - var_f\nvar_h = 3\nvar_i = 1\nvar_j = var_h - var_i\nvar_k = var_g / var_j\nprint('{:.2f}'.format(round(var_k+1e-10,2)))",
"solution_code_en": "var_a = 36\nvar_b = 42\nvar_c = var_a + var_b\nvar_d = 48\nvar_e = var_c + var_d\nvar_f = 97\nvar_g = var_e - var_f\nvar_h = 3\nvar_i = 1\nvar_j = var_h - var_i\nvar_k = var_g / var_j\nprint('{:.2f}'.format(round(var_k+1e-10,2)))"
},
One data consists of the following keys:
category
: The problem types. It can beArithmetic Calculation
,Comparison
,Correspondence
,Possibility
, andGeometry
.question_ko
: The natural language narratives in Korean.question_en
: The natural language narratives in English.answer_ko
: The answer of the question in Korean.answer_en
: The answer of the question in English.solution_abst_ko
: The expression tree solution (=abstract solution) of the question in Korean.solution_abst_en
: The expression tree solution (=abstract solution) of the question in English.solution_code_ko
: The Python code solution of the question in Korean.solution_code_en
: The Python code solution of the question in English.
- Downloads last month
- 15