category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Comparison
There are a total of 4 numbers: 0.8, 1/2, 0.5, and 1/3. What is the smallest of these numbers greater than 0.1?
0.33
[OP_LIST_SOL] 0.8 1/2 0.5 1/3 [OP_LIST_EOL] 0.1 [OP_LIST_MORE] 1 [OP_LIST_MIN]
var_a = 0.8 var_b = 0.5 var_c = 0.5 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 = 0.1 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-1] print('{:.2f}'.format(round(var_g+1e-10,2)))
Comparison
Sora collected 4 and 6. Heesu collected 7 and 5, and Jiyeon collected 3 and 8. Who has the greatest sum of numbers?
Heesu
[OP_LIST_SOL] Sora Heesu Jiyeon [OP_LIST_EOL] [OP_LIST_SOL] 4 6 [OP_ADD] 7 5 [OP_ADD] 3 8 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Sora' var_b = 'Heesu' var_c = 'Jiyeon' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 4 var_e = 6 var_f = var_d + var_e var_g = 7 var_h = 5 var_i = var_g + var_h var_j = 3 var_k = 8 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)
Possibility
You want to create a two-digit number by drawing two different numbers from 1, 2, 4, and 6. Find the largest number among them.
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))
Geometry
You have a rectangle with a width of 6 centimeters (cm) and a perimeter of 28 centimeters (cm). What is the area of this rectangle?
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))
Geometry
Both sides of an isosceles triangle are 12 centimeters (cm) long, and the other side is 17 centimeters (cm) long. What is the perimeter of this isosceles triangle in centimeters (cm)?
41
12 2 [OP_MUL] 17 [OP_ADD]
var_a = 12 var_b = 2 var_c = var_a * var_b var_d = 17 var_e = var_c + var_d print(int(var_e))
Comparison
Try to find the smallest animal among (a), (b), (c), and (d). (d) is smaller than (a), (b) is larger than (c) and is smaller than (d). What is the answer?
(c)
[OP_LIST_SOL] (a) (b) (c) (d) [OP_LIST_EOL] [OP_LIST_SOL] (d) (a) < (b) (c) > (b) (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 = '(d)' var_f = '(a)' var_g = '<' var_h = '(b)' var_i = '(c)' var_j = '>' var_k = '(b)' 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)
Geometry
What is the length of the hypotenuse of a right triangle if the length of one non-hypotenuse is 6 and the other non-hypotenuse is 8?
10
6 2 [OP_POW] 8 2 [OP_POW] [OP_ADD] 1/2 [OP_POW]
var_a = 6 var_b = 2 var_c = var_a ** var_b var_d = 8 var_e = 2 var_f = var_d ** var_e var_g = var_c + var_f var_h = 0.5 var_i = var_g ** var_h print(int(var_i))
Possibility
When two out of five cards with the numbers 0, 1, 2, 3, and 4 written on them are drawn to form two-digit integers, find how many even numbers there are.
10
[OP_LIST_SOL] 0 1 2 3 4 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 2 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 2 var_d = 3 var_e = 4 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = 2 list_c = [] var_g = int(var_g) for i in list_b: i = int(i) if i % var_g == 0: list_c.append(i) var_h = len(list_c) print(int(var_h))
Comparison
Yoongi has 4 apples and Jungkook has 6 divided by 3 apples. Who has the greater number of apples?
Yoongi
[OP_LIST_SOL] Yoongi Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_FDIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yoongi' var_b = 'Jungkook' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 4 var_d = 6 var_e = 3 var_f = var_d // var_e list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) list_b.reverse() var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Correspondence
Hoseok multiplied a certain number by 11 and the result was 99. What is the certain number?
9
99 11 [OP_DIV]
var_a = 99 var_b = 11 var_c = var_a / var_b print(int(var_c))
Correspondence
When 10+A=15, find the correct number for A.
5
10+A=15 A [OP_DIGIT_UNK_SOLVER]
var_a = '10+A=15' 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
When AB+13=64, what number should go in A?
5
AB+13=64 A [OP_DIGIT_UNK_SOLVER]
var_a = 'AB+13=64' 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))
Geometry
Hyewon made pentagonal pillars with clay during art class and painted each side with a different color. How many colors did Hyewon paint on the pentagonal pillar?
7
2 5 [OP_ADD]
var_a = 2 var_b = 5 var_c = var_a + var_b print(int(var_c))
Correspondence
This year, 273 more students transferred from Seoul to Gyeonggi-do than vice versa. This year, there were 477 more students attending schools in Gyeonggi-do than students attending schools in Seoul. Find how many people were different last year.
1023
477 273 [OP_ADD] 273 [OP_ADD]
var_a = 477 var_b = 273 var_c = var_a + var_b var_d = 273 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
We are trying to fill a bathtub with a capacity of 140 liters (l) with a tap that produces 15 liters (l) of water in 3 minutes at a constant speed. How many minutes should I get water to fill this bathtub?
28
140 15 3 [OP_DIV] [OP_DIV]
var_a = 140 var_b = 15 var_c = 3 var_d = var_b / var_c var_e = var_a / var_d print(int(var_e))
Correspondence
When Minyoung divided 107.8 by a certain number, it became 9.8. Find out what the number is.
11
107.8 9.8 [OP_DIV]
var_a = 107.8 var_b = 9.8 var_c = var_a / var_b print(int(eval('{:.2f}'.format(round(var_c+1e-10,2)))))
Comparison
A triangle has a base of 10 centimeters (cm) and a height of 11 centimeters (cm). There is a square with a width of 8 centimeters (cm) and a length of 8 centimeters (cm), and the diameter of a circle is 8 centimeters (cm). Which shape has the widest area? Calculate the circumference ratio as 3.1.
square
[OP_LIST_SOL] triangle square circle [OP_LIST_EOL] [OP_LIST_SOL] 10 11 [OP_MUL] 2 [OP_DIV] 8 2 [OP_POW] 8 2 [OP_DIV] 2 [OP_POW] 3.1 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'triangle' var_b = 'square' var_c = 'circle' 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 = 10 var_e = 11 var_f = var_d * var_e var_g = 2 var_h = var_f / var_g var_i = 8 var_j = 2 var_k = var_i ** var_j var_l = 8 var_m = 2 var_n = var_l / var_m var_o = 2 var_p = var_n ** var_o var_q = 3.1 var_r = var_p * var_q list_b= [] if "/" in str(var_r): var_r = eval(str(var_r)) list_b.append(var_r) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) list_b.reverse() var_s = 1 list_c=list_b.copy() list_c.sort() var_t = list_c[-var_s] var_u = list_b.index(var_t)+1 var_v = list_a[var_u-1] print(var_v)
Comparison
In the running match, Taehyung did better than Jungkook and worse than Minyeong. If Minyoung is 5th and Jungkook is 7th, what rank is Taehyung?
6
7 5 [OP_ADD] 2 [OP_DIV]
var_a = 7 var_b = 5 var_c = var_a + var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Possibility
By using 5, 1, 7, 6, and a decimal point only once each, how many decimal numbers greater than 7 with three decimal places can you make?
6
[OP_LIST_SOL] 5 1 7 6 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 7 10 4 1 [OP_SUB] [OP_POW] [OP_MUL] [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 5 var_b = 1 var_c = 7 var_d = 6 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 4 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 7 var_g = 10 var_h = 4 var_i = 1 var_j = var_h - var_i var_k = var_g ** var_j var_l = var_f * var_k list_c = [] for i in list_b: if i > var_l: list_c.append(i) var_m = len(list_c) print(int(var_m))
Comparison
20 different cars are parked in a row. If the black car is 16th from the right and the white car is 11th from the left, how many total cars are parked between the two cars?
5
16 11 [OP_ADD] 20 [OP_SUB] 2 [OP_SUB]
var_a = 16 var_b = 11 var_c = var_a + var_b var_d = 20 var_e = var_c - var_d var_f = 2 var_g = var_e - var_f print(int(var_g))
Arithmetic calculation
Minjeong and Soohyeok's piggy banks currently contain 8,000 won and 5,000 won, respectively. If Minjeong puts 300 won and Soohyeok puts 500 won into their piggy bank every day, starting tomorrow, how many days later will the money in Minjeong's and Soohyeok's piggy banks become the same?
15
8000 5000 [OP_SUB] 500 300 [OP_SUB] [OP_DIV]
var_a = 8000 var_b = 5000 var_c = var_a - var_b var_d = 500 var_e = 300 var_f = var_d - var_e var_g = var_c / var_f print(int(var_g))
Geometry
If the length of the hypotenuse of a right triangle is 13 and the length of a non-hypotenuse is 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))
Correspondence
When a number is divided by 23, the quotient is 17 and the remainder is 19. When this number is multiplied by 10 and then divided by 23, find the sum of its quotient and remainder.
184
23 17 [OP_MUL] 19 [OP_ADD] 10 [OP_MUL] 23 [OP_FDIV] 23 17 [OP_MUL] 19 [OP_ADD] 10 [OP_MUL] 23 [OP_MOD] [OP_ADD]
var_a = 23 var_b = 17 var_c = var_a * var_b var_d = 19 var_e = var_c + var_d var_f = 10 var_g = var_e * var_f var_h = 23 var_i = var_g // var_h var_j = 23 var_k = 17 var_l = var_j * var_k var_m = 19 var_n = var_l + var_m var_o = 10 var_p = var_n * var_o var_q = 23 var_r = var_p % var_q var_s = var_i + var_r print(int(var_s))
Arithmetic calculation
There were 1238 apples and 374 more pears than apples in the fruit shop. Of these, a few apples were sold, and 276 pears were bought, so the total of apples and pears was 2527. How many apples have been sold?
599
1238 2527 1238 374 [OP_ADD] 276 [OP_ADD] [OP_SUB] [OP_SUB]
var_a = 1238 var_b = 2527 var_c = 1238 var_d = 374 var_e = var_c + var_d var_f = 276 var_g = var_e + var_f var_h = var_b - var_g var_i = var_a - var_h print(int(var_i))
Arithmetic calculation
There are three numbers: 10, 11 and 12. What is the product of the second largest number and the smallest number?
110
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 2 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_MUL]
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
Se-hee has a box in the shape of a cube with 1 meter (m) long, and Se-rin has a cuboid-shaped box with a width of 50 centimeters (cm), a depth of 50 centimeters (cm) and a height of 20 centimeters (cm). How many times larger is the volume of Se-hee's box than the volume of Serin's box?
20
1 100 [OP_MUL] 3 [OP_POW] 50 50 [OP_MUL] 20 [OP_MUL] [OP_DIV]
var_a = 1 var_b = 100 var_c = var_a * var_b var_d = 3 var_e = var_c ** var_d var_f = 50 var_g = 50 var_h = var_f * var_g var_i = 20 var_j = var_h * var_i var_k = var_e / var_j print(int(var_k))
Comparison
Four whales are swimming. (a) Whales are faster than (b) whales, and both (b) whales and (d) whales are faster than (c) whales. (d) Whales are faster than (a) whales. Which of these whales is the slowest?
(c)
[OP_LIST_SOL] (a) (b) (c) (d) [OP_LIST_EOL] [OP_LIST_SOL] (a) (b) > (b) (c) > (c) (d) < (d) (a) > [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 = '(b)' var_g = '>' var_h = '(b)' var_i = '(c)' var_j = '>' var_k = '(c)' var_l = '(d)' var_m = '<' var_n = '(d)' var_o = '(a)' var_p = '>' list_b= [] 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) 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_q = len(list_c) var_r = list_c[var_q-1] print(var_r)
Correspondence
The two-digit number 6A+B2=77. How much is B?
1
6A+B2=77 B [OP_DIGIT_UNK_SOLVER]
var_a = '6A+B2=77' var_b = 'B' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Geometry
There is a rhombic playground. Find the area of the playground if one diagonal of the playground is 14 meters (m) and the other diagonal is 24 meters (m).
168
14 24 [OP_MUL] 2 [OP_DIV]
var_a = 14 var_b = 24 var_c = var_a * var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Correspondence
A and B are single-digit numbers. If A15B94 is a multiple of 99, find A+B.
8
A15B94 [OP_GEN_POSSIBLE_LIST] 99 [OP_LIST_DIVISIBLE] A15B94 A [OP_LIST_FIND_UNK] A15B94 B [OP_LIST_FIND_UNK] [OP_ADD]
var_a = 'A15B94' 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 = 99 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 = 'A15B94' var_d = 'A' var_c = str(var_c) var_d = str(var_d) unk_idx = var_c.index(var_d) var_e = 0 for elem in list_b: elem = str(elem) var_e = int(elem[unk_idx]) var_f = 'A15B94' var_g = 'B' var_f = str(var_f) var_g = str(var_g) unk_idx = var_f.index(var_g) var_h = 0 for elem in list_b: elem = str(elem) var_h = int(elem[unk_idx]) var_i = var_e + var_h print(int(var_i))
Arithmetic calculation
Eunji has 35 candies. If Jimin has 6 more candies than Eunji and Jihyun has 3 fewer candies than Eunji, what is the average number of candies the three of them have?
36
35 35 6 [OP_ADD] [OP_ADD] 35 3 [OP_SUB] [OP_ADD] 3 [OP_DIV]
var_a = 35 var_b = 35 var_c = 6 var_d = var_b + var_c var_e = var_a + var_d var_f = 35 var_g = 3 var_h = var_f - var_g var_i = var_e + var_h var_j = 3 var_k = var_i / var_j print(int(var_k))
Possibility
When Beomjin tries to put 2 Math books and 2 English books on the bookshelf, how many times can he put the math books side by side?
12
[OP_LIST_SOL] Math English [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_MUL] 1 [OP_SUB] [OP_LIST_LEN] 2 [OP_MUL] 1 [OP_SUB] [OP_PERM] 2 [OP_MUL]
var_a = 'Math' var_b = 'English' 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 = len(list_a) var_d = 2 var_e = var_c * var_d var_f = 1 var_g = var_e - var_f var_h = len(list_a) var_i = 2 var_j = var_h * var_i var_k = 1 var_l = var_j - 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 = 2 var_o = var_m * var_n print(int(var_o))
Geometry
The sum of the lengths of all the edges of a hexagonal prism is 81 centimeters (cm), and all edges are the same length. In a quadrangular pyramid, all edges are the same length, and one edge is equal to the length of the edges of a hexagonal prism. Find the sum of the lengths of all the edges of the quadrangular pyramid.
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))
Arithmetic calculation
Jungkook has 3 bundles of 10 pieces of colored paper each and 8 individual pieces. How many pieces of colored paper does Jungkook have?
38
10 3 [OP_MUL] 8 [OP_ADD]
var_a = 10 var_b = 3 var_c = var_a * var_b var_d = 8 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
There are 6/5 and 1/10. What is their sum?
1.3
6/5 1/10 [OP_ADD]
var_a = 1.2 var_b = 0.1 var_c = var_a + var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
Divide a number by 2.5, divide by 3.1, add 3.1, and you get 8.9. Find out what the number is.
44.95
8.9 3.1 [OP_SUB] 3.1 [OP_MUL] 2.5 [OP_MUL]
var_a = 8.9 var_b = 3.1 var_c = var_a - var_b var_d = 3.1 var_e = var_c * var_d var_f = 2.5 var_g = var_e * var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Comparison
Yoongi stands in the 7th row from the left, the 13th row from the right, the 8th row from the front, and the 14th row from the back to receive the gift being handed out. If the number of people in each line is the same and each person gets 2 gifts, how many gifts will everyone in the line get?
798
7 13 [OP_ADD] 1 [OP_SUB] 8 14 [OP_ADD] 1 [OP_SUB] [OP_MUL] 2 [OP_MUL]
var_a = 7 var_b = 13 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d var_f = 8 var_g = 14 var_h = var_f + var_g var_i = 1 var_j = var_h - var_i var_k = var_e * var_j var_l = 2 var_m = var_k * var_l print(int(var_m))
Comparison
The yellow toy is 10th from the left and 7th from the right. How many toys are there if they are placed in a row?
16
10 7 [OP_ADD] 1 [OP_SUB]
var_a = 10 var_b = 7 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Possibility
A can be a natural number from 1 to 9. If 57×7>65×A, what is the sum of the numbers that can be A?
21
1 9 1 [OP_LIST_ARANGE] 57 7 [OP_MUL] 65 [OP_DIV] [OP_LIST_LESS] [OP_LIST_SUM]
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 = 57 var_e = 7 var_f = var_d * var_e var_g = 65 var_h = var_f / var_g list_b = [] for i in list_a: if i < var_h: list_b.append(i) list_b = [float(i) for i in list_b] var_i = sum(list_b) print(int(var_i))
Arithmetic calculation
In a park with a perimeter of 18 kilometers (km), Soyun and Jia started off at the same time from the same place, but in opposite directions, and met on the way. It is said that Soyun ran at 5 kilometers (km) per hour and Jia ran at 4 kilometers (km) per hour. How far did Soyun run?
10
18 5 4 [OP_ADD] [OP_DIV] 5 [OP_MUL]
var_a = 18 var_b = 5 var_c = 4 var_d = var_b + var_c var_e = var_a / var_d var_f = 5 var_g = var_e * var_f print(int(var_g))
Arithmetic calculation
What is the sum of odd numbers more than 1 and not more than 9 that are less than 6?
9
1 9 [OP_LIST_ODD] 6 [OP_LIST_LESS] [OP_LIST_SUM]
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 = 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) print(int(var_d))
Possibility
Of the 4 cards with the numbers 6, 7, 8, and 9 written on them, we want to select two cards by allowing duplicates. How many possible cases are there?
10
[OP_LIST_SOL] 6 7 8 9 [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_ADD] 1 [OP_SUB] 2 [OP_COMB]
var_a = 6 var_b = 7 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 = len(list_a) var_f = 2 var_g = var_e + var_f var_h = 1 var_i = var_g - var_h var_j = 2 var_k = 1 var_i = int(var_i) var_j = int(var_j) for i, elem in enumerate(range(var_j)): var_k = var_k * (var_i-i) for i, elem in enumerate(range(var_j)): var_k = var_k / (i+1) print(int(var_k))
Arithmetic calculation
There is a car that can travel 20.57 kilometers (km) with 1.7 liters (L) of gasoline. If the price of gasoline is 1600 won per liter (L), how much gasoline does this car need to travel 91.66 kilometers (km)?
12120.33
1.7 20.57 [OP_DIV] 91.66 [OP_MUL] 1600 [OP_MUL]
var_a = 1.7 var_b = 20.57 var_c = var_a / var_b var_d = 91.66 var_e = var_c * var_d var_f = 1600 var_g = var_e * var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Arithmetic calculation
You are going to make a long wire by splicing 15 pieces of wire together that are 25 centimeters (cm) long. If 0.5 centimeters (cm) of wire is overlapped to join the wires together, find how many meters (m) the length of the wire is spliced together.
3.68
25 25 0.5 [OP_SUB] 15 1 [OP_SUB] [OP_MUL] [OP_ADD] 100 [OP_DIV]
var_a = 25 var_b = 25 var_c = 0.5 var_d = var_b - var_c var_e = 15 var_f = 1 var_g = var_e - var_f var_h = var_d * var_g var_i = var_a + var_h var_j = 100 var_k = var_i / var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Correspondence
You mistakenly divided a number by 21 instead of by 12, and it was divisible by 4. Find the quotient when calculated correctly.
7
4 21 [OP_MUL] 12 [OP_FDIV]
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))
Arithmetic calculation
There were 9 volleyballs. You lent 5 of them to other schools. How many volleyballs are currently there?
4
9 5 [OP_SUB]
var_a = 9 var_b = 5 var_c = var_a - var_b print(int(var_c))
Geometry
How many vertices are there in a pyramid whose base is a regular polygon made up of six equal angles?
7
6 1 [OP_ADD]
var_a = 6 var_b = 1 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
You want to plant 24 trees equally spaced on one side of a road that is 239.66 meters (m) long. If one tree is planted at the beginning and one at the end of the road, how many meters (m) should be spaced between the trees?
10.42
239.66 24 1 [OP_SUB] [OP_DIV]
var_a = 239.66 var_b = 24 var_c = 1 var_d = var_b - var_c var_e = var_a / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
Yonghee stood on the scale holding a bag weighing 1 kilogram (kg) and 750 grams (g), and the scale indicated 35 kilograms (kg) and 500 grams (g). How many kilograms (kg) will the scale show if Yonghee stands on the scale carrying his younger brother who weighs 27 kilograms (kg) and 200 grams (g) on his back?
60.95
35 500 1000 [OP_DIV] [OP_ADD] 1 750 1000 [OP_DIV] [OP_ADD] [OP_SUB] 27 200 1000 [OP_DIV] [OP_ADD] [OP_ADD]
var_a = 35 var_b = 500 var_c = 1000 var_d = var_b / var_c var_e = var_a + var_d var_f = 1 var_g = 750 var_h = 1000 var_i = var_g / var_h var_j = var_f + var_i var_k = var_e - var_j var_l = 27 var_m = 200 var_n = 1000 var_o = var_m / var_n var_p = var_l + var_o var_q = var_k + var_p print('{:.2f}'.format(round(var_q+1e-10,2)))
Comparison
There are four numbers A, B, C, and D. A is 3 times 3. B is 15 less than C. C is a number four times A. D is 19 greater than A. Which of A, B, C, and D is the 2nd largest number?
D
[OP_LIST_SOL] A C B D [OP_LIST_EOL] [OP_LIST_SOL] 3 3 [OP_MUL] 3 3 4 [OP_MUL] [OP_MUL] 9 4 19 [OP_MUL] [OP_SUB] 3 3 19 [OP_MUL] [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'A' var_b = 'C' var_c = 'B' 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 = 3 var_f = 3 var_g = var_e * var_f var_h = 3 var_i = 3 var_j = 4 var_k = var_i * var_j var_l = var_h * var_k var_m = 9 var_n = 4 var_o = 19 var_p = var_n * var_o var_q = var_m - var_p var_r = 3 var_s = 3 var_t = 19 var_u = var_s * var_t var_v = var_r + var_u list_b= [] if "/" in str(var_v): var_v = eval(str(var_v)) list_b.append(var_v) if "/" in str(var_q): var_q = eval(str(var_q)) list_b.append(var_q) if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) list_b.reverse() var_w = 1 list_c=list_b.copy() list_c.sort() var_x = list_c[-var_w] var_y = list_b.index(var_x)+1 var_z = list_a[var_y-1] print(var_z)
Correspondence
There are fruits in the basket. If you divide this fruit equally to 30 people, you will have 14 fruits left over, if you share it equally with 50 people, you will have 24 fruits left over, and if you share it equally with 70 people, you will have 34 fruits left over. Find the minimum number of fruits in the basket.
524
0 9999 1 [OP_LIST_ARANGE] 30 14 [OP_LIST_DIVIDE_AND_REMAIN] 50 24 [OP_LIST_DIVIDE_AND_REMAIN] 70 34 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_MIN]
var_a = 0 var_b = 9999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 30 var_e = 14 list_b = [] var_d = int(var_d) var_e = int(var_e) if var_e < 0: var_e = var_e + var_d for i in list_a: i = int(i) if i%var_d == var_e: list_b.append(i) var_f = 50 var_g = 24 list_c = [] var_f = int(var_f) var_g = int(var_g) if var_g < 0: var_g = var_g + var_f for i in list_b: i = int(i) if i%var_f == var_g: list_c.append(i) var_h = 70 var_i = 34 list_d = [] var_h = int(var_h) var_i = int(var_i) if var_i < 0: var_i = var_i + var_h for i in list_c: i = int(i) if i%var_h == var_i: list_d.append(i) var_j = 1 list_e=list_d.copy() list_e.sort() var_k = list_e[var_j-1] print(int(var_k))
Comparison
Eunmi solved 288 questions in 12 days, and Junhyeok solved 243 questions in 9 days. Who solved more problems in one day?
Junhyeok
[OP_LIST_SOL] Eunmi Junhyeok [OP_LIST_EOL] [OP_LIST_SOL] 288 12 [OP_DIV] 243 9 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Eunmi' var_b = 'Junhyeok' 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 = 288 var_d = 12 var_e = var_c / var_d var_f = 243 var_g = 9 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
7A7 rounded up to the tens place is 730. Find A
2
7A7 [OP_GEN_POSSIBLE_LIST] 730 [OP_LIST_LESS_EQUAL] 730 10 [OP_SUB] [OP_LIST_MORE] 7A7 A [OP_LIST_FIND_UNK]
var_a = '7A7' 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 = 730 list_b = [] for i in list_a: if i <= var_b: list_b.append(i) var_c = 730 var_d = 10 var_e = var_c - var_d list_c = [] for i in list_b: if i > var_e: list_c.append(i) var_f = '7A7' var_g = 'A' var_f = str(var_f) var_g = str(var_g) unk_idx = var_f.index(var_g) var_h = 0 for elem in list_c: elem = str(elem) var_h = int(elem[unk_idx]) print(int(var_h))
Geometry
Find the length of a side of an equilateral triangle that has the same perimeter as a square with a side length of 21 centimeters (cm) in centimeters (cm).
28
21 4 [OP_MUL] 3 [OP_DIV]
var_a = 21 var_b = 4 var_c = var_a * var_b var_d = 3 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
There is a paper strip with press nails inserted at 3 centimeters (cm) intervals. Pressing nails are inserted at both ends of the paper strip, and how many pressing nails are there when the length of the paper strip is 114 centimeters (cm)?
39
114 3 [OP_DIV] 1 [OP_ADD]
var_a = 114 var_b = 3 var_c = var_a / var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Correspondence
When a certain number is divided by 37, the quotient is 23 and the remainder is 16. What is the certain number?
867
23 37 [OP_MUL] 16 [OP_ADD]
var_a = 23 var_b = 37 var_c = var_a * var_b var_d = 16 var_e = var_c + var_d print(int(var_e))
Comparison
There were four students running in a race. Minyoung was faster than Yoongi. Yoongi was faster than Jimin. Jimin was slower than Yuna. Minyoung was slower than Yuna. Who would be the number 1?
Yuna
[OP_LIST_SOL] Minyoung Yoongi Jimin Yuna [OP_LIST_EOL] [OP_LIST_SOL] Minyoung Yoongi > Yoongi Jimin > Jimin Yuna < Minyoung Yuna < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'Minyoung' var_b = 'Yoongi' var_c = 'Jimin' var_d = 'Yuna' 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 = 'Minyoung' var_f = 'Yoongi' var_g = '>' var_h = 'Yoongi' var_i = 'Jimin' var_j = '>' var_k = 'Jimin' var_l = 'Yuna' var_m = '<' var_n = 'Minyoung' var_o = 'Yuna' var_p = '<' list_b= [] 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) 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_q = 1 var_r = list_c[var_q-1] print(var_r)
Geometry
You have a rectangular piece of paper measuring 63 centimeters (cm) wide and 42 centimeters (cm) long. You want to cut several pieces of this paper into the largest square shapes without any remainder. How many centimeters (cm) should each side of the square be?
21
63 42 [OP_GCD]
var_a = 63 var_b = 42 var_c = math.gcd(int(var_b), int(var_a)) print(int(var_c))
Correspondence
What number must go in A to make 632-5AB=41?
9
632-5AB=41 A [OP_DIGIT_UNK_SOLVER]
var_a = '632-5AB=41' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Arithmetic calculation
Ten ginkgo trees are planted on one side of the playground at intervals of 10 meters (m). If ginkgo trees are planted at both the beginning and the end, find the length in meters (m) of this field.
90
10 1 [OP_SUB] 10 [OP_MUL]
var_a = 10 var_b = 1 var_c = var_a - var_b var_d = 10 var_e = var_c * var_d print(int(var_e))
Possibility
You are trying to pick a class president and a vice-captain from Jungkook, Jimin, Yoongi, Yuna, and Taehyung. How many possible cases are there?
20
[OP_LIST_SOL] Jungkook Jimin Yoongi Yuna Taehyung [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_PERM]
var_a = 'Jungkook' var_b = 'Jimin' var_c = 'Yoongi' var_d = 'Yuna' var_e = 'Taehyung' 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 = len(list_a) var_g = 2 var_h = 1 var_f = int(var_f) var_g = int(var_g) for i, elem in enumerate(range(var_g)): var_h = var_h * (var_f-i) print(int(var_h))
Possibility
There are 5 marbles: red, blue, yellow, purple and black. You're going to pick two of these and play marbles. Find the number of cases.
10
5 2 [OP_COMB]
var_a = 5 var_b = 2 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) for i, elem in enumerate(range(var_b)): var_c = var_c / (i+1) print(int(var_c))
Arithmetic calculation
12 of the 5th graders participated in the basketball game. The number of students participating in basketball games from the sixth grade is 6 times the number of 5th graders who joined the game. How many 5th and 6th graders participated in the game?
84
12 12 6 [OP_MUL] [OP_ADD]
var_a = 12 var_b = 12 var_c = 6 var_d = var_b * var_c var_e = var_a + var_d print(int(var_e))
Correspondence
When you divide 69 by a number, the remainder is 5, and when you divide 86, the remainder is 6. Write a process to solve what is the largest number that can be the number and find the answer.
16
69 5 [OP_SUB] 86 6 [OP_SUB] [OP_GCD]
var_a = 69 var_b = 5 var_c = var_a - var_b var_d = 86 var_e = 6 var_f = var_d - var_e var_g = math.gcd(int(var_f), int(var_c)) print(int(var_g))
Arithmetic calculation
There is a bowl with the same 14 pieces of food on it. If the weight of this bowl is 11.14 kg (kg), how much kg (kg) will one piece of food weigh if the empty bowl weighs 0.5 kg (kg)?
0.76
11.14 0.5 [OP_SUB] 14 [OP_DIV]
var_a = 11.14 var_b = 0.5 var_c = var_a - var_b var_d = 14 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Possibility
A three-digit number was created using three of the numbers 0, 1, 2, 3, and 5. How many numbers can be made if each digit is different?
48
[OP_LIST_SOL] 0 1 2 3 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 2 var_d = 3 var_e = 5 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = len(list_b) print(int(var_g))
Arithmetic calculation
Gyuri does 1/3 of her homework for 5 days, and Seungyeon does 1/5 of her homework for 2 days. If they do their homework together, how many days will it take to finish the work?
6
1 1/3 5 [OP_DIV] 1/5 2 [OP_DIV] [OP_ADD] [OP_DIV]
var_a = 1 var_b = 0.3333333333333333 var_c = 5 var_d = var_b / var_c var_e = 0.2 var_f = 2 var_g = var_e / var_f var_h = var_d + var_g var_i = var_a / var_h print(int(eval('{:.2f}'.format(round(var_i+1e-10,2)))))
Comparison
The volumes of buckets A and B are 1100 milliliters (ml), and 3 liters (L) and 400 milliliters (ml), respectively. When the weights of these two buckets are added, which one has more volume compared to the kettle with 4 liters (L) and 800 milliliters (ml)?
kettle
[OP_LIST_SOL] kettle bucket [OP_LIST_EOL] [OP_LIST_SOL] 4 1000 [OP_MUL] 800 [OP_ADD] 1100 3 1000 [OP_MUL] 400 [OP_ADD] [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'kettle' var_b = 'bucket' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 4 var_d = 1000 var_e = var_c * var_d var_f = 800 var_g = var_e + var_f var_h = 1100 var_i = 3 var_j = 1000 var_k = var_i * var_j var_l = 400 var_m = var_k + var_l var_n = var_h + var_m list_b= [] if "/" in str(var_n): var_n = eval(str(var_n)) list_b.append(var_n) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) list_b.reverse() var_o = 1 list_c=list_b.copy() list_c.sort() var_p = list_c[-var_o] var_q = list_b.index(var_p)+1 var_r = list_a[var_q-1] print(var_r)
Comparison
9 students are running a race. Yoongi was running in 7th place and passed 4 other students. How many students are running behind Yoongi?
6
9 7 4 [OP_SUB] [OP_SUB]
var_a = 9 var_b = 7 var_c = 4 var_d = var_b - var_c var_e = var_a - var_d print(int(var_e))
Geometry
How many bases does a pyramid have?
1
1
var_a = 1 print(int(var_a))
Correspondence
The seven-digit number 95738AB is divisible by 5, and A and B can have any number from 0 to 9. How many numbers can satisfy these conditions?
20
95738AB [OP_GEN_POSSIBLE_LIST] 5 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = '95738AB' 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 = 5 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))
Geometry
There is a cuboid with a base area of 36 square centimeters (cm2). The volume of this cuboid is 252 cubic centimeters (cm3). Find the height of this cuboid.
7
252 36 1 [OP_MUL] [OP_DIV]
var_a = 252 var_b = 36 var_c = 1 var_d = var_b * var_c var_e = var_a / var_d print(int(var_e))
Possibility
Yeonseo has more than two types of skirts and pants each. If there are 4 types of pants and 7 ways to choose pants or skirts, find the number of cases that Yeonseo chooses a skirt.
3
7 4 [OP_SUB]
var_a = 7 var_b = 4 var_c = var_a - var_b print(int(var_c))
Arithmetic calculation
Seungchan read 0.2 of the children's book until yesterday, and today, he read 0.35 of the rest of the children's book, so there are 130 pages left. How many pages are there in the children's book Seungchan is reading?
250
130 1 0.35 [OP_SUB] [OP_DIV] 1 0.2 [OP_SUB] [OP_DIV]
var_a = 130 var_b = 1 var_c = 0.35 var_d = var_b - var_c var_e = var_a / var_d var_f = 1 var_g = 0.2 var_h = var_f - var_g var_i = var_e / var_h print(int(var_i))
Possibility
Find the number of three-digit natural numbers that can be made by drawing three of the number cards 2, 4, 6, 7, and 9.
60
[OP_LIST_SOL] 2 4 6 7 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 2 var_b = 4 var_c = 6 var_d = 7 var_e = 9 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = len(list_b) print(int(var_g))
Geometry
There is an equilateral triangle whose sum of the lengths of three sides is the same as the sum of the lengths of four sides of a rectangle that is 125 centimeters (cm) wide and 115 centimeters (cm) long. Find the length in centimeters (cm) of one side of this equilateral triangle.
160
125 115 [OP_ADD] 2 [OP_MUL] 3 [OP_DIV]
var_a = 125 var_b = 115 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))
Correspondence
27A8 minus 1203 is greater than 1022. How many digits from 0 to 9 can be written for A?
10
27A8 [OP_GEN_POSSIBLE_LIST] 1022 1203 [OP_ADD] [OP_LIST_MORE] 27A8 A [OP_LIST_FIND_UNK] [OP_LIST_LEN]
var_a = '27A8' 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 = 1022 var_c = 1203 var_d = var_b + var_c list_b = [] for i in list_a: if i > var_d: list_b.append(i) var_e = '27A8' 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))
Correspondence
0.375 is the result of moving a decimal point three places to the left and multiplying it by 10. Find the original decimal number including the decimal point.
37.5
0.375 10 3 [OP_POW] [OP_MUL] 10 [OP_DIV]
var_a = 0.375 var_b = 10 var_c = 3 var_d = var_b ** var_c var_e = var_a * var_d var_f = 10 var_g = var_e / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Possibility
Find the sum of the largest and the third smallest three-digit numbers that can be formed by using all even numbers greater than 1 and less than 7 once.
1068
1 1 [OP_ADD] 7 1 [OP_SUB] [OP_LIST_EVEN] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_ADD]
var_a = 1 var_b = 1 var_c = var_a + var_b var_d = 7 var_e = 1 var_f = var_d - var_e list_a = [] if var_c%2!=0: for i in range(var_c+1, var_f+1, 2): list_a.append(i) else: for i in range(var_c, var_f+1, 2): list_a.append(i) var_g = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_g)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_h = 1 list_c=list_b.copy() list_c.sort() var_i = list_c[-var_h] var_j = 3 list_d=list_b.copy() list_d.sort() var_k = list_d[var_j-1] var_l = var_i + var_k print(int(var_l))
Correspondence
There is a four-digit number 6A42 which becomes 6000, when rounded to the hundred's place. How many possible A's are there if A can fit from 0 to 9?
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))
Possibility
How many numbers less than 1000 and greater than 100 can you make by using all of the number cards 4, 2, and 5 once?
6
[OP_LIST_SOL] 4 2 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 4 var_b = 2 var_c = 5 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 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 = len(list_b) print(int(var_e))
Possibility
We took two fruits out of a basket with one apple, one peach, one pear, and one melon each. How many ways are there for the selected fruit?
6
[OP_LIST_SOL] apple peach pear melon [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_COMB]
var_a = 'apple' var_b = 'peach' var_c = 'pear' var_d = 'melon' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = len(list_a) var_f = 2 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
There are candy bags with 30 candies in each bag. If you put all 254 candies in and there is no space left in all the bags, find out how many more candies you need to buy.
16
30 254 30 [OP_MOD] [OP_SUB]
var_a = 30 var_b = 254 var_c = 30 var_d = var_b % var_c var_e = var_a - var_d print(int(var_e))
Geometry
A daycare center decided to give Christmas presents to children. The gift is in the shape of a cuboid measuring 8 centimeters (cm) in width, 12 centimeters (cm) in depth, and 30 centimeters (cm) in height. The presents are neatly stacked in the shape of a box cube. If you use the least number of gift boxes, how many gift boxes are there in total?
600
8 12 [OP_LCM] 30 [OP_LCM] 8 [OP_DIV] 8 12 [OP_LCM] 30 [OP_LCM] 12 [OP_DIV] 8 12 [OP_LCM] 30 [OP_LCM] 30 [OP_DIV] [OP_MUL] [OP_MUL]
var_a = 8 var_b = 12 var_c = var_b * var_a / math.gcd(int(var_b), int(var_a)) var_d = 30 var_e = var_d * var_c / math.gcd(int(var_d), int(var_c)) var_f = 8 var_g = var_e / var_f var_h = 8 var_i = 12 var_j = var_i * var_h / math.gcd(int(var_i), int(var_h)) var_k = 30 var_l = var_k * var_j / math.gcd(int(var_k), int(var_j)) var_m = 12 var_n = var_l / var_m var_o = 8 var_p = 12 var_q = var_p * var_o / math.gcd(int(var_p), int(var_o)) var_r = 30 var_s = var_r * var_q / math.gcd(int(var_r), int(var_q)) var_t = 30 var_u = var_s / var_t var_v = var_n * var_u var_w = var_g * var_v print(int(var_w))
Possibility
How many numbers are greater than 450, have different digits, and are consisted of 3, 4, and 6?
3
[OP_LIST_SOL] 3 4 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 450 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 3 var_b = 4 var_c = 6 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 = 450 list_c = [] for i in list_b: if i > var_e: list_c.append(i) var_f = len(list_c) print(int(var_f))
Arithmetic calculation
Jungkook's average score for Korean and English is 88 points, and his Math score is 100 points. What is Jungkook's average score of the three subjects?
92
88 2 [OP_MUL] 100 [OP_ADD] 2 1 [OP_ADD] [OP_DIV]
var_a = 88 var_b = 2 var_c = var_a * var_b var_d = 100 var_e = var_c + var_d var_f = 2 var_g = 1 var_h = var_f + var_g var_i = var_e / var_h print(int(var_i))
Geometry
A square-shaped park with a side of 20 meters (m) is to be divided into 9 zones by dividing each side into thirds. What is the area of the divided area in square meters (m2)?
44.44
20 3 [OP_DIV] 2 [OP_POW]
var_a = 20 var_b = 3 var_c = var_a / var_b var_d = 2 var_e = var_c ** var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
Youngsoo's school received an average of 75 points in the Korean midterm in class 1, 85 in class 2, 90 in class 3, and 65 in class 4. What is the sum of the averages of the classes below the school's midterm exam average?
140
[OP_LIST_SOL] 75 85 90 65 [OP_LIST_EOL] [OP_LIST_MEAN] [OP_LIST_LESS] [OP_LIST_SUM]
var_a = 75 var_b = 85 var_c = 90 var_d = 65 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() list_a = [float(i) for i in list_a] var_e = sum(list_a)/len(list_a) list_b = [] for i in list_a: if i < var_e: list_b.append(i) list_b = [float(i) for i in list_b] var_f = sum(list_b) print(int(var_f))
Correspondence
What number must go in A to make A72-23=549?
5
A72-23=549 A [OP_DIGIT_UNK_SOLVER]
var_a = 'A72-23=549' 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
When I distributed pencils equally to 8 people, I could give 6 pencils each and there was 4 left. If you divide the same number of pencils equally among 4 people, how many can you distribute?
13
6 8 [OP_MUL] 4 [OP_ADD] 4 [OP_DIV]
var_a = 6 var_b = 8 var_c = var_a * var_b var_d = 4 var_e = var_c + var_d var_f = 4 var_g = var_e / var_f print(int(var_g))
Possibility
Find the sum of the largest and smallest two-digit numbers that can be formed by drawing out two different numbers from 3, 5, 7, and 8.
122
[OP_LIST_SOL] 3 5 7 8 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD]
var_a = 3 var_b = 5 var_c = 7 var_d = 8 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] var_h = 1 list_d=list_b.copy() list_d.sort() var_i = list_d[var_h-1] var_j = var_g + var_i print(int(var_j))
Possibility
A thief has found a secret safe. The safe's password is the sum of the largest and smallest of the three digits created by using all 6,2 and 5 once. What is the password for the safe?
908
[OP_LIST_SOL] 6 2 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD]
var_a = 6 var_b = 2 var_c = 5 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = 1 list_d=list_b.copy() list_d.sort() var_h = list_d[var_g-1] var_i = var_f + var_h print(int(var_i))
Possibility
Round up the second largest five-digit number you can make by using the five number cards 0, 1, 5, 7, and 9 once to the tens digit.
97510
[OP_LIST_SOL] 0 1 5 7 9 [OP_LIST_EOL] 5 [OP_LIST_GET_PERM] 2 [OP_LIST_MAX] 2 [OP_CEIL]
var_a = 0 var_b = 1 var_c = 5 var_d = 7 var_e = 9 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 5 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 = 2 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = 2 var_j=int(((var_h+9*10**(var_i-2))//(10**(var_i-1)))*10**(var_i-1)) print(int(var_j))
Arithmetic calculation
There are 11 ripe watermelons and 13 unripe watermelons. If 15 of these watermelons are seedless, how many watermelons have seeds?
9
11 13 [OP_ADD] 15 [OP_SUB]
var_a = 11 var_b = 13 var_c = var_a + var_b var_d = 15 var_e = var_c - var_d print(int(var_e))
Geometry
A block of wood is in the shape of a cuboid measuring 5 centimeters (cm) in width, 4 centimeters (cm) in depth, and 3 centimeters (cm) in height. This block of wood was dipped in water, wet on all sides, and cut into 60 cubed pieces with a side area of 1 square centimeter (cm2). How many cubes have water on only one side?
22
5 2 [OP_SUB] 4 2 [OP_SUB] [OP_MUL] 5 2 [OP_SUB] 3 2 [OP_SUB] [OP_MUL] [OP_ADD] 4 2 [OP_SUB] 3 2 [OP_SUB] [OP_MUL] [OP_ADD] 2 [OP_MUL]
var_a = 5 var_b = 2 var_c = var_a - var_b var_d = 4 var_e = 2 var_f = var_d - var_e var_g = var_c * var_f var_h = 5 var_i = 2 var_j = var_h - var_i var_k = 3 var_l = 2 var_m = var_k - var_l var_n = var_j * var_m var_o = var_g + var_n var_p = 4 var_q = 2 var_r = var_p - var_q var_s = 3 var_t = 2 var_u = var_s - var_t var_v = var_r * var_u var_w = var_o + var_v var_x = 2 var_y = var_w * var_x print(int(var_y))
Arithmetic calculation
It is said that it takes 1 hour and 36 minutes to cycle 5 laps around the playground on a bicycle. How many minutes does it take to complete one lap around the playground?
19.2
1 60 [OP_MUL] 36 [OP_ADD] 5 [OP_DIV]
var_a = 1 var_b = 60 var_c = var_a * var_b var_d = 36 var_e = var_c + var_d var_f = 5 var_g = var_e / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Arithmetic calculation
This Alien likes to run. When it saw a rabbit and ran, it ran at 15 kilometers (km) per hour, and it ran at 10 kilometers per hour (km) when it spotted a frog, which took 30 minutes more. Find the time it took to run after seeing the frog.
1.5
10 30 60 [OP_DIV] [OP_MUL] 15 10 [OP_SUB] [OP_DIV] 30 60 [OP_DIV] [OP_ADD]
var_a = 10 var_b = 30 var_c = 60 var_d = var_b / var_c var_e = var_a * var_d var_f = 15 var_g = 10 var_h = var_f - var_g var_i = var_e / var_h var_j = 30 var_k = 60 var_l = var_j / var_k var_m = var_i + var_l print('{:.2f}'.format(round(var_m+1e-10,2)))
Correspondence
When you add a number to 23, the result is 34. Find out which number exactly.
11
34 23 [OP_SUB]
var_a = 34 var_b = 23 var_c = var_a - var_b print(int(var_c))
Correspondence
Find the value of 18/5 divided by 9/4 twice.
0.71
18/5 9/4 [OP_DIV] 9/4 [OP_DIV]
var_a = 3.6 var_b = 2.25 var_c = var_a / var_b var_d = 2.25 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
In Jihye's wallet, there are two 1000 wons, and 560 won coins. What is the total amount of money in Jihye's wallet?
2560
2 1000 [OP_MUL] 560 [OP_ADD]
var_a = 2 var_b = 1000 var_c = var_a * var_b var_d = 560 var_e = var_c + var_d print(int(var_e))