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 | Yuna took the elevator from the third floor and went up two more floors. What floor is Yuna on? | 5 | 3 2 [OP_ADD] | var_a = 3
var_b = 2
var_c = var_a + var_b
print(int(var_c)) |
Correspondence | A2468B, consisting of single digits A and B, is divisible by 55. Find the number of numbers that can be A2468. | 2 | A2468B [OP_GEN_POSSIBLE_LIST] 55 [OP_LIST_DIVISIBLE] [OP_LIST_LEN] | var_a = 'A2468B'
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 = 55
list_b = []
var_b = int(var_b)
for i in list_a:
i = int(i)
if i % var_b == 0:
list_b.append(i)
var_c = len(list_b)
print(int(var_c)) |
Arithmetic calculation | There are 42 pigs and 48 sheep on the farm, and the number of pigs and dogs is the same. How many more pigs and dogs are there altogether than the number sheeps? | 36 | 42 42 [OP_ADD] 48 [OP_SUB] | var_a = 42
var_b = 42
var_c = var_a + var_b
var_d = 48
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | 691-6A7=4. What is A? | 8 | 691-6A7=4 A [OP_DIGIT_UNK_SOLVER] | var_a = '691-6A7=4'
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 | 637 is the result of adding 238 to a number by mistake, which was supposed to subtract 382 from a number. How much do you get from a correct calculation?
| 17 | 637 238 [OP_SUB] 382 [OP_SUB] | var_a = 637
var_b = 238
var_c = var_a - var_b
var_d = 382
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | If a watermelon sold at a store is 200 won cheaper than 5,000 won, find the price of the watermelon in units of 1,000 won. | 4.8 | 5 2 10 [OP_DIV] [OP_SUB] | var_a = 5
var_b = 2
var_c = 10
var_d = var_b / var_c
var_e = var_a - var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Correspondence | The quotient of 14 divided by 3 is 4, and the remainder is A. What is the value of A? | 2 | 14 3 4 [OP_MUL] [OP_SUB] | var_a = 14
var_b = 3
var_c = 4
var_d = var_b * var_c
var_e = var_a - var_d
print(int(var_e)) |
Arithmetic calculation | A 2 liter (L) water bottle was filled with water in a 200 milliliter (㎖) cup and poured three times. Find at least how many more times you need to pour this cup to fill the bucket with water. | 7 | 2 1000 [OP_MUL] 200 3 [OP_MUL] [OP_SUB] 200 [OP_DIV] 1 [OP_CEIL] | var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 200
var_e = 3
var_f = var_d * var_e
var_g = var_c - var_f
var_h = 200
var_i = var_g / var_h
var_j = 1
var_k=int(((var_i+9*10**(var_j-2))//(10**(var_j-1)))*10**(var_j-1))
print(int(var_k)) |
Arithmetic calculation | Six years ago, the age of the father was five times the age of the son. Six years from this year, the sum of the ages of father and son will be 78. How old is the father this year? | 51 | 78 6 2 [OP_MUL] [OP_SUB] 6 2 [OP_MUL] [OP_SUB] 5 1 [OP_ADD] [OP_FDIV] 5 [OP_MUL] 6 [OP_ADD] | var_a = 78
var_b = 6
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 6
var_g = 2
var_h = var_f * var_g
var_i = var_e - var_h
var_j = 5
var_k = 1
var_l = var_j + var_k
var_m = var_i // var_l
var_n = 5
var_o = var_m * var_n
var_p = 6
var_q = var_o + var_p
print(int(var_q)) |
Arithmetic calculation | In the hundreds place of the three-digit number ABC is 2 and in the units place is 7. What is the sum of the largest and smallest number of possible ABCs? | 504 | [OP_LIST_SOL] 2 A 7 [OP_LIST_EOL] [OP_LIST2NUM] [OP_GEN_POSSIBLE_LIST] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD] | var_a = 2
var_b = 'A'
var_c = 7
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=""
for i in list_a:
i = str(i)
var_d = var_d + i
ans_dict = dict()
var_d = str(var_d)
list_b = []
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_d):
if v in variable_candi:
ans_dict[v] = 0
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_d
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
if len(var_d) == len(str(int(temp))):
new_elem = int(temp)
list_b.append(new_elem)
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 1
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f + var_h
print(int(var_i)) |
Comparison | We compared the sizes of beads - (a), (b), (c), (d). (a) bead is larger than (b) bead, (b) bead is smaller than (c) bead, and (c) bead is smaller than (d) bead.Which of these marbles is the smallest? | (b) | [OP_LIST_SOL] (a) (b) (c) (d) [OP_LIST_EOL] [OP_LIST_SOL] (a) (d) > (b) (c) < (c) (d) < [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)'
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 = '(a)'
var_f = '(d)'
var_g = '>'
var_h = '(b)'
var_i = '(c)'
var_j = '<'
var_k = '(c)'
var_l = '(d)'
var_m = '<'
list_b= []
if "/" in str(var_m):
var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_n = len(list_c)
var_o = list_c[var_n-1]
print(var_o) |
Arithmetic calculation | Last year, Hoseok was 5 years old and his mother was 35 years old. How many times would the mother's age be Hoseok's age 4 years from now? | 4 | 35 1 [OP_ADD] 4 [OP_ADD] 5 1 [OP_ADD] 4 [OP_ADD] [OP_DIV] | var_a = 35
var_b = 1
var_c = var_a + var_b
var_d = 4
var_e = var_c + var_d
var_f = 5
var_g = 1
var_h = var_f + var_g
var_i = 4
var_j = var_h + var_i
var_k = var_e / var_j
print(int(var_k)) |
Geometry | Jiwoo is solving a quiz, and she is told to turn the knob by the sum of the degrees of the interior angles of the hexagon. How many degrees (°) should the knob be turned? | 720 | 6 2 [OP_SUB] 180 [OP_MUL] | var_a = 6
var_b = 2
var_c = var_a - var_b
var_d = 180
var_e = var_c * var_d
print(int(var_e)) |
Arithmetic calculation | Of the 41 third-grade students, there are three more male students than female students. Find how many male students there are. | 22 | 41 3 [OP_SUB] 2 [OP_DIV] 3 [OP_ADD] | var_a = 41
var_b = 3
var_c = var_a - var_b
var_d = 2
var_e = var_c / var_d
var_f = 3
var_g = var_e + var_f
print(int(var_g)) |
Arithmetic calculation | An elementary school has 217 3rd-grade students and 196 4th-grade students. If the number of students in grades 3 and 5 combined is equal to the number of students in grades 4 and 6 combined, what is the difference between the number of students in grades 5 and 6? | 21 | 217 196 [OP_SUB] [OP_ABS] | var_a = 217
var_b = 196
var_c = var_a - var_b
var_d = abs(var_c)
print(int(var_d)) |
Geometry | Diagonals were drawn from one vertex of the octagon to the other vertices. Find the number of triangles formed in this case. | 6 | 8 3 [OP_SUB] 1 [OP_ADD] | var_a = 8
var_b = 3
var_c = var_a - var_b
var_d = 1
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | I made a roundtrip between two points A and B by bicycle, traveling at 15 kilometers (km) per hour on the way and 10 kilometers (km) per hour on the way back. It took 30 minutes longer on the way back. Find the distance between two points A and B. | 15 | 30 60 [OP_DIV] 1 10 [OP_DIV] 1 15 [OP_DIV] [OP_SUB] [OP_DIV] | var_a = 30
var_b = 60
var_c = var_a / var_b
var_d = 1
var_e = 10
var_f = var_d / var_e
var_g = 1
var_h = 15
var_i = var_g / var_h
var_j = var_f - var_i
var_k = var_c / var_j
print(int(eval('{:.2f}'.format(round(var_k+1e-10,2))))) |
Geometry | Find the number of vertices of a polyhedron such that 6 diagonals can be drawn from one vertex. | 9 | 6 3 [OP_ADD] | var_a = 6
var_b = 3
var_c = var_a + var_b
print(int(var_c)) |
Correspondence | You bought three sets of marbles with 32 marbles in each and handed four of them out to each student. When there are no marbles left, find how many students there are. | 24 | 32 3 [OP_MUL] 4 [OP_DIV] | var_a = 32
var_b = 3
var_c = var_a * var_b
var_d = 4
var_e = var_c / var_d
print(int(var_e)) |
Arithmetic calculation | There are 56 pear trees. There are 18 more pear trees than apple trees, and 12 fewer tangerine trees than apple trees. How many tangerine trees are there in all? | 26 | 56 18 [OP_SUB] 12 [OP_SUB] | var_a = 56
var_b = 18
var_c = var_a - var_b
var_d = 12
var_e = var_c - var_d
print(int(var_e)) |
Comparison | Jungkook collected 6 divided by 3 apples, and Yoongi collected 4 apples. Who has the greater number of apples? | Yoongi | [OP_LIST_SOL] Jungkook Yoongi [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_FDIV] 4 [OP_LIST_EOL] 1 [OP_LIST_MAX] [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]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j) |
Arithmetic calculation | Which 5-digit number is the largest number divisible by 9, 6, and 2? | 99990 | 10000 99999 1 [OP_LIST_ARANGE] 9 [OP_LIST_DIVISIBLE] 6 [OP_LIST_DIVISIBLE] 2 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX] | var_a = 10000
var_b = 99999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 9
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 = 6
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 = 2
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 = 1
list_e=list_d.copy()
list_e.sort()
var_h = list_e[-var_g]
print(int(var_h)) |
Arithmetic calculation | If there are 127 female students and the total number of students at Yoongi's school is 280, how many fewer female students than male students are there? | 26 | 280 127 [OP_SUB] 127 [OP_SUB] | var_a = 280
var_b = 127
var_c = var_a - var_b
var_d = 127
var_e = var_c - var_d
print(int(var_e)) |
Geometry | I was supposed to multiply a certain number by 6, but by mistake, adding 6 to it and multiplying it by 2 resulted in 28. Find the correct calculated value. | 48 | 28 2 [OP_DIV] 6 [OP_SUB] 6 [OP_MUL] | var_a = 28
var_b = 2
var_c = var_a / var_b
var_d = 6
var_e = var_c - var_d
var_f = 6
var_g = var_e * var_f
print(int(var_g)) |
Arithmetic calculation | Jungkook opened the book and the sum of the two pages was 185. Write the smaller of the two pages that Jungkook unfolded. | 92 | 185 2 [OP_FDIV] | var_a = 185
var_b = 2
var_c = var_a // var_b
print(int(var_c)) |
Correspondence | You mistakenly subtracted what two numbers should be added to, and got 12. This is different by 40 from the correct answer. Find the product of those two numbers. | 640 | 40 2 [OP_DIV] 12 [OP_ADD] 40 2 [OP_DIV] [OP_MUL] | var_a = 40
var_b = 2
var_c = var_a / var_b
var_d = 12
var_e = var_c + var_d
var_f = 40
var_g = 2
var_h = var_f / var_g
var_i = var_e * var_h
print(int(var_i)) |
Geometry | Find the sum of the lengths of the edges of a regular tetrahedron with a side length of 3 centimeters (cm) plus 3. | 21 | 3 6 3 [OP_MUL] [OP_ADD] | var_a = 3
var_b = 6
var_c = 3
var_d = var_b * var_c
var_e = var_a + var_d
print(int(var_e)) |
Correspondence | Yoongi wants to do a subtraction with a two-digit number and a four-digit number. Yoongi confused the tens and units digits of the two-digit number to get 23, and the four-digit number's units digit 9 was misread as 6. When the difference Yoongi got is 1299, find the four-digit number. | 1273 | 23 1299 [OP_SUB] 6 9 [OP_SUB] [OP_SUB] | var_a = 23
var_b = 1299
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 | Two candles A and B, each 30 centimeters (cm) and 20 centimeters (cm) long, were lit at the same time. Candle A is said to lose 1 centimeter (cm) per minute, and candle B is said to lose 0.5 centimeters (cm) per minute. Find the length of the candle when both candles are equal in length. | 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 | You are comparing the heights of 20 students. Jungkook is taller than Yoongi, and there are 5 students between Yoongi and Jungkook. There are 6 students who are taller than Jungkook. How many students are shorter than Yoongi? | 7 | 20 6 [OP_SUB] 1 [OP_SUB] 5 [OP_SUB] 1 [OP_SUB] | var_a = 20
var_b = 6
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
var_f = 5
var_g = var_e - var_f
var_h = 1
var_i = var_g - var_h
print(int(var_i)) |
Arithmetic calculation | Yoojung has 4 times as many flowers as Namjoon. If Yoojung has 32 flowers, how many flowers do Yoojung and Namjoon have? | 40 | 32 32 4 [OP_DIV] [OP_ADD] | var_a = 32
var_b = 32
var_c = 4
var_d = var_b / var_c
var_e = var_a + var_d
print(int(var_e)) |
Arithmetic calculation | Of the 13/4 liters (l) of water in the bucket, 12/5 liters (l) were used for cleaning, and 11/6 liters (l) of water was refilled into the bucket. Find how many liters (l) of water are left in the bucket. | 2.68 | 13/4 12/5 [OP_SUB] 11/6 [OP_ADD] | var_a = 3.25
var_b = 2.4
var_c = var_a - var_b
var_d = 1.8333333333333333
var_e = var_c + var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Possibility | Find the difference between the largest and smallest three-digit number that can be formed using the number cards 2, 5, and 8 once. What is the answer when multiplying that by the second largest number? | 490050 | [OP_LIST_SOL] 2 5 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] [OP_ABS] 2 [OP_LIST_MAX] [OP_MUL] | var_a = 2
var_b = 5
var_c = 8
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 3
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_d))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[-var_e]
var_g = 1
list_d=list_b.copy()
list_d.sort()
var_h = list_d[var_g-1]
var_i = var_f - var_h
var_j = abs(var_i)
var_k = 2
list_e=list_b.copy()
list_e.sort()
var_l = list_e[-var_k]
var_m = var_j * var_l
print(int(var_m)) |
Correspondence | There are 10 apples in the fruit gift set. If 2/9 of the fruit gift set is apples and 2/5 is pears, find the number of pears in the fruit gift set. | 18 | 10 2/9 [OP_DIV] 2/5 [OP_MUL] | var_a = 10
var_b = 0.2222222222222222
var_c = var_a / var_b
var_d = 0.4
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | A particular number should have been multiplied by 12, but the result was 8 because it was divided by mistake. Find the correct calculation result. | 1152 | 8 12 [OP_MUL] 12 [OP_MUL] | var_a = 8
var_b = 12
var_c = var_a * var_b
var_d = 12
var_e = var_c * var_d
print(int(var_e)) |
Arithmetic calculation | I put 8 more coins in the piggy bank, and there are 29 coins in total. How many coins were there in the first place? | 21 | 29 8 [OP_SUB] | var_a = 29
var_b = 8
var_c = var_a - var_b
print(int(var_c)) |
Geometry | There is a box in the shape of a cube with one edge 60 centimeters (cm) long. How many pieces of colored paper are needed to glue 5 centimeters (cm) wide and 5 centimeters (cm) long colored paper to the outer surface of the box without any gap? | 864 | 60 2 [OP_POW] 6 [OP_MUL] 5 2 [OP_POW] [OP_DIV] | var_a = 60
var_b = 2
var_c = var_a ** var_b
var_d = 6
var_e = var_c * var_d
var_f = 5
var_g = 2
var_h = var_f ** var_g
var_i = var_e / var_h
print(int(var_i)) |
Arithmetic calculation | Find the total of four numbers 1/3, 5/24, 8.16, and 1/8. | 8.83 | 1/3 5/24 [OP_ADD] 8.16 [OP_ADD] 1/8 [OP_ADD] | var_a = 0.3333333333333333
var_b = 0.20833333333333334
var_c = var_a + var_b
var_d = 8.16
var_e = var_c + var_d
var_f = 0.125
var_g = var_e + var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Comparison | A rose is planted in the 7th row from the front, the 16th row from the back, the 13th row from the right, and the 9th row from the left. Assuming the same number of flowers are planted in each row, find the total number of flowers. | 462 | 7 16 [OP_ADD] 1 [OP_SUB] 9 13 [OP_ADD] 1 [OP_SUB] [OP_MUL] | var_a = 7
var_b = 16
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 9
var_g = 13
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 | What is the smallest two-digit multiple of 3? | 12 | 10 99 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN] | var_a = 10
var_b = 99
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d = 3
list_b = []
var_d = int(var_d)
for i in list_a:
i = int(i)
if i % var_d == 0:
list_b.append(i)
var_e = 1
list_c=list_b.copy()
list_c.sort()
var_f = list_c[var_e-1]
print(int(var_f)) |
Correspondence | There are 21 soccer balls in the four nets. If all soccer balls are handed out equally to 12 soccer team members, how many soccer balls will each player have? | 7 | 4 21 [OP_MUL] 12 [OP_DIV] | var_a = 4
var_b = 21
var_c = var_a * var_b
var_d = 12
var_e = var_c / var_d
print(int(var_e)) |
Correspondence | When the shuttlecocks were distributed equally to 24 students in Yunsu's class, 19 shuttlecocks were distributed to each student and there were no shuttlecocks left. Find the total number of shuttlecocks distributed to the students in Yunsu's class. | 456 | 19 24 [OP_MUL] | var_a = 19
var_b = 24
var_c = var_a * var_b
print(int(var_c)) |
Comparison | There are 4 vases, (a), (b), (c), and (d). Vase (c) is larger than vase (a). Vase (d) is smaller than vase (a). Vase (c) is smaller than vase (b). What is the largest vase? | (b) | [OP_LIST_SOL] (a) (b) (c) (d) [OP_LIST_EOL] [OP_LIST_SOL] (c) (a) > (d) (a) < (c) (b) < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET] | var_a = '(a)'
var_b = '(b)'
var_c = '(c)'
var_d = '(d)'
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 = '(c)'
var_f = '(a)'
var_g = '>'
var_h = '(d)'
var_i = '(a)'
var_j = '<'
var_k = '(c)'
var_l = '(b)'
var_m = '<'
list_b= []
if "/" in str(var_m):
var_m = eval(str(var_m))
list_b.append(var_m)
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_n = 1
var_o = list_c[var_n-1]
print(var_o) |
Correspondence | Hansoo multiplied the value by 7, which should have been divided by 7, by mistake. So he submitted the wrong answer of 115.15. What should be the correct answer to the problem? | 2.35 | 115.15 7 [OP_DIV] 7 [OP_DIV] | var_a = 115.15
var_b = 7
var_c = var_a / var_b
var_d = 7
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Comparison | Find the difference between the largest and the smallest of the four numbers 2.5, 22/13, 0.7, and 32/33. | 1.8 | [OP_LIST_SOL] 2.5 22/13 0.7 32/33 [OP_LIST_EOL] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] | var_a = 2.5
var_b = 1.6923076923076923
var_c = 0.7
var_d = 0.9696969696969697
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('{:.2f}'.format(round(var_i+1e-10,2))) |
Arithmetic calculation | What is the smallest natural number greater than 12? | 13 | 12 1 [OP_ADD] 999 1 [OP_LIST_ARANGE] 1 [OP_LIST_MIN] | var_a = 12
var_b = 1
var_c = var_a + var_b
var_d = 999
var_e = 1
list_a = [i for i in range(var_c, var_d + 1, var_e)]
var_f = 1
list_b=list_a.copy()
list_b.sort()
var_g = list_b[var_f-1]
print(int(var_g)) |
Possibility | How many faces of a cube-shaped box meet at one vertex? | 3 | 3 | var_a = 3
print(int(var_a)) |
Comparison | The white chest of drawers has a volume of 2 cubic meters (m3) and the black chest of drawers has a volume of 85000 cubic centimeters (cm3). Which color chest of drawers is more bulky? | white | [OP_LIST_SOL] white black [OP_LIST_EOL] [OP_LIST_SOL] 2 850000 100 3 [OP_POW] [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'white'
var_b = 'black'
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 = 2
var_d = 850000
var_e = 100
var_f = 3
var_g = var_e ** var_f
var_h = var_d / var_g
list_b= []
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_b.append(var_c)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l) |
Arithmetic calculation | Mathematics is 82 points, Korean language is 5 points higher. If the average score in Korean, English, and Mathematics is 89, what is the English score? | 98 | 89 3 [OP_MUL] 82 [OP_SUB] 82 5 [OP_ADD] [OP_SUB] | var_a = 89
var_b = 3
var_c = var_a * var_b
var_d = 82
var_e = var_c - var_d
var_f = 82
var_g = 5
var_h = var_f + var_g
var_i = var_e - var_h
print(int(var_i)) |
Arithmetic calculation | There are 62 marbles. Add a few more marbles and you'll have no leftover and hand it out equally to 8 people. Find the minimum number of marbles required. | 2 | 8 62 8 [OP_MOD] [OP_SUB] | var_a = 8
var_b = 62
var_c = 8
var_d = var_b % var_c
var_e = var_a - var_d
print(int(var_e)) |
Correspondence | You have to add 40 to a number. But you divided a number by 6 by mistake and obtained a result of 52. What is the correct result of the calculation? | 352 | 52 6 [OP_MUL] 40 [OP_ADD] | var_a = 52
var_b = 6
var_c = var_a * var_b
var_d = 40
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | Taeyang's school decided to rent a bus to go on a school trip. When a bus can accommodate up to 30 students, how many buses should the school rent to accommodate all 1284 students? | 43 | 1284 30 [OP_DIV] 1 [OP_CEIL] | var_a = 1284
var_b = 30
var_c = var_a / var_b
var_d = 1
var_e=int(((var_c+9*10**(var_d-2))//(10**(var_d-1)))*10**(var_d-1))
print(int(var_e)) |
Possibility | Write down the 3rd smallest number among four-digit numbers that can be formed from four different numbers among 5, 0, 1, 8, and 7. | 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)) |
Arithmetic calculation | There are four numbers 10, 11, 12, and 13. What is the product of the largest number and the next largest number? | 156 | [OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MAX] [OP_MUL] | var_a = 10
var_b = 11
var_c = 12
var_d = 13
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 = 2
list_c=list_a.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = var_f * var_h
print(int(var_i)) |
Arithmetic calculation | The students are standing in eight rows. Among them, there are six people standing in each of the seven rows, and five people are standing in last row. How many students are there in total? | 47 | 7 6 [OP_MUL] 1 5 [OP_MUL] [OP_ADD] | var_a = 7
var_b = 6
var_c = var_a * var_b
var_d = 1
var_e = 5
var_f = var_d * var_e
var_g = var_c + var_f
print(int(var_g)) |
Possibility | We want to create a four-digit number using the five numbers 2, 0, 3, 5, and 8. Find the difference between the largest and smallest possible numbers. | 6497 | [OP_LIST_SOL] 2 0 3 5 8 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_SUB] | var_a = 2
var_b = 0
var_c = 3
var_d = 5
var_e = 8
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 4
list_b = [str(i) for i in list_a]
list_b = list(itertools.permutations(list_b, var_f))
list_b = [''.join(num_list) for num_list in list_b]
list_b = [str_num for str_num in list_b if str_num[0] != '0']
list_b = [float(i) for i in list_b]
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = 1
list_d=list_b.copy()
list_d.sort()
var_j = list_d[var_i-1]
var_k = var_h - var_j
print(int(var_k)) |
Comparison | Two boxes (A), (B) have been delivered. Jimin tries to carry the smaller of the two boxes. If box (A) is smaller than box (B), which box does Jimin have to carry? | (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) |
Correspondence | When 23 is divided by 6, the quotient and remainder are A and 5, respectively. Find A at here. | 3 | 23 5 [OP_SUB] 6 [OP_DIV] | var_a = 23
var_b = 5
var_c = var_a - var_b
var_d = 6
var_e = var_c / var_d
print(int(var_e)) |
Correspondence | When AB2-41=591, find A. | 6 | AB2-41=591 A [OP_DIGIT_UNK_SOLVER] | var_a = 'AB2-41=591'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Comparison | Suhyeon, Somin, and Jisoo received the same amount of math homework. The number of math problems remaining after the three solved them is 1/4 for Sohyeon, 1/8 for Somin, and 1/5 for Jisoo. Who currently has the highest amount of problems solved? | Somin | [OP_LIST_SOL] Suhyeon Somin Jisoo [OP_LIST_EOL] [OP_LIST_SOL] 1 1/4 [OP_SUB] 1 1/8 [OP_SUB] 1 1/5 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Suhyeon'
var_b = 'Somin'
var_c = 'Jisoo'
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
var_e = 0.25
var_f = var_d - var_e
var_g = 1
var_h = 0.125
var_i = var_g - var_h
var_j = 1
var_k = 0.2
var_l = var_j - var_k
list_b= []
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
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_m = 1
list_c=list_b.copy()
list_c.sort()
var_n = list_c[-var_m]
var_o = list_b.index(var_n)+1
var_p = list_a[var_o-1]
print(var_p) |
Arithmetic calculation | If the sum of three consecutive even numbers is 1194, what is the sum of the smallest and largest even numbers? | 796 | 1194 0 3 1 [OP_SUB] 2 [OP_MUL] 2 [OP_LIST_ARANGE] [OP_LIST_SUM] [OP_SUB] 3 [OP_DIV] 2 [OP_MUL] 3 1 [OP_SUB] 2 [OP_MUL] [OP_ADD] | var_a = 1194
var_b = 0
var_c = 3
var_d = 1
var_e = var_c - var_d
var_f = 2
var_g = var_e * var_f
var_h = 2
list_a = [i for i in range(var_b, var_g + 1, var_h)]
list_a = [float(i) for i in list_a]
var_i = sum(list_a)
var_j = var_a - var_i
var_k = 3
var_l = var_j / var_k
var_m = 2
var_n = var_l * var_m
var_o = 3
var_p = 1
var_q = var_o - var_p
var_r = 2
var_s = var_q * var_r
var_t = var_n + var_s
print(int(var_t)) |
Comparison | Minho's age is three times Suhong's age, and Mina's age is two years younger than twice the Suhong's age. If the sum of the ages of the three is 34, how old is Mina? | 10 | 34 2 [OP_ADD] 3 1 [OP_ADD] 2 [OP_ADD] [OP_DIV] 2 [OP_MUL] 2 [OP_SUB] | var_a = 34
var_b = 2
var_c = var_a + var_b
var_d = 3
var_e = 1
var_f = var_d + var_e
var_g = 2
var_h = var_f + var_g
var_i = var_c / var_h
var_j = 2
var_k = var_i * var_j
var_l = 2
var_m = var_k - var_l
print(int(var_m)) |
Correspondence | There are two different numbers A and B. Find the difference between A and B in the multiplication equation AB×6=BBB. | 3 | AB×6=BBB A [OP_DIGIT_UNK_SOLVER] AB×6=BBB B [OP_DIGIT_UNK_SOLVER] [OP_SUB] [OP_ABS] | var_a = 'AB×6=BBB'
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]
var_d = 'AB×6=BBB'
var_e = 'B'
ans_dict = dict()
var_d = var_d.replace('×','*')
var_d = var_d.replace('x','*')
var_d = var_d.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_d):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_d
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_d):
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_f = ans_dict[var_e]
var_g = var_c - var_f
var_h = abs(var_g)
print(int(var_h)) |
Possibility | 1, 2, 3, 4 ..., 998, 999 were written sequentially to make 1234567891011121314...998999. Find the sum of each digit in this number. | 13500 | 1 999 1 [OP_LIST_ARANGE] [OP_LIST_NUM2SUM] [OP_LIST_SUM] | var_a = 1
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
list_b=[]
for i in list_a:
var_d = 0
i = int(i)
while i//10 > 0:
var_d = var_d + i%10
i = i//10
var_d = var_d + i%10
list_b.append(var_d)
list_b = [float(i) for i in list_b]
var_e = sum(list_b)
print(int(var_e)) |
Arithmetic calculation | Hyunseo wants to exchange Korean money for Chinese money. It takes 161.5 Korean won to get 1 Chinese yuan. If you want to change 170,000 won in Korean money into 1000 yuan and 10 yuan in Chinese money, find how many 10 yuan you can get when you exchange as many 1000 yuan as possible. | 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)) |
Arithmetic calculation | If Yoongi's initial money is 3,800 won, and he receives 100 won every day from today, how much money will he have after 7 days? | 4500 | 3800 100 7 [OP_MUL] [OP_ADD] | var_a = 3800
var_b = 100
var_c = 7
var_d = var_b * var_c
var_e = var_a + var_d
print(int(var_e)) |
Comparison | The auditorium of Seoyoon's school is 1105 square meters (㎡), and the school has 650 students. The auditorium of Yerim's school is measured as 1440 square meters (㎡), and 960 students are attending the school. Which school has a larger auditorium per student? | Seoyoon | [OP_LIST_SOL] Seoyoon Yerim [OP_LIST_EOL] [OP_LIST_SOL] 1105 650 [OP_DIV] 1440 960 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Seoyoon'
var_b = 'Yerim'
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 = 1105
var_d = 650
var_e = var_c / var_d
var_f = 1440
var_g = 960
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) |
Correspondence | When 25 is divided by 4, the quotient is A and the remainder is B. What is A in this case? | 6 | 25 4 [OP_FDIV] | var_a = 25
var_b = 4
var_c = var_a // var_b
print(int(var_c)) |
Correspondence | Adding 34 to a certain number and subtracting 53 results in 28. Find the certain number. | 47 | 28 53 [OP_ADD] 34 [OP_SUB] | var_a = 28
var_b = 53
var_c = var_a + var_b
var_d = 34
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | If 1 blue ball is removed from a box containing 3 red balls, 2 blue balls, and 5 yellow balls, what is the number of yellow balls? | 5 | 5 | var_a = 5
print(int(var_a)) |
Possibility | There are balls with numbers from 1 to 9 written on them. Find how many ways there are when you pick 3 of them in order to make 19 by adding the numbers on the ball. | 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)) |
Geometry | How many vertices does the cube have? | 8 | 6 2 [OP_SUB] 2 [OP_MUL] | var_a = 6
var_b = 2
var_c = var_a - var_b
var_d = 2
var_e = var_c * var_d
print(int(var_e)) |
Possibility | Write the largest two-digit number that can be formed by drawing two different numbers from 1, 2, 4, and 6. | 64 | [OP_LIST_SOL] 1 2 4 6 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] | var_a = 1
var_b = 2
var_c = 4
var_d = 6
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = 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 = 1
list_c=list_b.copy()
list_c.sort()
var_g = list_c[-var_f]
print(int(var_g)) |
Arithmetic calculation | Hyeoncheol bought jelly with half of the money he had, and candy with half of the money he had left. If the remaining money was 1250 won, how much money did Hyuncheol have at the beginning? | 5000 | 1250 2 [OP_MUL] 2 [OP_MUL] | var_a = 1250
var_b = 2
var_c = var_a * var_b
var_d = 2
var_e = var_c * var_d
print(int(var_e)) |
Geometry | If the circumference of a rectangular book is 100 centimeters (cm) and the width is 20 centimeters (cm) when viewed from the front, what is the length of this book? | 30 | 100 2 [OP_DIV] 20 [OP_SUB] | var_a = 100
var_b = 2
var_c = var_a / var_b
var_d = 20
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | You sold 40 toys on Day 1. On Day 2, you sold 4 times the number of toys sold on Day 1. Find out the number of toys you sold more on Day 2 compared to Day 1. | 120 | 40 4 [OP_MUL] 40 [OP_SUB] | var_a = 40
var_b = 4
var_c = var_a * var_b
var_d = 40
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | Among the students in Jimin's class, 38 students like Korean, 39 students like math, and 32 students like both Korean and math. If there is no student who does not like both Korean and math, how many students are in Jimin's class? | 45 | 38 39 [OP_ADD] 32 [OP_SUB] | var_a = 38
var_b = 39
var_c = var_a + var_b
var_d = 32
var_e = var_c - var_d
print(int(var_e)) |
Correspondence | Dividing a certain number by 4, adding 25, and multiplying by 3, results in 150. Find the certain number. | 100 | 150 3 [OP_DIV] 25 [OP_SUB] 4 [OP_MUL] | var_a = 150
var_b = 3
var_c = var_a / var_b
var_d = 25
var_e = var_c - var_d
var_f = 4
var_g = var_e * var_f
print(int(var_g)) |
Comparison | 20 students stood in a line. Jungkook is in line for first place, and there are 5 students between Yoongi and Jungkook. How many students are standing behind Yoongi? | 13 | 20 1 [OP_SUB] 5 [OP_SUB] 1 [OP_SUB] | var_a = 20
var_b = 1
var_c = var_a - var_b
var_d = 5
var_e = var_c - var_d
var_f = 1
var_g = var_e - var_f
print(int(var_g)) |
Geometry | Young-jin arranged all the 10-won coins in his possession in a regular manner to form a square. If the number of coins placed around is 96, how much money does Young-jin have? | 6250 | 96 4 [OP_ADD] 4 [OP_DIV] 2 [OP_POW] 10 [OP_MUL] | var_a = 96
var_b = 4
var_c = var_a + var_b
var_d = 4
var_e = var_c / var_d
var_f = 2
var_g = var_e ** var_f
var_h = 10
var_i = var_g * var_h
print(int(var_i)) |
Correspondence | A is a single-digit number. Rounding down A27 from the hundreds place results in 200. What is A? | 2 | A27 [OP_GEN_POSSIBLE_LIST] 200 [OP_LIST_MORE_EQUAL] 200 100 [OP_ADD] [OP_LIST_LESS] A [OP_LIST_FIND_UNK] | var_a = 'A27'
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 = 200
list_b = []
for i in list_a:
if i >= var_b:
list_b.append(i)
var_c = 200
var_d = 100
var_e = var_c + var_d
list_c = []
for i in list_b:
if i < var_e:
list_c.append(i)
var_f = 'A'
var_a = str(var_a)
var_f = str(var_f)
unk_idx = var_a.index(var_f)
var_g = 0
for elem in list_c:
elem = str(elem)
var_g = int(elem[unk_idx])
print(int(var_g)) |
Arithmetic calculation | If you hand out 24 apples and 36 tangerines equally to many students as possible, how many students can you give? | 12 | 24 [OP_LIST_GET_DIVISOR] 36 [OP_LIST_GET_DIVISOR] [OP_SET_INTERSECT] 1 [OP_LIST_MAX] | var_a = 24
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 = 36
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 = 1
list_d=list_c.copy()
list_d.sort()
var_d = list_d[-var_c]
print(int(var_d)) |
Geometry | What is the diameter in centimeters (cm) of a solid figure obtained by rotating a semicircle with a radius of 4 centimeters (cm) once around its diameter? | 8 | 4 2 [OP_MUL] | var_a = 4
var_b = 2
var_c = var_a * var_b
print(int(var_c)) |
Comparison | Eunji is standing in the 8th column from the left, the 14th column from the right, the 7th row from the front, and the 15th row from the back and doing gymnastics. If the number of students standing in each row is the same, how many students are doing gymnastics? | 441 | 8 14 [OP_ADD] 1 [OP_SUB] 7 15 [OP_ADD] 1 [OP_SUB] [OP_MUL] | var_a = 8
var_b = 14
var_c = var_a + var_b
var_d = 1
var_e = var_c - var_d
var_f = 7
var_g = 15
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 | There are four numbers 10, 11, 12, and 13. What do you get if you multiply the smallest number by the second smallest number? | 110 | [OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_MUL] | var_a = 10
var_b = 11
var_c = 12
var_d = 13
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-1]
var_g = 2
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)) |
Comparison | Given that Taehyung, Minju, Sangmin, Yoonjung, and Yoojung crossed the end line of the race, who got in first? | Taehyung | [OP_LIST_SOL] Taehyung Minju Sangmin Yoonjung Yoojung [OP_LIST_EOL] 1 [OP_LIST_GET] | var_a = 'Taehyung'
var_b = 'Minju'
var_c = 'Sangmin'
var_d = 'Yoonjung'
var_e = 'Yoojung'
list_a= []
if "/" in str(var_e):
var_e = eval(str(var_e))
list_a.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_f = 1
var_g = list_a[var_f-1]
print(var_g) |
Correspondence | When 14 is divided by 3, the quotient is A and the remainder is 2. Find A. | 4 | 14 2 [OP_SUB] 3 [OP_DIV] | var_a = 14
var_b = 2
var_c = var_a - var_b
var_d = 3
var_e = var_c / var_d
print(int(var_e)) |
Geometry | For line segment AB with a length of 12 centimeters (cm), if point M is the midpoint of line segment AB and point N is the midpoint of line segment AM, find the length of segment NM. | 3 | 12 2 [OP_DIV] 2 [OP_DIV] | var_a = 12
var_b = 2
var_c = var_a / var_b
var_d = 2
var_e = var_c / var_d
print(int(var_e)) |
Correspondence | I added 36 to a number and it resulted in 71. Find the result of adding 10 to the number. | 45 | 71 36 [OP_SUB] 10 [OP_ADD] | var_a = 71
var_b = 36
var_c = var_a - var_b
var_d = 10
var_e = var_c + var_d
print(int(var_e)) |
Geometry | It is said that a polygon can draw one diagonal from one vertex. Find the number of sides of this polygon. | 4 | 1 3 [OP_ADD] | var_a = 1
var_b = 3
var_c = var_a + var_b
print(int(var_c)) |
Geometry | A rectangle is 5/6 meters (m) wide and 4/6 meters (m) long. How many meters (m) longer is the width of this rectangle than its length? | 0.17 | 5/6 4/6 [OP_SUB] | var_a = 0.8333333333333334
var_b = 0.6666666666666666
var_c = var_a - var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Arithmetic calculation | The museum has 500 paintings. If all pictures are numbered from 1 to 500 in order, find how many times the number 4 is written in each picture. | 200 | 1 500 1 [OP_LIST_ARANGE] [OP_LIST2NUM] [OP_NUM2LIST] 4 [OP_LIST_FIND_NUM] | var_a = 1
var_b = 500
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
var_d=""
for i in list_a:
i = str(i)
var_d = var_d + i
list_b = []
var_d = int(var_d)
while var_d//10 > 0:
list_b.append(var_d%10)
var_d = var_d//10
list_b.append(var_d%10)
list_b = list_b[::-1]
var_e = 4
var_f = 0
var_e = int(var_e)
for i in list_b:
i = int(i)
if i == var_e:
var_f = var_f + 1
print(int(var_f)) |
Arithmetic calculation | 58 people got off at the train's first stop and 37 got on at the next station. If there were 123 people on the train at first, how many people are still left? | 102 | 123 58 [OP_SUB] 37 [OP_ADD] | var_a = 123
var_b = 58
var_c = var_a - var_b
var_d = 37
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | There is a bag that is 5 meters (m) long and weighs 29/8 kilograms (kg) and a chair that is 4 meters (m) long and weighs 2.8 kilograms (kg). How many kilograms (kg) are the bag and chair if they are cut into 2 meters (m) and weighed together? | 2.85 | 29/8 5 [OP_DIV] 2 [OP_MUL] 2.8 4 [OP_DIV] 2 [OP_MUL] [OP_ADD] | var_a = 3.625
var_b = 5
var_c = var_a / var_b
var_d = 2
var_e = var_c * var_d
var_f = 2.8
var_g = 4
var_h = var_f / var_g
var_i = 2
var_j = var_h * var_i
var_k = var_e + var_j
print('{:.2f}'.format(round(var_k+1e-10,2))) |
Arithmetic calculation | Seven years ago, the father's age was three times the son's age. Eight years from this year, the sum of the ages of father and son will be 74. How old is the father after 8 years from now? | 48 | 74 8 2 [OP_MUL] [OP_SUB] 7 2 [OP_MUL] [OP_SUB] 3 1 [OP_ADD] [OP_FDIV] 3 [OP_MUL] 7 [OP_ADD] 8 [OP_ADD] | var_a = 74
var_b = 8
var_c = 2
var_d = var_b * var_c
var_e = var_a - var_d
var_f = 7
var_g = 2
var_h = var_f * var_g
var_i = var_e - var_h
var_j = 3
var_k = 1
var_l = var_j + var_k
var_m = var_i // var_l
var_n = 3
var_o = var_m * var_n
var_p = 7
var_q = var_o + var_p
var_r = 8
var_s = var_q + var_r
print(int(var_s)) |
Arithmetic calculation | Seokjin's Korean score is 93 points, and his English score is 91 points. If the average score of Korean, English, and Math is 89, what is his math score? | 83 | 89 3 [OP_MUL] 93 [OP_SUB] 91 [OP_SUB] | var_a = 89
var_b = 3
var_c = var_a * var_b
var_d = 93
var_e = var_c - var_d
var_f = 91
var_g = var_e - var_f
print(int(var_g)) |
Arithmetic calculation | I tried to hand out 98 tangerines equally to 12 people, but a few tangerines were short. I want to buy a few more tangerines so that I can hand them out equally. If the price of one tangerine is 450 won, at least how much more do I need? | 4500 | 12 98 12 [OP_MOD] [OP_SUB] 450 [OP_MUL] | var_a = 12
var_b = 98
var_c = 12
var_d = var_b % var_c
var_e = var_a - var_d
var_f = 450
var_g = var_e * var_f
print(int(var_g)) |
Geometry | A piece of paper is in the shape of a right triangle with a hypotenuse length of 13 and the non-hypotenuse side length of 12. What is the length of the other side? | 5 | 13 2 [OP_POW] 12 2 [OP_POW] [OP_SUB] 1/2 [OP_POW] | var_a = 13
var_b = 2
var_c = var_a ** var_b
var_d = 12
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)) |
Geometry | If the width of a cube is 12 centimeters (cm), the length is 16 centimeters (cm), and the height is 14 centimeters (cm), find the value of the surface area of the largest cube that can be made by cutting the cube. | 864 | [OP_LIST_SOL] 12 16 14 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_POW] 6 [OP_MUL] | var_a = 12
var_b = 16
var_c = 14
list_a= []
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_d = 1
list_b=list_a.copy()
list_b.sort()
var_e = list_b[var_d-1]
var_f = 2
var_g = var_e ** var_f
var_h = 6
var_i = var_g * var_h
print(int(var_i)) |
Arithmetic calculation | There are 5 vases. Each of the 5 vases has 4 flowers, and the 6 vases have 1 flower. How many flowers are there in the vase? | 26 | 4 5 [OP_MUL] 1 6 [OP_MUL] [OP_ADD] | var_a = 4
var_b = 5
var_c = var_a * var_b
var_d = 1
var_e = 6
var_f = var_d * var_e
var_g = var_c + var_f
print(int(var_g)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.