category
stringclasses 5
values | question
stringlengths 20
555
| answer
stringlengths 1
20
| solution_abst
stringlengths 1
287
| solution_code
stringlengths 27
5.97k
|
---|---|---|---|---|
Arithmetic calculation | Of the 35 students in Taehyung's class, 3 of them scored 93, 83, and 87 points on the Korean language test, respectively. If the average Korean language score of the rest of the students is 76, what is the average Korean language score of the whole class? | 77 | 76 35 3 [OP_SUB] [OP_MUL] 93 [OP_ADD] 83 [OP_ADD] 87 [OP_ADD] 35 [OP_DIV] | var_a = 76
var_b = 35
var_c = 3
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 93
var_g = var_e + var_f
var_h = 83
var_i = var_g + var_h
var_j = 87
var_k = var_i + var_j
var_l = 35
var_m = var_k / var_l
print(int(var_m)) |
Arithmetic calculation | The average English test score of 10 female students in Dayoung's class is 83.1 points, and the average English test score of 8 male students is 84 points. What is the average English score for this class as a whole? | 83.5 | 10 83.1 [OP_MUL] 8 84 [OP_MUL] [OP_ADD] 10 8 [OP_ADD] [OP_DIV] | var_a = 10
var_b = 83.1
var_c = var_a * var_b
var_d = 8
var_e = 84
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 10
var_i = 8
var_j = var_h + var_i
var_k = var_g / var_j
print('{:.2f}'.format(round(var_k+1e-10,2))) |
Arithmetic calculation | We plan to create 24 flower beds at equal intervals on one side of the 239.66 m (m) long trail. If you make one flower bed at the beginning and one at the end of the trail, what is the distance in meters (m) between the flower beds? | 10.42 | 239.66 24 1 [OP_SUB] [OP_DIV] | var_a = 239.66
var_b = 24
var_c = 1
var_d = var_b - var_c
var_e = var_a / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Correspondence | I opened the faucet and started filling the water tank that has 27 liters (L) of water. When I filled water for 1 minute, the tank had 58 liters (L) of water. After filling water again for 1 minute in this tank, I scooped out 48 liters (L) of water. how many liters (L) of water are in the tank? | 41 | 58 27 [OP_SUB] 58 48 [OP_SUB] [OP_ADD] | var_a = 58
var_b = 27
var_c = var_a - var_b
var_d = 58
var_e = 48
var_f = var_d - var_e
var_g = var_c + var_f
print(int(var_g)) |
Comparison | There are two pies. Strawberry pie has a radius of 4 centimeters (cm), and pumpkin pie has a diameter of 10 centimeters (cm). Which of the two is the bigger pie? | pumpkin | [OP_LIST_SOL] Strawberry pumpkin [OP_LIST_EOL] [OP_LIST_SOL] 4 10 2 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Strawberry'
var_b = 'pumpkin'
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 = 4
var_d = 10
var_e = 2
var_f = var_d / var_e
list_b= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_g = 1
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) |
Arithmetic calculation | Eunji ate 9 of the tangerines in the basket, and her mother put 5 more tangerines in the basket, and the number of tangerines in the basket increased to 20. How many tangerines were in the first basket? | 24 | 20 9 [OP_ADD] 5 [OP_SUB] | var_a = 20
var_b = 9
var_c = var_a + var_b
var_d = 5
var_e = var_c - var_d
print(int(var_e)) |
Geometry | You cannot draw a straight line between any three points. What is the number of line segments for these three points? | 3 | 3 2 [OP_COMB] | var_a = 3
var_b = 2
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
var_c = var_c * (var_a-i)
for i, elem in enumerate(range(var_b)):
var_c = var_c / (i+1)
print(int(var_c)) |
Arithmetic calculation | Hyosung drank 0.2 of the water he had in the morning and 0.35 of the remaining water at lunch. When 130 milliliters (ml) of water remained, find how many milliliters (ml) of water Hyosung had at first. | 250 | 130 1 0.35 [OP_SUB] [OP_DIV] 1 0.2 [OP_SUB] [OP_DIV] | var_a = 130
var_b = 1
var_c = 0.35
var_d = var_b - var_c
var_e = var_a / var_d
var_f = 1
var_g = 0.2
var_h = var_f - var_g
var_i = var_e / var_h
print(int(var_i)) |
Geometry | Find the volume of the rectangular prism with a height of 5 centimeters (cm) and a base circumference of 16 centimeters (cm), where the base has the maximum area.. | 80 | 16 2 [OP_DIV] 2 [OP_DIV] 2 [OP_POW] 5 [OP_MUL] | var_a = 16
var_b = 2
var_c = var_a / var_b
var_d = 2
var_e = var_c / var_d
var_f = 2
var_g = var_e ** var_f
var_h = 5
var_i = var_g * var_h
print(int(var_i)) |
Comparison | Jungkook collects the number that adds 3 to 6, and Yoongi collects 4. Who has the smaller number? | Yoongi | [OP_LIST_SOL] Jungkook Yoongi [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_ADD] 4 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Jungkook'
var_b = 'Yoongi'
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 = 3
var_e = var_c + var_d
var_f = 4
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)
list_b.reverse()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j) |
Geometry | The cabinet Hyejin bought to collect the figures is rectangular in shape with a width of 1.2 meters (m) and a length of 1.8 meters (m). Find the area of the cabinet in square meters (m2). | 2.16 | 1.2 1.8 [OP_MUL] | var_a = 1.2
var_b = 1.8
var_c = var_a * var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Possibility | Of the 5 students, 3 are boys and 2 are girls. When 5 students are arranged in a row, find the case in which all male students stand in a row. | 36 | [OP_LIST_SOL] A B C D E [OP_LIST_EOL] [OP_LIST_SOL] A C [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_LIST_SOL] A C E [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_MUL] | 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 = 'C'
list_b= []
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_h = len(list_c)
var_i = len(list_c)
var_j = 1
var_h = int(var_h)
var_i = int(var_i)
for i, elem in enumerate(range(var_i)):
var_j = var_j * (var_h-i)
var_k = 'A'
var_l = 'C'
var_m = 'E'
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)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_d.append(var_k)
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_j * var_p
print(int(var_q)) |
Possibility | There are 3 pairs of mandarin ducks. How many mandarin ducks are there in total? | 6 | 3 2 [OP_MUL] | var_a = 3
var_b = 2
var_c = var_a * var_b
print(int(var_c)) |
Arithmetic calculation | Dohyun's marbles can be put in 7 pockets with 16 each. Joohyun's marbles can be stored in 6 bags with 25 each. Find how many marbles Dohyun and Joohyun have in total. | 262 | 16 7 [OP_MUL] 25 6 [OP_MUL] [OP_ADD] | var_a = 16
var_b = 7
var_c = var_a * var_b
var_d = 25
var_e = 6
var_f = var_d * var_e
var_g = var_c + var_f
print(int(var_g)) |
Arithmetic calculation | There are 250 kilograms (kg) of carrots in the supermarket and 2.5 times as many cucumbers as carrots. How many kilograms (kg) are there in both carrots and cucumbers? | 875 | 250 250 2.5 [OP_MUL] [OP_ADD] | var_a = 250
var_b = 250
var_c = 2.5
var_d = var_b * var_c
var_e = var_a + var_d
print(int(var_e)) |
Geometry | In a right triangle, what is the length of the hypotenuse if the length of the non-hypotenuse side and the length of the other non-hypotenuse side are 5 and 12, respectively? | 13 | 12 2 [OP_POW] 5 2 [OP_POW] [OP_ADD] 1/2 [OP_POW] | var_a = 12
var_b = 2
var_c = var_a ** var_b
var_d = 5
var_e = 2
var_f = var_d ** var_e
var_g = var_c + var_f
var_h = 0.5
var_i = var_g ** var_h
print(int(var_i)) |
Possibility | There are (Three digit number)/(two digit number) with the highest quotient were made by using 5, 9, 2, 7, and 3 number cards allowing duplicates. Find the remainder. | 9 | [OP_LIST_SOL] 5 9 2 7 3 [OP_LIST_EOL] 3 [OP_LIST_GET_PRODUCT] 1 [OP_LIST_MAX] [OP_LIST_POP] 2 [OP_LIST_GET_PRODUCT] 1 [OP_LIST_MIN] [OP_MOD] | var_a = 5
var_b = 9
var_c = 2
var_d = 7
var_e = 3
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 = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = 2
list_d = [str(i) for i in list_a]
list_d = list(itertools.product(list_d, repeat=var_i))
list_d = [''.join(num_list) for num_list in list_d]
list_d = [str_num for str_num in list_d if str_num[0] != '0']
list_d = [float(i) for i in list_d]
var_j = 1
list_e=list_d.copy()
list_e.sort()
var_k = list_e[var_j-1]
var_l = var_h % var_k
print(int(var_l)) |
Arithmetic calculation | If the sum of the allowances received by the older brother and the younger brother is 12,000 won, and the older brother received 1,000 won more than the younger brother, how much money did the older brother receive? | 6500 | 12000 1000 [OP_SUB] 2 [OP_DIV] 1000 [OP_ADD] | var_a = 12000
var_b = 1000
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 1000
var_g = var_e + var_f
print(int(var_g)) |
Possibility | Yoongi and Yuna want to share the 7 loaves of bread. One person must eat at least 1 loaf of bread. How many ways are there to share bread? | 6 | 7 2 1 [OP_MUL] [OP_SUB] 1 [OP_ADD] | var_a = 7
var_b = 2
var_c = 1
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 1
var_g = var_e + var_f
print(int(var_g)) |
Comparison | Namjoon was the 12th to arrive at school, and Jimin arrived at school 3 people earlier than Namjoon. In what number did Jimin arrive? | 8 | 12 3 [OP_SUB] 1 [OP_SUB] | var_a = 12
var_b = 3
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | The students of Saebyeol's school are going to have a wrestling match with each other once. How many students participated in the wrestling match if they had played 91 times? | 14 | 91 2 [OP_MUL] 1/2 [OP_POW] 1 [OP_CEIL] | var_a = 91
var_b = 2
var_c = var_a * var_b
var_d = 0.5
var_e = var_c ** var_d
var_f = 1
var_g=int(((var_e+9*10**(var_f-2))//(10**(var_f-1)))*10**(var_f-1))
print(int(var_g)) |
Comparison | 20 students lined up in a single line. Jungkook is standing right in front of Yoongi, and 11 students are standing behind him. How many students are standing in front of Yoongi? | 9 | 20 11 [OP_SUB] 1 [OP_ADD] 1 [OP_SUB] | var_a = 20
var_b = 11
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
var_f = 1
var_g = var_e - var_f
print(int(var_g)) |
Comparison | There are three numbers 0.8, 1/2, and 0.9. Which of the numbers less than or equal to 2 is the largest? | 0.9 | [OP_LIST_SOL] 0.8 1/2 0.9 [OP_LIST_EOL] 2 [OP_LIST_LESS_EQUAL] 1 [OP_LIST_MAX] | var_a = 0.8
var_b = 0.5
var_c = 0.9
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 = 2
list_b = []
for i in list_a:
if i <= var_d:
list_b.append(i)
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
print('{:.2f}'.format(round(var_f+1e-10,2))) |
Comparison | There are 7 numbers: 1.7, 1/5, 1/5, 1, 3/5, 3/8, and 1.4. When comparing sizes and writing them in order from largest to smallest, what is the fourth number? | 0.6 | [OP_LIST_SOL] 1.7 1 5 [OP_DIV] 1 5 [OP_DIV] 1 3 5 [OP_DIV] 3 8 [OP_DIV] 1.4 [OP_LIST_EOL] 4 [OP_LIST_MAX] | var_a = 1.7
var_b = 1
var_c = 5
var_d = var_b / var_c
var_e = 1
var_f = 5
var_g = var_e / var_f
var_h = 1
var_i = 3
var_j = 5
var_k = var_i / var_j
var_l = 3
var_m = 8
var_n = var_l / var_m
var_o = 1.4
list_a= []
if "/" in str(var_o):
var_o = eval(str(var_o))
list_a.append(var_o)
if "/" in str(var_n):
var_n = eval(str(var_n))
list_a.append(var_n)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_a.append(var_k)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_a.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_a.append(var_g)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_p = 4
list_b=list_a.copy()
list_b.sort()
var_q = list_b[-var_p]
print('{:.2f}'.format(round(var_q+1e-10,2))) |
Possibility | Five white balls are placed next to each other, and you want to color each white ball with one red, one blue, and two yellow. In how many different ways are the colored balls placed differently? | 60 | 5 4 [OP_PERM] 2 [OP_DIV] | var_a = 5
var_b = 4
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
var_c = var_c * (var_a-i)
var_d = 2
var_e = var_c / var_d
print(int(var_e)) |
Geometry | A figure has a side length of 7 centimeters (cm) and 3 sides in total. What is the perimeter of this shape in centimeters (cm)? | 21 | 7 3 [OP_MUL] | var_a = 7
var_b = 3
var_c = var_a * var_b
print(int(var_c)) |
Correspondence | When you add 5 to a number, you get 9. Find the number | 4 | 9 5 [OP_SUB] | var_a = 9
var_b = 5
var_c = var_a - var_b
print(int(var_c)) |
Arithmetic calculation | It is said that it takes 6.12 liters (L) of paint to paint a wall. How much is left after painting all the walls with 33.5 liters (L) of paint? | 2.9 | 33.5 6.12 [OP_MOD] | var_a = 33.5
var_b = 6.12
var_c = var_a % var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Arithmetic calculation | What is the remainder when dividing the largest number between 14 and 105 inclusive by the smallest number? | 7 | 105 14 [OP_MOD] | var_a = 105
var_b = 14
var_c = var_a % var_b
print(int(var_c)) |
Correspondence | There are total 821 numbers of chicks and chickens in the coop. If there are 267 chicks, find how many more chickens there are than chicks. | 287 | 821 267 [OP_SUB] 267 [OP_SUB] | var_a = 821
var_b = 267
var_c = var_a - var_b
var_d = 267
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | I need to add 479 to a certain number, but I mistakenly subtracted 749, so I got 280. Find the result of the correct calculation. | 1508 | 280 749 [OP_ADD] 479 [OP_ADD] | var_a = 280
var_b = 749
var_c = var_a + var_b
var_d = 479
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | Find the number of common divisors of 32 and 24. | 4 | 32 [OP_LIST_GET_DIVISOR] 24 [OP_LIST_GET_DIVISOR] [OP_SET_INTERSECT] [OP_LIST_LEN] | var_a = 32
list_a = []
num_sqrt = int(math.sqrt(var_a))
for i in range(1, num_sqrt+1):
if var_a % i == 0:
list_a.append(i)
list_a.append(int(var_a/i))
list_a = sorted(set(list_a))
var_b = 24
list_b = []
num_sqrt = int(math.sqrt(var_b))
for i in range(1, num_sqrt+1):
if var_b % i == 0:
list_b.append(i)
list_b.append(int(var_b/i))
list_b = sorted(set(list_b))
list_c = list(set(list_a) & set(list_b))
var_c = len(list_c)
print(int(var_c)) |
Possibility | There are number cards with the natural numbers from 1 to 9 written on them. How many ways can there that makes a total of 19 when taking 3 cards out? | 30 | 1 9 1 [OP_LIST_ARANGE] 3 [OP_LIST_GET_PERM] [OP_LIST_NUM2SUM] 19 [OP_LIST_FIND_NUM] | var_a = 1
var_b = 9
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
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]
list_c=[]
for i in list_b:
var_e = 0
i = int(i)
while i//10 > 0:
var_e = var_e + i%10
i = i//10
var_e = var_e + i%10
list_c.append(var_e)
var_f = 19
var_g = 0
var_f = int(var_f)
for i in list_c:
i = int(i)
if i == var_f:
var_g = var_g + 1
print(int(var_g)) |
Correspondence | I mistakenly subtracted 46 from a number that should have been multiplied by 46, and I got 27. How much do you get when you calculate it correctly? | 3358 | 27 46 [OP_ADD] 46 [OP_MUL] | var_a = 27
var_b = 46
var_c = var_a + var_b
var_d = 46
var_e = var_c * var_d
print(int(var_e)) |
Geometry | Using string, a square with a side of 20 centimeters (cm) was made. Using the same string, a rectangle wide 14 centimeters (cm) was made. Find the length of the height of this rectangle. | 26 | 20 4 [OP_MUL] 2 [OP_DIV] 14 [OP_SUB] | var_a = 20
var_b = 4
var_c = var_a * var_b
var_d = 2
var_e = var_c / var_d
var_f = 14
var_g = var_e - var_f
print(int(var_g)) |
Comparison | The bank, school, stationery store, convenience store, and park are the closest in that order. What is the 5th closest building? | park | [OP_LIST_SOL] bank school stationery convenience park [OP_LIST_EOL] 5 [OP_LIST_GET] | var_a = 'bank'
var_b = 'school'
var_c = 'stationery'
var_d = 'convenience'
var_e = 'park'
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 = 5
var_g = list_a[var_f-1]
print(var_g) |
Comparison | When I compared the sizes of box (a) and box (b), box (a) was larger than box (b). Between two boxes (a) and (b), which one is the smaller one? | (b) | [OP_LIST_SOL] (a) (b) [OP_LIST_EOL] [OP_LIST_SOL] (a) (b) > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [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 = '(a)'
var_d = '(b)'
var_e = '>'
list_b= []
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)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_b.append(var_c)
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_f = len(list_c)
var_g = list_c[var_f-1]
print(var_g) |
Arithmetic calculation | The average of the three numbers A, B, and C is 130. When you look for an average of those 3 numbers and D, you get 126. Find what D is. | 114 | 126 4 [OP_MUL] 130 3 [OP_MUL] [OP_SUB] | var_a = 126
var_b = 4
var_c = var_a * var_b
var_d = 130
var_e = 3
var_f = var_d * var_e
var_g = var_c - var_f
print(int(var_g)) |
Comparison | Jinho has a number that is the sum of 1 multiplied by 4, 0.1 multiplied by 2, and 0.001 multiplied by 7. Younghee has a number that is 100 multiplied by Jinho's number. If Jungsoo has a number that is 0.05 greater than Younghee's number, express Jungsoo's number in a decimal number. | 420.75 | 1 4 [OP_MUL] 0.1 2 [OP_MUL] [OP_ADD] 0.001 7 [OP_MUL] [OP_ADD] 100 [OP_MUL] 0.05 [OP_ADD] | var_a = 1
var_b = 4
var_c = var_a * var_b
var_d = 0.1
var_e = 2
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 0.001
var_i = 7
var_j = var_h * var_i
var_k = var_g + var_j
var_l = 100
var_m = var_k * var_l
var_n = 0.05
var_o = var_m + var_n
print('{:.2f}'.format(round(var_o+1e-10,2))) |
Possibility | There are 5 people A, B, C, D, and E. When 5 people are lined up, find the number of ways to put A at the front. | 24 | [OP_LIST_SOL] A B C D E [OP_LIST_EOL] [OP_LIST_SOL] A [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'
list_b= []
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_g = len(list_c)
var_h = len(list_c)
var_i = 1
var_g = int(var_g)
var_h = int(var_h)
for i, elem in enumerate(range(var_h)):
var_i = var_i * (var_g-i)
print(int(var_i)) |
Arithmetic calculation | Jung-min is jumping rope with Yeon-jun. Jung-min can do 256 in 4 minutes and Jimin can do 111 in 3 minutes. If Jung-min and Jimin did jumping rope for 3 minutes, find the sum of the number of times they jumped rope. | 303 | 256 3 4 [OP_DIV] [OP_MUL] 111 [OP_ADD] | var_a = 256
var_b = 3
var_c = 4
var_d = var_b / var_c
var_e = var_a * var_d
var_f = 111
var_g = var_e + var_f
print(int(var_g)) |
Geometry | There is a pencil case in the shape of a square prism. Its height is 8 centimeters (cm) and the sum of the lengths of all edges is 104 centimeters (cm). If you are going to decorate all the sides of this pencil case with square stickers measuring 4 centimeters (cm) on each side, without any overlaps, how many stickers are needed? | 18 | 104 8 4 [OP_MUL] [OP_SUB] 4 2 [OP_MUL] [OP_DIV] 8 [OP_MUL] 4 [OP_MUL] 4 2 [OP_POW] [OP_DIV] | var_a = 104
var_b = 8
var_c = 4
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 4
var_g = 2
var_h = var_f * var_g
var_i = var_e / var_h
var_j = 8
var_k = var_i * var_j
var_l = 4
var_m = var_k * var_l
var_n = 4
var_o = 2
var_p = var_n ** var_o
var_q = var_m / var_p
print(int(var_q)) |
Geometry | If a rectangle has an area of 28 square centimeters (cm2) and a width of 4 centimeters (cm), how many centimeters (cm) is its length? | 7 | 28 4 [OP_DIV] | var_a = 28
var_b = 4
var_c = var_a / var_b
print(int(var_c)) |
Correspondence | I mistakenly subtracted 32 from a certain number, when I needed to subtract 23, and I got 25. Find the result of the correct calculation. | 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)) |
Correspondence | You subtracted 4.3 when you should have added 4.3 to a number, resulting in 8.8. Find the correct value. | 17.4 | 8.8 4.3 [OP_ADD] 4.3 [OP_ADD] | var_a = 8.8
var_b = 4.3
var_c = var_a + var_b
var_d = 4.3
var_e = var_c + var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Possibility | You want to share 7 apples with 2 monkeys. In this case, if the monkeys get at least one apple, how many ways can monkeys share the apple? | 6 | 2 7 [OP_ADD] 2 1 [OP_MUL] [OP_SUB] 1 [OP_SUB] 7 2 1 [OP_MUL] [OP_SUB] [OP_COMB] | var_a = 2
var_b = 7
var_c = var_a + var_b
var_d = 2
var_e = 1
var_f = var_d * var_e
var_g = var_c - var_f
var_h = 1
var_i = var_g - var_h
var_j = 7
var_k = 2
var_l = 1
var_m = var_k * var_l
var_n = var_j - var_m
var_o = 1
var_i = int(var_i)
var_n = int(var_n)
for i, elem in enumerate(range(var_n)):
var_o = var_o * (var_i-i)
for i, elem in enumerate(range(var_n)):
var_o = var_o / (i+1)
print(int(var_o)) |
Arithmetic calculation | The average score for the Korean language of 10 male students in Kyungho's class was 83.1 points, and the average Korean language score of 8 female students was 84 points. What is the average Korean language score for this class as a whole? | 83.5 | 10 83.1 [OP_MUL] 8 84 [OP_MUL] [OP_ADD] 10 8 [OP_ADD] [OP_DIV] | var_a = 10
var_b = 83.1
var_c = var_a * var_b
var_d = 8
var_e = 84
var_f = var_d * var_e
var_g = var_c + var_f
var_h = 10
var_i = 8
var_j = var_h + var_i
var_k = var_g / var_j
print('{:.2f}'.format(round(var_k+1e-10,2))) |
Arithmetic calculation | Each pack of dolls contains 12 dolls. How many dolls are left if 11 students took 3 dolls each from 3 packs of dolls? | 3 | 12 3 [OP_MUL] 11 3 [OP_MUL] [OP_SUB] | var_a = 12
var_b = 3
var_c = var_a * var_b
var_d = 11
var_e = 3
var_f = var_d * var_e
var_g = var_c - var_f
print(int(var_g)) |
Arithmetic calculation | I want to mark 58 dots at equal intervals on both sides of a 191.8 centimeters (cm) desk. If you place a dot at both the beginning and end of the desk, how many centimeters (cm) is the distance between the dots? | 6.85 | 191.8 58 2 [OP_DIV] 1 [OP_SUB] [OP_DIV] | var_a = 191.8
var_b = 58
var_c = 2
var_d = var_b / var_c
var_e = 1
var_f = var_d - var_e
var_g = var_a / var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Geometry | I made the largest square using a piece of wire that is 28 centimeters (cm) long. How many centimeters (cm) is one side of the square? | 7 | 28 4 [OP_DIV] | var_a = 28
var_b = 4
var_c = var_a / var_b
print(int(var_c)) |
Arithmetic calculation | There is a myelin that reproduces twice as much as the first every month. At first, the sum of the weight of 100 myelin leaves in the bowl and bowl was 23.97 grams (g), and after 5 months, the sum of the weight of the bowl and the myelin leaves in the bowl was 155.1 grams (g). How many grams (g) are 10000 cloned myelin leaves? | 423 | 155.1 23.97 [OP_SUB] 100 2 5 [OP_POW] [OP_MUL] 100 [OP_SUB] [OP_DIV] 10000 [OP_MUL] | var_a = 155.1
var_b = 23.97
var_c = var_a - var_b
var_d = 100
var_e = 2
var_f = 5
var_g = var_e ** var_f
var_h = var_d * var_g
var_i = 100
var_j = var_h - var_i
var_k = var_c / var_j
var_l = 10000
var_m = var_k * var_l
print(int(var_m)) |
Correspondence | 15 consecutive natural numbers lie between a certain natural number and 81. What is this natural number when it is less than 81? | 66 | 81 15 [OP_SUB] | var_a = 81
var_b = 15
var_c = var_a - var_b
print(int(var_c)) |
Correspondence | You want to multiply 20 by some number. However, you mistakenly added some number to 40, and the result was 52. What is the correct calculation result? | 240 | 20 52 40 [OP_SUB] [OP_MUL] | var_a = 20
var_b = 52
var_c = 40
var_d = var_b - var_c
var_e = var_a * var_d
print(int(var_e)) |
Arithmetic calculation | The distance from the house to the bank is 800 meters (m), from the bank to the pharmacy is 1 kilometer (km) and 300 meters (m), and from the pharmacy to the school is 1700 meters (m). How many meters (m) is the distance from your house to the pharmacy through the bank greater than the distance from the pharmacy to the school? | 400 | 800 1 1000 [OP_MUL] 300 [OP_ADD] [OP_ADD] 1700 [OP_SUB] | var_a = 800
var_b = 1
var_c = 1000
var_d = var_b * var_c
var_e = 300
var_f = var_d + var_e
var_g = var_a + var_f
var_h = 1700
var_i = var_g - var_h
print(int(var_i)) |
Correspondence | There are two natural numbers A and B. If the quotient of A divided by B is 9 and the remainder is 13, what is the remainder when A is divided by 9? | 4 | 13 9 [OP_MOD] | var_a = 13
var_b = 9
var_c = var_a % var_b
print(int(var_c)) |
Arithmetic calculation | There are a total 12 of 10-won, 50-won, and 100-won coins. I checked the total amount and it was 500 won. If the number of 10-won and 50-won coins is the same, how many 100-won coins are there? | 2 | 12 500 100 12 [OP_MUL] [OP_SUB] 10 50 [OP_ADD] 100 2 [OP_MUL] [OP_SUB] [OP_DIV] 2 [OP_MUL] [OP_SUB] | var_a = 12
var_b = 500
var_c = 100
var_d = 12
var_e = var_c * var_d
var_f = var_b - var_e
var_g = 10
var_h = 50
var_i = var_g + var_h
var_j = 100
var_k = 2
var_l = var_j * var_k
var_m = var_i - var_l
var_n = var_f / var_m
var_o = 2
var_p = var_n * var_o
var_q = var_a - var_p
print(int(var_q)) |
Geometry | What is the circumference of a square with an area of 324 square meters (m2) in meters (m)? | 72 | 324 1/2 [OP_POW] 4 [OP_MUL] | var_a = 324
var_b = 0.5
var_c = var_a ** var_b
var_d = 4
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | We add 1.4 to a number before dividing it by 3. If you subtract 0.7 from this result and multiply it by 9, and get 5.4. What is the number? | 2.5 | 5.4 9 [OP_DIV] 0.7 [OP_ADD] 3 [OP_MUL] 1.4 [OP_SUB] | var_a = 5.4
var_b = 9
var_c = var_a / var_b
var_d = 0.7
var_e = var_c + var_d
var_f = 3
var_g = var_e * var_f
var_h = 1.4
var_i = var_g - var_h
print('{:.2f}'.format(round(var_i+1e-10,2))) |
Arithmetic calculation | In the bathhouse, a bathtub that can be filled with water up to 10 liters (L) is filled with water for the guests. 3 guests used 1 liter (L) and 500 milliliters (㎖) of water from this bathtub, and 1 guest used 1 liter (L) and 750 milliliters (㎖) of water. If the remaining guests each use 1 liter (L) and 250 milliliters (㎖) of water, how many people can take shower? | 3 | 10 1000 [OP_MUL] 1 1000 [OP_MUL] 500 [OP_ADD] 3 [OP_MUL] [OP_SUB] 1 1000 [OP_MUL] 750 [OP_ADD] [OP_SUB] 1 1000 [OP_MUL] 250 [OP_ADD] [OP_DIV] | var_a = 10
var_b = 1000
var_c = var_a * var_b
var_d = 1
var_e = 1000
var_f = var_d * var_e
var_g = 500
var_h = var_f + var_g
var_i = 3
var_j = var_h * var_i
var_k = var_c - var_j
var_l = 1
var_m = 1000
var_n = var_l * var_m
var_o = 750
var_p = var_n + var_o
var_q = var_k - var_p
var_r = 1
var_s = 1000
var_t = var_r * var_s
var_u = 250
var_v = var_t + var_u
var_w = var_q / var_v
print(int(var_w)) |
Arithmetic calculation | Given that a pencil case with 14 identical pencils weighs 11.14 kilograms (kg). When the empty pencil case weighs 0.5 kilograms (kg), how many kilograms (kg) does one pencil weigh? | 0.76 | 11.14 0.5 [OP_SUB] 14 [OP_DIV] | var_a = 11.14
var_b = 0.5
var_c = var_a - var_b
var_d = 14
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Comparison | Minyoung, Yujeong, and Eunji each have marbles. Minyoung has 4 marbles, Yujeong has 2, and Minyoung has 1 less marble than Eunji. Who has the largest number of marbles? | Eunji | [OP_LIST_SOL] Minyoung Yujeong Eunji [OP_LIST_EOL] [OP_LIST_SOL] 4 2 4 1 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Minyoung'
var_b = 'Yujeong'
var_c = 'Eunji'
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 = 4
var_e = 2
var_f = 4
var_g = 1
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)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
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 | Taehyung is 17 years younger than Taehyung's uncle. Four years later, the sum of the ages of uncle and Taehyung is 43. How old is Taehyung this year? | 9 | 43 4 2 [OP_MUL] [OP_SUB] 17 [OP_SUB] 2 [OP_DIV] | var_a = 43
var_b = 4
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 17
var_g = var_e - var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i)) |
Comparison | There are numbers 0.1, 0.8, 1/2, and 0.9. Find the sum of all numbers less than or equal to 0.3. | 0.1 | [OP_LIST_SOL] 0.1 0.8 1/2 0.9 [OP_LIST_EOL] 0.3 [OP_LIST_LESS_EQUAL] [OP_LIST_SUM] | var_a = 0.1
var_b = 0.8
var_c = 0.5
var_d = 0.9
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 = 0.3
list_b = []
for i in list_a:
if i <= var_e:
list_b.append(i)
list_b = [float(i) for i in list_b]
var_f = sum(list_b)
print('{:.2f}'.format(round(var_f+1e-10,2))) |
Possibility | There are 5 interviewers. How many possible situations are there if you choose 3 of them to pass? | 10 | 5 3 [OP_COMB] | var_a = 5
var_b = 3
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
var_c = var_c * (var_a-i)
for i, elem in enumerate(range(var_b)):
var_c = var_c / (i+1)
print(int(var_c)) |
Correspondence | 193 is a result of a particular number plus 71. What will the result be when you subtract 108 from that particular number? | 14 | 193 71 [OP_SUB] 108 [OP_SUB] | var_a = 193
var_b = 71
var_c = var_a - var_b
var_d = 108
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | Find the largest 4-digit number that is a common multiple of 3 and 5. | 9990 | 1000 9999 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX] | var_a = 1000
var_b = 9999
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]
print(int(var_g)) |
Correspondence | A4+B82=216. What number is A, where A is one-digit number? | 3 | A4+B82=216 A [OP_DIGIT_UNK_SOLVER] | var_a = 'A4+B82=216'
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)) |
Possibility | There is a four-digit number that can be formed using four different numbers from the five numbers 5, 0, 1, 8, and 7. If this number is the 3rd smallest number, what is this number? | 1075 | [OP_LIST_SOL] 5 0 1 8 7 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 3 [OP_LIST_MIN] | var_a = 5
var_b = 0
var_c = 1
var_d = 8
var_e = 7
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 = 3
list_c=list_b.copy()
list_c.sort()
var_h = list_c[var_g-1]
print(int(var_h)) |
Possibility | Find the number of ways to put three people A, B, and C in a line. | 6 | [OP_LIST_SOL] A B C [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] | var_a = 'A'
var_b = 'B'
var_c = '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 = len(list_a)
var_e = len(list_a)
var_f = 1
var_d = int(var_d)
var_e = int(var_e)
for i, elem in enumerate(range(var_e)):
var_f = var_f * (var_d-i)
print(int(var_f)) |
Geometry | The circumference of a square CD case is 60 centimeters (cm). Find the length of one side of the CD case. | 15 | 60 4 [OP_DIV] | var_a = 60
var_b = 4
var_c = var_a / var_b
print(int(var_c)) |
Possibility | Jungkook has 2 boxes with 3 balls in each. How many balls does Jungkook have? | 6 | 3 2 [OP_MUL] | var_a = 3
var_b = 2
var_c = var_a * var_b
print(int(var_c)) |
Arithmetic calculation | There are 3 cups of juice and 4 cups of milk on the table. How many cups are on the table in total? | 7 | 3 4 [OP_ADD] | var_a = 3
var_b = 4
var_c = var_a + var_b
print(int(var_c)) |
Possibility | How many two-digit numbers can be formed by choosing two different numbers from 4, 5, 6, 7, or 8? | 20 | [OP_LIST_SOL] 4 5 6 7 8 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 4
var_b = 5
var_c = 6
var_d = 7
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 = len(list_b)
print(int(var_g)) |
Correspondence | Hyeji has a ribbon of 6 meters (m) and 30 centimeters (cm). Of these, 3 meters (m) and 7 centimeters (cm) were used in art class, and 84 centimeters (cm) were given to a friend. Find the length of the remaining ribbon in meters (m). | 239 | 6 100 [OP_MUL] 30 [OP_ADD] 84 [OP_SUB] 3 100 [OP_MUL] 7 [OP_ADD] [OP_SUB] | var_a = 6
var_b = 100
var_c = var_a * var_b
var_d = 30
var_e = var_c + var_d
var_f = 84
var_g = var_e - var_f
var_h = 3
var_i = 100
var_j = var_h * var_i
var_k = 7
var_l = var_j + var_k
var_m = var_g - var_l
print(int(var_m)) |
Possibility | There are 4 types of fruit on sale. If you could only choose 3 to buy, how many combinations could there be? | 4 | 4 3 [OP_COMB] | var_a = 4
var_b = 3
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
var_c = var_c * (var_a-i)
for i, elem in enumerate(range(var_b)):
var_c = var_c / (i+1)
print(int(var_c)) |
Possibility | There are five number cards 1, 3, 5, 7, and 9. What is the average of the 3-digit natural numbers that can be made using this card that are greater than 500? (However, the card can be used repeatedly.) | 755 | [OP_LIST_SOL] 1 3 5 7 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PRODUCT] 500 [OP_LIST_MORE] [OP_LIST_MEAN] | 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)
list_c = [float(i) for i in list_c]
var_h = sum(list_c)/len(list_c)
print(int(var_h)) |
Comparison | Dongkyun is taller than Jungkook, and Dongwook is taller than Jungkook. Comparing the heights of Dongwook and Dongkyun, if Dongwook is shorter, who is the tallest? | Dongkyun | [OP_LIST_SOL] Dongkyun Jungkook Dongwook [OP_LIST_EOL] [OP_LIST_SOL] Dongkyun Jungkook > Dongwook Jungkook > Dongwook Dongkyun < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET] | var_a = 'Dongkyun'
var_b = 'Jungkook'
var_c = 'Dongwook'
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 = 'Dongkyun'
var_e = 'Jungkook'
var_f = '>'
var_g = 'Dongwook'
var_h = 'Jungkook'
var_i = '>'
var_j = 'Dongwook'
var_k = 'Dongkyun'
var_l = '<'
list_b= []
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)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
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_m = 1
var_n = list_c[var_m-1]
print(var_n) |
Arithmetic calculation | 16 liters (L) of beverage was equally divided into 6 bottles. How many people can drink the beverage in one bottle if you share it with your friends by 4/15 liters (L)? | 10 | 16 6 [OP_DIV] 4/15 [OP_DIV] | var_a = 16
var_b = 6
var_c = var_a / var_b
var_d = 0.26666666666666666
var_e = var_c / var_d
print(int(var_e)) |
Possibility | We are going to use 2 of our 3 number cards 2, 4, 5 to create a two-digit number. How many numbers can be made that are both divisible by 2 and 3? | 3 | [OP_LIST_SOL] 2 4 5 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 2 [OP_LIST_DIVISIBLE] 3 [OP_LIST_DIVISIBLE] [OP_SET_INTERSECT] [OP_LIST_LEN] | var_a = 2
var_b = 4
var_c = 5
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 = 2
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 = []
var_e = int(var_e)
for i in list_b:
i = int(i)
if i % var_e == 0:
list_c.append(i)
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 = len(list_e)
print(int(var_g)) |
Comparison | It is 1.6 kilometers (km) from school to Yoongi's house and 2.6 kilometers (km) to Minyoung's house. Whose home is further from school? | Minyoung | [OP_LIST_SOL] Yoongi Minyoung [OP_LIST_EOL] [OP_LIST_SOL] 1.6 2.6 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Yoongi'
var_b = 'Minyoung'
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 = 1.6
var_d = 2.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]
var_g = list_b.index(var_f)+1
var_h = list_a[var_g-1]
print(var_h) |
Arithmetic calculation | When there is six number cards 0, 1, 3, 5, 7, and 9, write down the smallest six-digit number you can make rounding up to the thousandth place. | 104000 | [OP_LIST_SOL] 0 1 3 5 7 9 [OP_LIST_EOL] 6 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] 4 [OP_CEIL] | var_a = 0
var_b = 1
var_c = 3
var_d = 5
var_e = 7
var_f = 9
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 = 6
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_g))
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_h = 1
list_c=list_b.copy()
list_c.sort()
var_i = list_c[var_h-1]
var_j = 4
var_k=int(((var_i+9*10**(var_j-2))//(10**(var_j-1)))*10**(var_j-1))
print(int(var_k)) |
Geometry | Find the area of a triangle with a base of 25 centimeters (cm) and a height of 16 centimeters (cm). | 200 | 25 16 [OP_MUL] 2 [OP_DIV] | var_a = 25
var_b = 16
var_c = var_a * var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e)) |
Arithmetic calculation | Which three-digit number is the smallest common multiple of 6, 5, 8, and 9? | 360 | 100 999 1 [OP_LIST_ARANGE] 6 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 9 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN] | 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 = 6
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 = 8
list_d = []
var_f = int(var_f)
for i in list_c:
i = int(i)
if i % var_f == 0:
list_d.append(i)
var_g = 9
list_e = []
var_g = int(var_g)
for i in list_d:
i = int(i)
if i % var_g == 0:
list_e.append(i)
var_h = 1
list_f=list_e.copy()
list_f.sort()
var_i = list_f[var_h-1]
print(int(var_i)) |
Arithmetic calculation | A car that is 30 meters (m) away from the house travels at 1 meter (m) per hour, and a car 20 meters (m) from the house travels at 0.5 meters (m) per hour. Find the distance to the house from the cars when the two cars meet. | 10 | 30 30 20 [OP_SUB] 1 0.5 [OP_SUB] [OP_DIV] [OP_SUB] | var_a = 30
var_b = 30
var_c = 20
var_d = var_b - var_c
var_e = 1
var_f = 0.5
var_g = var_e - var_f
var_h = var_d / var_g
var_i = var_a - var_h
print(int(var_i)) |
Comparison | Taehyung, Minjoo, Sangmin, Yoonjung, and Yoojung crossed the finish line in order. Who came in first? | Taehyung | [OP_LIST_SOL] Taehyung Minju Sangmin Yoonjeong Yoojeong [OP_LIST_EOL] 1 [OP_LIST_GET] | var_a = 'Taehyung'
var_b = 'Minju'
var_c = 'Sangmin'
var_d = 'Yoonjeong'
var_e = 'Yoojeong'
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 | The red car is in the 19th row from the left, 16th row from the right, 14th row from the front and 11th row from the back. If the number of cars in each row is the same, how many cars are there in all? | 816 | 19 16 [OP_ADD] 1 [OP_SUB] 14 11 [OP_ADD] 1 [OP_SUB] [OP_MUL] | var_a = 19
var_b = 16
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 14
var_g = 11
var_h = var_f + var_g
var_i = 1
var_j = var_h - var_i
var_k = var_e * var_j
print(int(var_k)) |
Arithmetic calculation | I'm trying to find a four-digit number that is divisible by 3 and 4 and has a remainder of 4 when divided by 5. How many four-digit numbers can you make? | 150 | 1000 9999 1 [OP_LIST_ARANGE] 3 4 [OP_LCM] [OP_LIST_DIVISIBLE] 5 4 [OP_LIST_DIVIDE_AND_REMAIN] [OP_LIST_LEN] | var_a = 1000
var_b = 9999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
var_e = 4
var_f = var_e * var_d / math.gcd(int(var_e), int(var_d))
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 = 5
var_h = 4
list_c = []
var_g = int(var_g)
var_h = int(var_h)
if var_h < 0:
var_h = var_h + var_g
for i in list_b:
i = int(i)
if i%var_g == var_h:
list_c.append(i)
var_i = len(list_c)
print(int(var_i)) |
Comparison | Minyoung jumped rope 52 times today, and yesterday she skipped 19 times less than today. Yoojung jumped rope 18 times today, and yesterday she skipped 21 times more than today. Who jumped more rope yesterday? | Yoojung | [OP_LIST_SOL] Minyoung Yoojung [OP_LIST_EOL] [OP_LIST_SOL] 52 19 [OP_SUB] 18 21 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Minyoung'
var_b = 'Yoojung'
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 = 52
var_d = 19
var_e = var_c - var_d
var_f = 18
var_g = 21
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) |
Possibility | When making a two-digit natural number by drawing two of the number cards 1, 3, 7, and 8, find the number of natural numbers less than 40. | 6 | [OP_LIST_SOL] 1 3 7 8 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 40 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN] | var_a = 1
var_b = 3
var_c = 7
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 = 2
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 = 40
list_c = []
for i in list_b:
if i <= var_f:
list_c.append(i)
var_g = len(list_c)
print(int(var_g)) |
Comparison | A total of 20 students are running a race. 11 students reached the finish line before Yoongi. How many students came later than Yoongi? | 8 | 20 11 [OP_SUB] 1 [OP_SUB] | var_a = 20
var_b = 11
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | We have the expression 632-A9B=41. Find out the number that must go into A. | 5 | 632-A9B=41 A [OP_DIGIT_UNK_SOLVER] | var_a = '632-A9B=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)) |
Correspondence | Some numbers are divisors of 69 minus 5 and are also divisors of 86 minus 6. Find the largest of any possible number. | 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)) |
Geometry | When several disks with a radius of 5 centimeters (cm) were stacked, the height is 3 centimeters (cm) longer than the radius. What is the volume of this cylinder in cubic centimeters (cm3)? However, the ratio of the circumference of a circle to its diameter is calculated as 3.14. | 628 | 5 5 [OP_MUL] 3.14 [OP_MUL] 5 3 [OP_ADD] [OP_MUL] | var_a = 5
var_b = 5
var_c = var_a * var_b
var_d = 3.14
var_e = var_c * var_d
var_f = 5
var_g = 3
var_h = var_f + var_g
var_i = var_e * var_h
print(int(var_i)) |
Geometry | If there is a table in the shape of a regular tetradecagon, whose sum of all edge lengths is 154 centimeters (cm), what is the length of one corner of the table? | 11 | 154 14 [OP_DIV] | var_a = 154
var_b = 14
var_c = var_a / var_b
print(int(var_c)) |
Geometry | The sum of the edges of a prism and pyramid with the same base is 30. Find the number of faces of the prism. | 8 | 30 2 3 [OP_ADD] [OP_DIV] 2 [OP_ADD] | var_a = 30
var_b = 2
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)) |
Geometry | I am trying to draw a diagonal from a vertex of an icosikaipentagon. How many diagonal lines can you draw? | 22 | 25 3 [OP_SUB] | var_a = 25
var_b = 3
var_c = var_a - var_b
print(int(var_c)) |
Arithmetic calculation | Sang-yeon spent 1/4 of the money she had on buying books, and saved 2/3 of the remaining money. If Sang-yeon now has 2,500 won, how much money did she initially have? | 10000 | 2500 1 1/4 [OP_SUB] [OP_DIV] 1 2/3 [OP_SUB] [OP_DIV] | var_a = 2500
var_b = 1
var_c = 0.25
var_d = var_b - var_c
var_e = var_a / var_d
var_f = 1
var_g = 0.6666666666666666
var_h = var_f - var_g
var_i = var_e / var_h
print(int(var_i)) |
Geometry | I drew the largest rhombus in a circle with a radius of 10 centimeters (cm) and then drew a smaller rhombus by connecting the middle of all four sides of the rhombus. What is the area of the small rhombus in cm2 (cm2)? | 100 | 10 10 [OP_MUL] | var_a = 10
var_b = 10
var_c = var_a * var_b
print(int(var_c)) |
Arithmetic calculation | There are a total of 100 radishes and carrots. If there are 24 more radishes than carrots, how many radishes are there? | 62 | 100 24 [OP_SUB] 2 [OP_FDIV] 24 [OP_ADD] | var_a = 100
var_b = 24
var_c = var_a - var_b
var_d = 2
var_e = var_c // var_d
var_f = 24
var_g = var_e + var_f
print(int(var_g)) |
Geometry | You have 25 40-milliliter (ml) paint cans. If 271 milliliters (ml) of paint is left after pouring it into the cube, how many centimeters (cm) is one edge of the cube? | 9 | 40 25 [OP_MUL] 271 [OP_SUB] 1/3 [OP_POW] | var_a = 40
var_b = 25
var_c = var_a * var_b
var_d = 271
var_e = var_c - var_d
var_f = 0.3333333333333333
var_g = var_e ** var_f
print(int(eval('{:.2f}'.format(round(var_g+1e-10,2))))) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.