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 | Find the weight of 11 meters (m) of rebar, weighing 15.3 kilograms (kg) when it's 5 meters (m), in kilograms (kg). | 33.66 | 15.3 5 [OP_DIV] 11 [OP_MUL] | var_a = 15.3
var_b = 5
var_c = var_a / var_b
var_d = 11
var_e = var_c * var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Possibility | If there are 6 students in the class, find how many cases are there to select 1 team leader, 1 manager, and 1 clerk. | 120 | 6 1 1 [OP_ADD] 1 [OP_ADD] [OP_PERM] | var_a = 6
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_a = int(var_a)
var_f = int(var_f)
for i, elem in enumerate(range(var_f)):
var_g = var_g * (var_a-i)
print(int(var_g)) |
Arithmetic calculation | Chanhee goes 0.45 meters (m) for one step. If Chanhee walked for 13 minutes by 90 steps per minute, find how many meters (m) she walked in total. | 526.5 | 0.45 90 [OP_MUL] 13 [OP_MUL] | var_a = 0.45
var_b = 90
var_c = var_a * var_b
var_d = 13
var_e = var_c * var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Arithmetic calculation | Jungkook has 3 red bikes and Yoongi has 4 blue bikes. How many bikes are there in total? | 7 | 3 4 [OP_ADD] | var_a = 3
var_b = 4
var_c = var_a + var_b
print(int(var_c)) |
Arithmetic calculation | Find the number of three-digit numbers from 2 to 355. | 256 | 100 355 1 [OP_LIST_ARANGE] [OP_LIST_LEN] | var_a = 100
var_b = 355
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = len(list_a)
print(int(var_d)) |
Arithmetic calculation | There are 8 people in the company, but there are 5 computers, so they have to take turns using them. If the working day is 2 hours and 32 minutes, how many minutes per person spend on the computer on average? | 95 | 2 60 [OP_MUL] 32 [OP_ADD] 8 [OP_DIV] 5 [OP_MUL] | var_a = 2
var_b = 60
var_c = var_a * var_b
var_d = 32
var_e = var_c + var_d
var_f = 8
var_g = var_e / var_f
var_h = 5
var_i = var_g * var_h
print(int(var_i)) |
Possibility | Write the 3rd smallest number among three-digit numbers that can be made by drawing three different numbers from 4, 0, 9, and 8. | 480 | [OP_LIST_SOL] 4 0 9 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 3 [OP_LIST_MIN] | var_a = 4
var_b = 0
var_c = 9
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 = 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 = 3
list_c=list_b.copy()
list_c.sort()
var_g = list_c[var_f-1]
print(int(var_g)) |
Arithmetic calculation | Eunji opened the book and the sum of the two pages was 137. Write the larger of the two pages Eunji has opened. | 69 | 137 2 [OP_FDIV] 1 [OP_ADD] | var_a = 137
var_b = 2
var_c = var_a // var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Comparison | Jungkook has a 0.8 number card, Yoongi has a 1/2 number, and Yoojung has a 0.9 number card. How many people have a number card greater than 0.3? | 3 | [OP_LIST_SOL] 0.8 1/2 0.9 [OP_LIST_EOL] 0.3 [OP_LIST_MORE] [OP_LIST_LEN] | 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 = 0.3
list_b = []
for i in list_a:
if i > var_d:
list_b.append(i)
var_e = len(list_b)
print(int(var_e)) |
Correspondence | When you round the four-digit number 6A42 to the thousands place, it becomes 6000. How many digits from 0 to 9 can be written as A? | 5 | 6A42 [OP_GEN_POSSIBLE_LIST] 6500 [OP_LIST_MORE_EQUAL] 6A42 A [OP_LIST_FIND_UNK] [OP_LIST_LEN] | var_a = '6A42'
ans_dict = dict()
var_a = str(var_a)
list_a = []
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
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]))
if len(var_a) == len(str(int(temp))):
new_elem = int(temp)
list_a.append(new_elem)
var_b = 6500
list_b = []
for i in list_a:
if i >= var_b:
list_b.append(i)
var_c = '6A42'
var_d = 'A'
var_c = str(var_c)
var_d = str(var_d)
unk_idx = var_c.index(var_d)
list_c = []
for elem in list_b:
elem = str(elem)
list_c.append(int(elem[unk_idx]))
list_c = list(set(list_c))
var_e = len(list_c)
print(int(var_e)) |
Comparison | Minji has 0.74 meters (m) of color tape, Seungyeon has 13/20 meters (m), and Hyesu has 4/5 meters (m). Who has the longest colored tape? | Hyesu | [OP_LIST_SOL] Minji Seungyeon Hyesu [OP_LIST_EOL] [OP_LIST_SOL] 0.74 13/20 4/5 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Minji'
var_b = 'Seungyeon'
var_c = 'Hyesu'
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 = 0.74
var_e = 0.65
var_f = 0.8
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 = 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) |
Correspondence | It takes 10 days for an older sister and 20 days for a younger sister to complete a certain task. After the older sister did this task alone for four days, the sisters worked together to finish the task. How many days did the sisters work together? | 4 | 1 4 10 [OP_DIV] [OP_SUB] 1 10 [OP_DIV] 1 20 [OP_DIV] [OP_ADD] [OP_DIV] | var_a = 1
var_b = 4
var_c = 10
var_d = var_b / var_c
var_e = var_a - var_d
var_f = 1
var_g = 10
var_h = var_f / var_g
var_i = 1
var_j = 20
var_k = var_i / var_j
var_l = var_h + var_k
var_m = var_e / var_l
print(int(eval('{:.2f}'.format(round(var_m+1e-10,2))))) |
Correspondence | When you add 14 to a number, you get 56. Find the result of multiplying the number by 3. | 126 | 56 14 [OP_SUB] 3 [OP_MUL] | var_a = 56
var_b = 14
var_c = var_a - var_b
var_d = 3
var_e = var_c * var_d
print(int(var_e)) |
Arithmetic calculation | When A is divided by B, the quotient is 6 and the remainder is 3. A and B are natural numbers. What is the smallest among the divisor B? | 4 | 3 1 [OP_ADD] | var_a = 3
var_b = 1
var_c = var_a + var_b
print(int(var_c)) |
Arithmetic calculation | There are three cups (a), (b), (c) filled with water. The sum of the water in these three cups is 1 liter (L) and 200 milliliters (㎖). If you transfer 200 milliliters (㎖) from cup (c) to cup (b), and 100 milliliters (㎖) from cup (c) to cup (a), the amount of water in the three cups becomes the same. Find the amount of water that was initially contained in the cup (a). | 300 | 1 1000 [OP_MUL] 200 [OP_ADD] 200 [OP_SUB] 100 [OP_SUB] 3 [OP_DIV] | var_a = 1
var_b = 1000
var_c = var_a * var_b
var_d = 200
var_e = var_c + var_d
var_f = 200
var_g = var_e - var_f
var_h = 100
var_i = var_g - var_h
var_j = 3
var_k = var_i / var_j
print(int(var_k)) |
Arithmetic calculation | Find the second smallest odd number from 1 to 10. | 3 | 1 10 [OP_LIST_ODD] 2 [OP_LIST_MIN] | var_a = 1
var_b = 10
list_a = []
if var_a%2==0:
for i in range(var_a+1, var_b+1, 2):
list_a.append(i)
else:
for i in range(var_a, var_b+1, 2):
list_a.append(i)
var_c = 2
list_b=list_a.copy()
list_b.sort()
var_d = list_b[var_c-1]
print(int(var_d)) |
Comparison | Five balls (a), (b), (c), (d), and (e) are placed side by side. (e) is placed to the right of (c), and (e) is placed to the left of (d). Also, (c) is on the right side of (a), and (d) is on the left side of (b). Which ball is placed to the far left? | (a) | [OP_LIST_SOL] (a) (b) (c) (d) (e) [OP_LIST_EOL] [OP_LIST_SOL] (e) (c) > (e) (d) < (c) (a) > (d) (b) < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | 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 = '(e)'
var_g = '(c)'
var_h = '>'
var_i = '(e)'
var_j = '(d)'
var_k = '<'
var_l = '(c)'
var_m = '(a)'
var_n = '>'
var_o = '(d)'
var_p = '(b)'
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 = len(list_c)
var_s = list_c[var_r-1]
print(var_s) |
Comparison | Three students pulled marbles with numbers from their pockets. The marble that Jungkook picked has a 7 written on it, and the marble that Minyoung picked has a 5 written on it. Taehyung's number of marble is greater than Minyoung's but less than Jungkook's. What is the number of marble Taehyung has? | 6 | 5 7 [OP_ADD] 2 [OP_FDIV] | var_a = 5
var_b = 7
var_c = var_a + var_b
var_d = 2
var_e = var_c // var_d
print(int(var_e)) |
Arithmetic calculation | Find the greatest possible two-digit number that is common multiple of 3 and 5. | 90 | 10 99 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX] | 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]
print(int(var_g)) |
Arithmetic calculation | The total weight of 9 apples of the same weight is 4.5 kilograms (kg). Several melons weighing 850 grams (g) and two apples were placed on one side of the pan balance scale, and five watermelons weighing 1050 grams (g) were placed on the other side, and they were level. How many melons are there? | 5 | 1050 5 [OP_MUL] 4.5 1000 [OP_MUL] 9 [OP_DIV] 2 [OP_MUL] [OP_SUB] 850 [OP_DIV] | var_a = 1050
var_b = 5
var_c = var_a * var_b
var_d = 4.5
var_e = 1000
var_f = var_d * var_e
var_g = 9
var_h = var_f / var_g
var_i = 2
var_j = var_h * var_i
var_k = var_c - var_j
var_l = 850
var_m = var_k / var_l
print(int(var_m)) |
Possibility | We want to create a four-digit number by using all single-digit odd numbers greater than 1 once. Find the sum of the possible numbers. | 159984 | 1 1 [OP_ADD] 9 [OP_LIST_ODD] 4 [OP_LIST_GET_PERM] [OP_LIST_SUM] | var_a = 1
var_b = 1
var_c = var_a + var_b
var_d = 9
list_a = []
if var_c%2==0:
for i in range(var_c+1, var_d+1, 2):
list_a.append(i)
else:
for i in range(var_c, var_d+1, 2):
list_a.append(i)
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]
list_b = [float(i) for i in list_b]
var_f = sum(list_b)
print(int(var_f)) |
Arithmetic calculation | There are three numbers 10, 11, and 12. What is the quotient of the largest number divided by the second largest number? | 1 | [OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MAX] [OP_FDIV] | 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]
var_f = 2
list_c=list_a.copy()
list_c.sort()
var_g = list_c[-var_f]
var_h = var_e // var_g
print(int(var_h)) |
Arithmetic calculation | There are four friends, Soohyun, Kiyoon, Taehun, and Hwajun. Kiyoon is 207 millimeters (mm) taller than Soohyun. Taehun is 252 millimeters (mm) taller than Soohyun. Hwajun is 839 millimeters (mm) taller than Kiyoon. How many millimeters (mm) is the difference in height between Soohyun and Hwajun? | 1046 | 207 839 [OP_ADD] | var_a = 207
var_b = 839
var_c = var_a + var_b
print(int(var_c)) |
Possibility | If there are 5 people A, B, C, D, E, find the number of ways to select 1 president and 1 vice president. | 20 | 5 1 1 [OP_ADD] [OP_PERM] | var_a = 5
var_b = 1
var_c = 1
var_d = var_b + var_c
var_e = 1
var_a = int(var_a)
var_d = int(var_d)
for i, elem in enumerate(range(var_d)):
var_e = var_e * (var_a-i)
print(int(var_e)) |
Comparison | Seulgi is 159 centimeters (cm) tall and Hohyeon is 162 centimeters (cm) tall. Which of the two is taller? | Hohyeon | [OP_LIST_SOL] Seulgi Hohyeon [OP_LIST_EOL] [OP_LIST_SOL] 159 162 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Seulgi'
var_b = 'Hohyeon'
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 = 159
var_d = 162
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) |
Comparison | At school, students take turns giving presentations. Eunjung was in sixth place, followed by seven students. How many students are there in total? | 13 | 6 7 [OP_ADD] | var_a = 6
var_b = 7
var_c = var_a + var_b
print(int(var_c)) |
Comparison | Shinyoung read 1/3 of the children's book, Seokgi 1/4, and Woong 1/5. Who has read the most of the children's book? | Shinyoung | [OP_LIST_SOL] Shinyoung Seokgi Woong [OP_LIST_EOL] [OP_LIST_SOL] 1/3 1/4 1/5 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Shinyoung'
var_b = 'Seokgi'
var_c = 'Woong'
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 = 0.3333333333333333
var_e = 0.25
var_f = 0.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 = 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 | The 20 students in Heesun's class have their own attendance numbers ranging from 1 to 20. Among the students in Heesun's class, the female students numbers are 1, 3, 4, 6, 7, 10, 11, 13, 16, 17, 18, and 20, and the student who is an only child is numbered 1, 4, 5, 8, 11, 14, 17 and 20. Find out the number of students who are female and at the same time, an only child. | 5 | [OP_LIST_SOL] 1 3 4 6 7 10 11 13 16 17 18 20 [OP_LIST_EOL] [OP_LIST_SOL] 1 4 5 8 11 14 17 20 [OP_LIST_EOL] [OP_SET_INTERSECT] [OP_LIST_LEN] | var_a = 1
var_b = 3
var_c = 4
var_d = 6
var_e = 7
var_f = 10
var_g = 11
var_h = 13
var_i = 16
var_j = 17
var_k = 18
var_l = 20
list_a= []
if "/" in str(var_l):
var_l = eval(str(var_l))
list_a.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_a.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_a.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_a.append(var_i)
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_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_m = 1
var_n = 4
var_o = 5
var_p = 8
var_q = 11
var_r = 14
var_s = 17
var_t = 20
list_b= []
if "/" in str(var_t):
var_t = eval(str(var_t))
list_b.append(var_t)
if "/" in str(var_s):
var_s = eval(str(var_s))
list_b.append(var_s)
if "/" in str(var_r):
var_r = eval(str(var_r))
list_b.append(var_r)
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)
list_b.reverse()
list_c = list(set(list_a) & set(list_b))
var_u = len(list_c)
print(int(var_u)) |
Possibility | If three of 3, 5, 8, and 9 are drawn to form a three-digit natural number, how many possible numbers are there? | 24 | [OP_LIST_SOL] 3 5 8 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 3
var_b = 5
var_c = 8
var_d = 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 = 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 | The transparent bottle contains 12 liters (L) and 400 milliliters (ml) of water, and the opaque bottle contains 7600 milliliters (ml) of water. How many liters (l) must be transferred from the transparent bottle to the opaque bottle to equalize the volume of water in the two bottles? | 2.4 | 12 400 1000 [OP_DIV] [OP_ADD] 7600 1000 [OP_DIV] [OP_SUB] 2 [OP_DIV] | var_a = 12
var_b = 400
var_c = 1000
var_d = var_b / var_c
var_e = var_a + var_d
var_f = 7600
var_g = 1000
var_h = var_f / var_g
var_i = var_e - var_h
var_j = 2
var_k = var_i / var_j
print('{:.2f}'.format(round(var_k+1e-10,2))) |
Correspondence | A+B=84 and B+C=60 and A=B+B+B+B+B+B. Find A-C when A, B, and C are three different natural numbers. | 24 | 84 7 [OP_DIV] 6 [OP_MUL] 60 84 7 [OP_DIV] [OP_SUB] [OP_SUB] | var_a = 84
var_b = 7
var_c = var_a / var_b
var_d = 6
var_e = var_c * var_d
var_f = 60
var_g = 84
var_h = 7
var_i = var_g / var_h
var_j = var_f - var_i
var_k = var_e - var_j
print(int(var_k)) |
Arithmetic calculation | Junhoe had a wire measuring 134.5 cm (cm). If the length of Yujin's wire was 1.06 times the length of Junhoe's wire, how many centimeters (cm) long is Yujin's wire? | 142.57 | 134.5 1.06 [OP_MUL] | var_a = 134.5
var_b = 1.06
var_c = var_a * var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Comparison | There are 17 more adults on the train compared to the children. At the next station, 57 adults and 18 children got on and 44 got off. How many adults were on the train initially, provided there are 502 people on the train now? | 244 | 502 18 57 [OP_ADD] 44 [OP_SUB] [OP_SUB] 17 [OP_ADD] 2 [OP_DIV] | var_a = 502
var_b = 18
var_c = 57
var_d = var_b + var_c
var_e = 44
var_f = var_d - var_e
var_g = var_a - var_f
var_h = 17
var_i = var_g + var_h
var_j = 2
var_k = var_i / var_j
print(int(var_k)) |
Possibility | Find the second smallest number using all 0, 2, 4, 6, 8, and 9 cards only once. | 204698 | [OP_LIST_SOL] 0 2 4 6 8 9 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 2 [OP_LIST_MIN] | var_a = 0
var_b = 2
var_c = 4
var_d = 6
var_e = 8
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 = len(list_a)
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 = 2
list_c=list_b.copy()
list_c.sort()
var_i = list_c[var_h-1]
print(int(var_i)) |
Arithmetic calculation | Find the average of the odd numbers from 1 to 10 that are less than 6. | 3 | 1 10 [OP_LIST_ODD] 6 [OP_LIST_LESS] [OP_LIST_MEAN] | var_a = 1
var_b = 10
list_a = []
if var_a%2==0:
for i in range(var_a+1, var_b+1, 2):
list_a.append(i)
else:
for i in range(var_a, var_b+1, 2):
list_a.append(i)
var_c = 6
list_b = []
for i in list_a:
if i < var_c:
list_b.append(i)
list_b = [float(i) for i in list_b]
var_d = sum(list_b)/len(list_b)
print(int(var_d)) |
Possibility | Jimin came to the fruit section of the supermarket. In the fruit section, there are three types of fruits, apple, pear, and melon. How many ways are there to buy all 6 fruits with these fruits? | 28 | 3 1 [OP_SUB] 6 [OP_ADD] 6 [OP_COMB] | var_a = 3
var_b = 1
var_c = var_a - var_b
var_d = 6
var_e = var_c + var_d
var_f = 6
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)
for i, elem in enumerate(range(var_f)):
var_g = var_g / (i+1)
print(int(var_g)) |
Arithmetic calculation | Find an even number between 40 and 50 that has a remainder of 2 when divided by 7. | 44 | 40 50 [OP_LIST_EVEN] 7 2 [OP_LIST_DIVIDE_AND_REMAIN] [OP_LIST_SUM] | var_a = 40
var_b = 50
list_a = []
if var_a%2!=0:
for i in range(var_a+1, var_b+1, 2):
list_a.append(i)
else:
for i in range(var_a, var_b+1, 2):
list_a.append(i)
var_c = 7
var_d = 2
list_b = []
var_c = int(var_c)
var_d = int(var_d)
if var_d < 0:
var_d = var_d + var_c
for i in list_a:
i = int(i)
if i%var_c == var_d:
list_b.append(i)
list_b = [float(i) for i in list_b]
var_e = sum(list_b)
print(int(var_e)) |
Geometry | There is a perimeter of 210 centimeters (m) round ring made by connecting 12 sheets of paper tape whose length is 18 centimeters (cm). If the overlapped parts of the tape is the same, find how much is overlapped in millimeters (mm). | 5 | 18 12 [OP_MUL] 210 [OP_SUB] 12 [OP_DIV] 10 [OP_MUL] | var_a = 18
var_b = 12
var_c = var_a * var_b
var_d = 210
var_e = var_c - var_d
var_f = 12
var_g = var_e / var_f
var_h = 10
var_i = var_g * var_h
print(int(var_i)) |
Arithmetic calculation | Find the difference between the sum of all even numbers and the sum of all odd numbers from 1 to 100. | 50 | 1 100 [OP_LIST_EVEN] [OP_LIST_SUM] 1 100 [OP_LIST_ODD] [OP_LIST_SUM] [OP_SUB] | var_a = 1
var_b = 100
list_a = []
if var_a%2!=0:
for i in range(var_a+1, var_b+1, 2):
list_a.append(i)
else:
for i in range(var_a, var_b+1, 2):
list_a.append(i)
list_a = [float(i) for i in list_a]
var_c = sum(list_a)
var_d = 1
var_e = 100
list_b = []
if var_d%2==0:
for i in range(var_d+1, var_e+1, 2):
list_b.append(i)
else:
for i in range(var_d, var_e+1, 2):
list_b.append(i)
list_b = [float(i) for i in list_b]
var_f = sum(list_b)
var_g = var_c - var_f
print(int(var_g)) |
Possibility | There is 1 white hat and 4 indistinguishable black hats. How many different ways can you arrange these hats in a row? | 5 | 4 1 [OP_ADD] | var_a = 4
var_b = 1
var_c = var_a + var_b
print(int(var_c)) |
Comparison | We had a swimming competition in the pool. 2nd place is Namjoon, 4th place is Yoongi. Hoseok was slower than Namjoon and faster than Yoongi. What is the rank of Hoseok? | 3 | 2 4 [OP_ADD] 2 [OP_FDIV] | var_a = 2
var_b = 4
var_c = var_a + var_b
var_d = 2
var_e = var_c // var_d
print(int(var_e)) |
Arithmetic calculation | All seven boxes of apples contain the same weight of apples. After taking out 20 kilograms (kg) of apples from each box, the weight of the seven apple boxes was equal to the weight of the first three apple boxes. Find the weight of the first box of apples. | 35 | 20 7 [OP_MUL] 7 3 [OP_SUB] [OP_DIV] | var_a = 20
var_b = 7
var_c = var_a * var_b
var_d = 7
var_e = 3
var_f = var_d - var_e
var_g = var_c / var_f
print(int(var_g)) |
Possibility | Find the difference between the second smallest three-digit number and the third smallest three-digit number using all number cards 1, 6, and 8 once. | 432 | [OP_LIST_SOL] 1 6 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 [OP_LIST_MIN] 3 [OP_LIST_GET] [OP_SUB] [OP_ABS] | 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
var_h = list_b[var_g-1]
var_i = var_f - var_h
var_j = abs(var_i)
print(int(var_j)) |
Correspondence | There are two different numbers: A and B. Find A from the two-digit addition formula of A7+3B=73. | 3 | A7+3B=73 A [OP_DIGIT_UNK_SOLVER] | var_a = 'A7+3B=73'
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 | There are four numbers 0.8, 1/2, 0.9, and 1/3. Which number is the greatest among the numbers that are smaller than or equal to 3? | 0.9 | [OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 3 [OP_LIST_LESS_EQUAL] 1 [OP_LIST_MAX] | var_a = 0.8
var_b = 0.5
var_c = 0.9
var_d = 0.3333333333333333
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 = []
for i in list_a:
if i <= var_e:
list_b.append(i)
var_f = 1
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Correspondence | I mistakenly added 267 which should have subtracted from a number, and I got 821. Find out how much it is if you calculate it correctly. | 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)) |
Arithmetic calculation | If a pencil sold at a store is 200 won more expensive than 5,000 won, find the price of the pencil in units of 10,000 won. | 0.52 | 5000 200 [OP_ADD] 10000 [OP_DIV] | var_a = 5000
var_b = 200
var_c = var_a + var_b
var_d = 10000
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Geometry | There is a pyramid with an octagonal base. How many sides are there? | 8 | 8 | var_a = 8
print(int(var_a)) |
Comparison | When 20 students stood in a line, Jungkook is the last, and there are 5 students between Yoongi and Jungkook. How many students are standing behind Yoongi? | 6 | 20 20 [OP_SUB] 1 [OP_ADD] 5 [OP_ADD] | var_a = 20
var_b = 20
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
var_f = 5
var_g = var_e + var_f
print(int(var_g)) |
Comparison | In the math test, Jungkook placed the 5th, and Kwangsoo placed the 3rd. If Mijoo had a higher score than Jungkook, but a lower score than Kwangsoo, what rank would Mijoo be? | 4 | 5 3 [OP_ADD] 2 [OP_FDIV] | var_a = 5
var_b = 3
var_c = var_a + var_b
var_d = 2
var_e = var_c // var_d
print(int(var_e)) |
Correspondence | What is the value of D among the four different numbers A, B, C, and D that satisfy A+A=6, B-A=4, C+B=9, and D-C=7? | 9 | A+A=6 A [OP_NUM_UNK_SOLVER] 4 [OP_ADD] 9 [OP_SUB] 7 [OP_SUB] -1 [OP_MUL] | var_a = 'A+A=6'
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]
var_d = 4
var_e = var_c + var_d
var_f = 9
var_g = var_e - var_f
var_h = 7
var_i = var_g - var_h
var_j = -1
var_k = var_i * var_j
print(int(var_k)) |
Possibility | When 6 people including A and B are lined up, in how many ways can A and B be lined up next to each other? | 240 | 6 [OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_LEN] 1 [OP_SUB] [OP_SUB] 6 [OP_LIST_LEN] 1 [OP_SUB] [OP_SUB] [OP_PERM] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_MUL] | var_a = 6
var_b = 'A'
var_c = 'B'
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)
list_a.reverse()
var_d = len(list_a)
var_e = 1
var_f = var_d - var_e
var_g = var_a - var_f
var_h = 6
var_i = len(list_a)
var_j = 1
var_k = var_i - var_j
var_l = var_h - var_k
var_m = 1
var_g = int(var_g)
var_l = int(var_l)
for i, elem in enumerate(range(var_l)):
var_m = var_m * (var_g-i)
var_n = len(list_a)
var_o = len(list_a)
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_m * var_p
print(int(var_q)) |
Correspondence | When Minyoung sells 2 tangerines and 7 apples, how many fruits does Minyoung sell? | 9 | 2 7 [OP_ADD] | var_a = 2
var_b = 7
var_c = var_a + var_b
print(int(var_c)) |
Comparison | Minsu gave 30 notebooks to Jaehyuk, Kyunghwan, and Jaeho. Jaehyeok received 12 notebooks, Kyunghwan received 3 notebooks, and Jaeho received 15 notebooks. Which friend got the most notebooks? | Jaeho | [OP_LIST_SOL] Jaehyuk Kyunghwan Jaeho [OP_LIST_EOL] [OP_LIST_SOL] 12 3 15 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Jaehyuk'
var_b = 'Kyunghwan'
var_c = 'Jaeho'
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 = 12
var_e = 3
var_f = 15
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 = 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) |
Possibility | Find the difference between the third largest four-digit number and the fourth largest four-digit number that can be formed by using the numbers 2, 4, 6, and 8 once each. | 36 | [OP_LIST_SOL] 2 4 6 8 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 3 [OP_LIST_MAX] 4 [OP_LIST_MAX] [OP_SUB] | var_a = 2
var_b = 4
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 = 3
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
var_h = 4
list_d=list_b.copy()
list_d.sort()
var_i = list_d[-var_h]
var_j = var_g - var_i
print(int(var_j)) |
Arithmetic calculation | The average score for Korean and English tests is 92 points, and the average score rises by 2 points when math scores are also considered. What is the score for the math test? | 98 | 92 2 [OP_ADD] 3 [OP_MUL] 92 2 [OP_MUL] [OP_SUB] | var_a = 92
var_b = 2
var_c = var_a + var_b
var_d = 3
var_e = var_c * var_d
var_f = 92
var_g = 2
var_h = var_f * var_g
var_i = var_e - var_h
print(int(var_i)) |
Geometry | What is the length of one side of a regular hexagon with a perimeter of 43.56 centimeters (cm)? | 7.26 | 43.56 6 [OP_DIV] | var_a = 43.56
var_b = 6
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Geometry | The area of one side of a die is 64 square centimeters (cm2). Find the volume of this die. | 512 | 64 1/2 [OP_POW] 3 [OP_POW] | var_a = 64
var_b = 0.5
var_c = var_a ** var_b
var_d = 3
var_e = var_c ** var_d
print(int(var_e)) |
Possibility | Find the number of numbers less than 500 among three digit numbers where each digit is a odd number. | 50 | 1 9 [OP_LIST_ODD] 3 [OP_LIST_GET_PRODUCT] 500 [OP_LIST_LESS] [OP_LIST_LEN] | var_a = 1
var_b = 9
list_a = []
if var_a%2==0:
for i in range(var_a+1, var_b+1, 2):
list_a.append(i)
else:
for i in range(var_a, var_b+1, 2):
list_a.append(i)
var_c = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=var_c))
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_d = 500
list_c = []
for i in list_b:
if i < var_d:
list_c.append(i)
var_e = len(list_c)
print(int(var_e)) |
Comparison | Hanul Elementary School has 168 first grade students and 173 second grade students. Find out which grade has more students. | 2 | [OP_LIST_SOL] 1 2 [OP_LIST_EOL] [OP_LIST_SOL] 168 173 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 1
var_b = 2
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 = 168
var_d = 173
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(int(var_h)) |
Geometry | There is a box in the shape of a regular icosahedron. How many edges are there on a face of this box? | 5 | 5 | var_a = 5
print(int(var_a)) |
Geometry | What is the area of a rectangle with a perimeter of 28 centimeters (cm) and a length of 9 centimeters (cm) in square centimeters (cm2)? | 45 | 28 9 2 [OP_MUL] [OP_SUB] 2 [OP_DIV] 9 [OP_MUL] | var_a = 28
var_b = 9
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 2
var_g = var_e / var_f
var_h = 9
var_i = var_g * var_h
print(int(var_i)) |
Possibility | Namhee's birthday is on June 18th. He wants to create a three-digit number using all the numbers from his birthday. Find the difference between the second smallest and third smallest possible numbers. | 432 | [OP_LIST_SOL] 6 1 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 [OP_LIST_MIN] 3 [OP_LIST_MIN] [OP_SUB] [OP_ABS] | var_a = 6
var_b = 1
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
var_j = abs(var_i)
print(int(var_j)) |
Possibility | I'm trying to put 2 dogs and 2 cats in a line. In how many ways can cats stand in a row? | 12 | 2 1 [OP_ADD] 2 1 [OP_ADD] [OP_PERM] 2 [OP_MUL] | var_a = 2
var_b = 1
var_c = var_a + var_b
var_d = 2
var_e = 1
var_f = var_d + var_e
var_g = 1
var_c = int(var_c)
var_f = int(var_f)
for i, elem in enumerate(range(var_f)):
var_g = var_g * (var_c-i)
var_h = 2
var_i = var_g * var_h
print(int(var_i)) |
Correspondence | When A5-2B=68, what number should go into A? | 9 | A5-2B=68 A [OP_DIGIT_UNK_SOLVER] | var_a = 'A5-2B=68'
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 | Subtracting 10 from a certain number results in 15. Hoseok wants to add 5 to the certain number. What value will Hoseok get? | 30 | 15 10 [OP_ADD] 5 [OP_ADD] | var_a = 15
var_b = 10
var_c = var_a + var_b
var_d = 5
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | Ten students in Eunji's class were randomly selected and asked about their heights, which were 145 centimeters (cm), 142 centimeters (cm), 138 centimeters (cm), 136 centimeters (cm), 143 centimeters (cm), 146 centimeters (cm), 138 centimeters (cm), 144 centimeters (cm), 137 centimeters (cm), and 141 centimeters (cm). Find the average height of these students in centimeters (cm). | 141 | [OP_LIST_SOL] 145 142 138 136 143 146 138 144 137 141 [OP_LIST_EOL] [OP_LIST_MEAN] | var_a = 145
var_b = 142
var_c = 138
var_d = 136
var_e = 143
var_f = 146
var_g = 138
var_h = 144
var_i = 137
var_j = 141
list_a= []
if "/" in str(var_j):
var_j = eval(str(var_j))
list_a.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_a.append(var_i)
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_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()
list_a = [float(i) for i in list_a]
var_k = sum(list_a)/len(list_a)
print(int(var_k)) |
Correspondence | Find A when CD+ACD+ABCD=2967. | 2 | [OP_LIST_SOL] CD+ACD+ABCD= 2967 [OP_LIST_EOL] [OP_LIST2NUM] A [OP_DIGIT_UNK_SOLVER] | var_a = 'CD+ACD+ABCD='
var_b = 2967
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=""
for i in list_a:
i = str(i)
var_c = var_c + i
var_d = 'A'
ans_dict = dict()
var_c = var_c.replace('×','*')
var_c = var_c.replace('x','*')
var_c = var_c.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_c):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_c
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_c):
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_e = ans_dict[var_d]
print(int(var_e)) |
Possibility | Seung-a went on a trip to Gangneung with 5 friends and decided a place to stay. If 1 person sleeps in Room A, 1 person in Room B, and 2 people sleep in Room C, find the number of cases in which Seung-a will sleep in Room A. | 12 | 5 1 [OP_SUB] 1 1 1 [OP_SUB] [OP_ADD] 2 [OP_ADD] [OP_PERM] 2 2 [OP_PERM] [OP_DIV] | var_a = 5
var_b = 1
var_c = var_a - var_b
var_d = 1
var_e = 1
var_f = 1
var_g = var_e - var_f
var_h = var_d + var_g
var_i = 2
var_j = var_h + var_i
var_k = 1
var_c = int(var_c)
var_j = int(var_j)
for i, elem in enumerate(range(var_j)):
var_k = var_k * (var_c-i)
var_l = 2
var_m = 2
var_n = 1
var_l = int(var_l)
var_m = int(var_m)
for i, elem in enumerate(range(var_m)):
var_n = var_n * (var_l-i)
var_o = var_k / var_n
print(int(var_o)) |
Arithmetic calculation | There are three numbers 10, 11, and 12. What is the sum of the second-largest number and the smallest number? | 21 | [OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 2 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD] | 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 = 2
list_b=list_a.copy()
list_b.sort()
var_e = list_b[-var_d]
var_f = 1
list_c=list_a.copy()
list_c.sort()
var_g = list_c[var_f-1]
var_h = var_e + var_g
print(int(var_h)) |
Geometry | A rectangular amusement park ticket is 3 centimeters (cm) wide and its area of it is 1.77 square centimeters (cm2). How many centimeters (cm) is the vertical length of this ticket? | 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))) |
Comparison | 20 students are lined up in a single line. 11 students are standing behind Yoongi, and Hoseok is standing right in front of Yoongi. How many students are standing in front of Hoseok? | 7 | 20 11 [OP_SUB] 1 [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
var_f = 1
var_g = var_e - var_f
print(int(var_g)) |
Arithmetic calculation | Ji-yeon wants to exchange 170,000 won in Korean money in 1,000 yuan and 10 yuan in Chinese money. After changing all the money that can be exchanged for 1000 yuan bills, if you want to exchange the remaining money for 10 yuan bills, and 161.5 won of Korean money is 1 yuan of Chinese money, how many 10 yuan bills can you get? | 5 | 17 10000 [OP_MUL] 161.5 1000 [OP_MUL] [OP_MOD] 161.5 10 [OP_MUL] [OP_FDIV] | var_a = 17
var_b = 10000
var_c = var_a * var_b
var_d = 161.5
var_e = 1000
var_f = var_d * var_e
var_g = var_c % var_f
var_h = 161.5
var_i = 10
var_j = var_h * var_i
var_k = var_g // var_j
print(int(var_k)) |
Comparison | Yesterday, Wonhee slept 10 hours and 9/10 hours, and Dong-il slept 102/10 hours. Find out who slept the longest. | Wonhee | [OP_LIST_SOL] Wonhee Dong-il [OP_LIST_EOL] [OP_LIST_SOL] 10 9/10 [OP_ADD] 102/10 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Wonhee'
var_b = 'Dong-il'
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 = 0.9
var_e = var_c + var_d
var_f = 10.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)
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) |
Geometry | There are hexagonal prisms and quadrangular pyramids with the same length of one edge. The sum of the lengths of all edges of a hexagonal prism is 81 meters (m), and all edges are the same length. Find the sum of the lengths of all the edges of the quadrangular pyramid, in meters (m), when all the edges of the quadrangular pyramid are the same length. | 36 | 81 6 3 [OP_MUL] [OP_DIV] 4 2 [OP_MUL] [OP_MUL] | var_a = 81
var_b = 6
var_c = 3
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
print(int(var_i)) |
Possibility | In a situation where 6 people including Kihoon and Sangwoo are lined up, find the number of cases in which Kihoon and Sangwoo are lined up next to each other. | 240 | 6 [OP_LIST_SOL] Kihoon Sangwoo [OP_LIST_EOL] [OP_LIST_LEN] 1 [OP_SUB] [OP_SUB] 6 [OP_LIST_LEN] 1 [OP_SUB] [OP_SUB] [OP_PERM] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_MUL] | var_a = 6
var_b = 'Kihoon'
var_c = 'Sangwoo'
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)
list_a.reverse()
var_d = len(list_a)
var_e = 1
var_f = var_d - var_e
var_g = var_a - var_f
var_h = 6
var_i = len(list_a)
var_j = 1
var_k = var_i - var_j
var_l = var_h - var_k
var_m = 1
var_g = int(var_g)
var_l = int(var_l)
for i, elem in enumerate(range(var_l)):
var_m = var_m * (var_g-i)
var_n = len(list_a)
var_o = len(list_a)
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_m * var_p
print(int(var_q)) |
Correspondence | The math average of the Woojoo's class was 42, but when the Woojoo's score was re-scored and raised to 50, the class average was 44. If there are 10 students in Woojoo's classes, what Woojoo initially received? | 30 | 50 44 42 [OP_SUB] 10 [OP_MUL] [OP_SUB] | var_a = 50
var_b = 44
var_c = 42
var_d = var_b - var_c
var_e = 10
var_f = var_d * var_e
var_g = var_a - var_f
print(int(var_g)) |
Comparison | Hohyeon, Seulgi, and Hyunjeong are playing darts. Hohyeon scored 23 points in the first and 28 points in the second. Hyunjeong and Seulgi scored 32 and 27 points in the first round, respectively. If Hyeonjeong's 2nd score is 17 points, how many points does Seulgi need to score 2nd in order to win first alone? | 25 | [OP_LIST_SOL] Hohyeon Seulgi Hyunjeong [OP_LIST_EOL] [OP_LIST_SOL] 23 28 [OP_ADD] 32 17 [OP_ADD] 27 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] 1 [OP_ADD] | var_a = 'Hohyeon'
var_b = 'Seulgi'
var_c = 'Hyunjeong'
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 = 23
var_e = 28
var_f = var_d + var_e
var_g = 32
var_h = 17
var_i = var_g + var_h
var_j = 27
list_b= []
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_f):
var_f = eval(str(var_f))
list_b.append(var_f)
list_b.reverse()
var_k = 1
list_c=list_b.copy()
list_c.sort()
var_l = list_c[-var_k]
var_m = 1
list_d=list_b.copy()
list_d.sort()
var_n = list_d[var_m-1]
var_o = var_l - var_n
var_p = 1
var_q = var_o + var_p
print(int(var_q)) |
Possibility | Try to create a three-digit number using the number cards 2, 4, 6, and 8. Assuming you can use the same number card multiple times, find the sum of all possible numbers. | 35520 | [OP_LIST_SOL] 2 4 6 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PRODUCT] [OP_LIST_SUM] | var_a = 2
var_b = 4
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 = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=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]
list_b = [float(i) for i in list_b]
var_f = sum(list_b)
print(int(var_f)) |
Arithmetic calculation | You want to divide 72 sweets and 56 candies equally among four people. Find the total number of sweets and candies that each person gets. | 32 | 72 4 [OP_DIV] 56 4 [OP_DIV] [OP_ADD] | var_a = 72
var_b = 4
var_c = var_a / var_b
var_d = 56
var_e = 4
var_f = var_d / var_e
var_g = var_c + var_f
print(int(var_g)) |
Possibility | There are 2 white stones and 1 black stone. How many different ways can you place 3 stones in a row, given that same color stones are indistinguishable from each other? | 3 | 1 2 [OP_ADD] 1 2 [OP_ADD] [OP_PERM] 2 2 [OP_PERM] [OP_DIV] | var_a = 1
var_b = 2
var_c = var_a + var_b
var_d = 1
var_e = 2
var_f = var_d + var_e
var_g = 1
var_c = int(var_c)
var_f = int(var_f)
for i, elem in enumerate(range(var_f)):
var_g = var_g * (var_c-i)
var_h = 2
var_i = 2
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 = var_g / var_j
print(int(var_k)) |
Comparison | Suppose you fill in candies of the same size into a red rectangular cuboid-shaped box with a base area of 8 cubic centimeters (cm2) and a height of 7 centimeters (cm), and a blue cube-shaped box with a side length of 8 centimeters (cm). Find which box will contain more candies. | blue | [OP_LIST_SOL] red blue [OP_LIST_EOL] [OP_LIST_SOL] 8 7 [OP_MUL] 8 8 [OP_MUL] 8 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'red'
var_b = 'blue'
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 = 8
var_d = 7
var_e = var_c * var_d
var_f = 8
var_g = 8
var_h = var_f * var_g
var_i = 8
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_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_k = 1
list_c=list_b.copy()
list_c.sort()
var_l = list_c[-var_k]
var_m = list_b.index(var_l)+1
var_n = list_a[var_m-1]
print(var_n) |
Geometry | Twelve jellies, each 18 centimeters (cm) long, were overlapped the same amount to form a round ring. If its circumference is 210 centimeters (cm), how many millimeters (mm) is the overlapping portion of jelly? | 60 | 18 12 [OP_MUL] 210 [OP_SUB] 10 [OP_MUL] | var_a = 18
var_b = 12
var_c = var_a * var_b
var_d = 210
var_e = var_c - var_d
var_f = 10
var_g = var_e * var_f
print(int(var_g)) |
Correspondence | Divide the number of go stones by 7, add 40 and multiply by 5 to get 555. Of these, if there are 55 black go stones, how many white go stones? | 442 | 555 5 [OP_DIV] 40 [OP_SUB] 7 [OP_MUL] 55 [OP_SUB] | var_a = 555
var_b = 5
var_c = var_a / var_b
var_d = 40
var_e = var_c - var_d
var_f = 7
var_g = var_e * var_f
var_h = 55
var_i = var_g - var_h
print(int(var_i)) |
Correspondence | A three-digit number 2AB is divisible by both 2 and 3. How many possible A's are there? | 10 | 2AB [OP_GEN_POSSIBLE_LIST] 2 3 [OP_LCM] [OP_LIST_DIVISIBLE] 2AB A [OP_LIST_FIND_UNK] [OP_LIST_LEN] | var_a = '2AB'
ans_dict = dict()
var_a = str(var_a)
list_a = []
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
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]))
if len(var_a) == len(str(int(temp))):
new_elem = int(temp)
list_a.append(new_elem)
var_b = 2
var_c = 3
var_d = var_c * var_b / math.gcd(int(var_c), int(var_b))
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 = '2AB'
var_f = 'A'
var_e = str(var_e)
var_f = str(var_f)
unk_idx = var_e.index(var_f)
list_c = []
for elem in list_b:
elem = str(elem)
list_c.append(int(elem[unk_idx]))
list_c = list(set(list_c))
var_g = len(list_c)
print(int(var_g)) |
Comparison | Yeseul exercised 13/10 hours today, and Youngjun did 22/15 hours. Among Yeseul and Youngjun, who exercised longer? | Youngjun | [OP_LIST_SOL] Yeseul Youngjun [OP_LIST_EOL] [OP_LIST_SOL] 13/10 22/15 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Yeseul'
var_b = 'Youngjun'
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.3
var_d = 1.4666666666666666
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 | How many trees are needed to plant trees on both sides of a 100-meter (m) road at 10-meter (m) intervals from start to finish? | 22 | 100 10 [OP_DIV] 1 [OP_ADD] 2 [OP_MUL] | var_a = 100
var_b = 10
var_c = var_a / var_b
var_d = 1
var_e = var_c + var_d
var_f = 2
var_g = var_e * var_f
print(int(var_g)) |
Geometry | You have a square with a perimeter of 52 centimeters (cm). What is the area of this square in square centimeters (cm2)? | 169 | 52 4 [OP_DIV] 2 [OP_POW] | var_a = 52
var_b = 4
var_c = var_a / var_b
var_d = 2
var_e = var_c ** var_d
print(int(var_e)) |
Comparison | Younghee's weight is 55.6 kilograms (kg), and Cheolsu's weight is 88.2 kilograms (kg). Who is lighter between Younghee and Cheolsu? | Younghee | [OP_LIST_SOL] Younghee Cheolsu [OP_LIST_EOL] [OP_LIST_SOL] 55.6 88.2 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Younghee'
var_b = 'Cheolsu'
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 = 55.6
var_d = 88.2
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 | Find the number of even numbers from 1 to 10. | 5 | 1 10 [OP_LIST_EVEN] [OP_LIST_LEN] | var_a = 1
var_b = 10
list_a = []
if var_a%2!=0:
for i in range(var_a+1, var_b+1, 2):
list_a.append(i)
else:
for i in range(var_a, var_b+1, 2):
list_a.append(i)
var_c = len(list_a)
print(int(var_c)) |
Comparison | There are 28 identical shelves in the warehouse. Each shelf has 6 spaces with the same number of books in it. If 19 books are on one shelf, what is a total number of books on the shelf in the warehouse? | 3192 | 28 6 [OP_MUL] 19 [OP_MUL] | var_a = 28
var_b = 6
var_c = var_a * var_b
var_d = 19
var_e = var_c * var_d
print(int(var_e)) |
Possibility | When 2 female students and 3 male students are lined up in a line, find the number of cases in which the male students must be next to each other. | 36 | 2 1 [OP_ADD] 2 1 [OP_ADD] [OP_PERM] 3 3 [OP_PERM] [OP_MUL] | var_a = 2
var_b = 1
var_c = var_a + var_b
var_d = 2
var_e = 1
var_f = var_d + var_e
var_g = 1
var_c = int(var_c)
var_f = int(var_f)
for i, elem in enumerate(range(var_f)):
var_g = var_g * (var_c-i)
var_h = 3
var_i = 3
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 = var_g * var_j
print(int(var_k)) |
Geometry | Fifteen sheets of colored tape, each 25 centimeters (cm) long, were joined together overlapping each other by 0.5 centimeters (cm). How many meters (m) is the total length of the attached color tape? | 3.68 | 25 15 [OP_MUL] 0.5 15 1 [OP_SUB] [OP_MUL] [OP_SUB] 100 [OP_DIV] | var_a = 25
var_b = 15
var_c = var_a * var_b
var_d = 0.5
var_e = 15
var_f = 1
var_g = var_e - var_f
var_h = var_d * var_g
var_i = var_c - var_h
var_j = 100
var_k = var_i / var_j
print('{:.2f}'.format(round(var_k+1e-10,2))) |
Arithmetic calculation | There are 25, 41, 13, and 32. Find the sum of the largest and smallest numbers. | 54 | [OP_LIST_SOL] 25 41 13 32 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD] | var_a = 25
var_b = 41
var_c = 13
var_d = 32
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 = 1
list_b=list_a.copy()
list_b.sort()
var_f = list_b[-var_e]
var_g = 1
list_c=list_a.copy()
list_c.sort()
var_h = list_c[var_g-1]
var_i = var_f + var_h
print(int(var_i)) |
Arithmetic calculation | If Jimin eats 150 centimeters (cm) and Taehyung eats 1.65 m (m) of the 30 m (m) bread, how many meters (m) are left over? | 26.85 | 30 150 100 [OP_DIV] [OP_SUB] 1.65 [OP_SUB] | var_a = 30
var_b = 150
var_c = 100
var_d = var_b / var_c
var_e = var_a - var_d
var_f = 1.65
var_g = var_e - var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Correspondence | If you mistakenly add 10 to a number that should be multiplied by 10, the result is 21. How much do you get when you calculate correctly? | 110 | 21 10 [OP_SUB] 10 [OP_MUL] | var_a = 21
var_b = 10
var_c = var_a - var_b
var_d = 10
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | While adding the two-digit and three-digit numbers, Yoongi mistook the two-digit number's units digit 9 for 6, and changed the units and hundreds digits of the three-digit number to make it 253. At this time, if the sum obtained by Yoongi is 299, what is the two-digit number? | 49 | 299 253 [OP_SUB] 6 9 [OP_SUB] [OP_SUB] | var_a = 299
var_b = 253
var_c = var_a - var_b
var_d = 6
var_e = 9
var_f = var_d - var_e
var_g = var_c - var_f
print(int(var_g)) |
Arithmetic calculation | Taehoon sleeps 1/3 of the day, spends the remaining 3/4 at school, and goes to the piano academy for the remaining 1/4. Find the amount of time Taehoon spends at the piano academy during the day. | 1 | 24 1 1/3 [OP_SUB] [OP_MUL] 1 3/4 [OP_SUB] [OP_MUL] 1/4 [OP_MUL] | var_a = 24
var_b = 1
var_c = 0.3333333333333333
var_d = var_b - var_c
var_e = var_a * var_d
var_f = 1
var_g = 0.75
var_h = var_f - var_g
var_i = var_e * var_h
var_j = 0.25
var_k = var_i * var_j
print(int(var_k)) |
Possibility | How many three-digit numbers can be made using 0, 2, and 9? You can use the same number multiple times. | 18 | [OP_LIST_SOL] 0 2 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PRODUCT] [OP_LIST_LEN] | var_a = 0
var_b = 2
var_c = 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 = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.product(list_b, repeat=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 = len(list_b)
print(int(var_e)) |
Comparison | As a result of the examination, the average height of the three people is 143 centimeters (cm). The average height of B and C is equal to A's height plus 4.5 centimeters (cm). If B is 3 centimeters (cm) taller than C, what is the height of C? | 143 | 143 3 [OP_MUL] 4.5 [OP_ADD] 3 [OP_DIV] 2 [OP_MUL] 3 [OP_SUB] 2 [OP_DIV] | var_a = 143
var_b = 3
var_c = var_a * var_b
var_d = 4.5
var_e = var_c + var_d
var_f = 3
var_g = var_e / var_f
var_h = 2
var_i = var_g * var_h
var_j = 3
var_k = var_i - var_j
var_l = 2
var_m = var_k / var_l
print(int(var_m)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.