category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Correspondence
You want to multiply 20 by some number. you mistakenly subtracted some number from 40, and the result was 52. What is the correct calculation result?
-240
20 40 52 [OP_SUB] [OP_MUL]
var_a = 20 var_b = 40 var_c = 52 var_d = var_b - var_c var_e = var_a * var_d print(int(var_e))
Correspondence
Rounding down the three-digit number A27 to the nearest hundred gives 200. Get a single-digit number 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 mix 200 grams (g) of salt water with a concentration of 25% and 300 grams (g) of salt water in which 60 grams (g) of salt are dissolved, what is the concentration of the salt water?
22
200 25 100 [OP_DIV] [OP_MUL] 60 [OP_ADD] 200 300 [OP_ADD] [OP_DIV] 100 [OP_MUL]
var_a = 200 var_b = 25 var_c = 100 var_d = var_b / var_c var_e = var_a * var_d var_f = 60 var_g = var_e + var_f var_h = 200 var_i = 300 var_j = var_h + var_i var_k = var_g / var_j var_l = 100 var_m = var_k * var_l print(int(var_m))
Geometry
How many centimeters (cm) is the width of a rectangle whose area is 28/3 square centimeter (cm2) and its length is 14/5 centimeters (cm)?
3.33
28/3 14/5 [OP_DIV]
var_a = 9.333333333333334 var_b = 2.8 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Possibility
If you write down all odd numbers that are less than 100 and that are multiples of 3 on a piece of paper, how many times do you have to write the number 1?
4
1 100 [OP_LIST_ODD] 3 [OP_LIST_DIVISIBLE] [OP_LIST2NUM] [OP_NUM2LIST] 1 [OP_LIST_FIND_NUM]
var_a = 1 var_b = 100 list_a = [] if var_a%2==0: for i in range(var_a+1, var_b+1, 2): list_a.append(i) else: for i in range(var_a, var_b+1, 2): list_a.append(i) var_c = 3 list_b = [] var_c = int(var_c) for i in list_a: i = int(i) if i % var_c == 0: list_b.append(i) var_d="" for i in list_b: i = str(i) var_d = var_d + i list_c = [] var_d = int(var_d) while var_d//10 > 0: list_c.append(var_d%10) var_d = var_d//10 list_c.append(var_d%10) list_c = list_c[::-1] var_e = 1 var_f = 0 var_e = int(var_e) for i in list_c: i = int(i) if i == var_e: var_f = var_f + 1 print(int(var_f))
Arithmetic calculation
When writing the numbers from 1 to 125, find how many times the number 2 is written.
29
1 125 1 [OP_LIST_ARANGE] [OP_LIST2NUM] [OP_NUM2LIST] 2 [OP_LIST_FIND_NUM]
var_a = 1 var_b = 125 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 = 2 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))
Correspondence
8 is the result of accidentally adding 12 to a certain number and then dividing by 8. If the original calculation was to subtract 12 and multiply by 9, what is the correct value?
360
8 8 [OP_MUL] 12 [OP_SUB] 12 [OP_SUB] 9 [OP_MUL]
var_a = 8 var_b = 8 var_c = var_a * var_b var_d = 12 var_e = var_c - var_d var_f = 12 var_g = var_e - var_f var_h = 9 var_i = var_g * var_h print(int(var_i))
Comparison
What is the smallest number in 1.4, 9/10, 1.2, 0.5, and 13/10 after listing the numbers greater than 1.1?
1.2
[OP_LIST_SOL] 1.4 9/10 1.2 0.5 13/10 [OP_LIST_EOL] 1.1 [OP_LIST_MORE] 1 [OP_LIST_MIN]
var_a = 1.4 var_b = 0.9 var_c = 1.2 var_d = 0.5 var_e = 1.3 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 1.1 list_b = [] for i in list_a: if i > var_f: list_b.append(i) var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[var_g-1] print('{:.2f}'.format(round(var_h+1e-10,2)))
Possibility
If there are 5 members A, B, C, D, and E, find the number of cases in which one representative and two deputies are selected.
11
5 1 [OP_PERM] 5 1 [OP_SUB] 2 [OP_COMB] [OP_ADD]
var_a = 5 var_b = 1 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) var_d = 5 var_e = 1 var_f = var_d - var_e 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) for i, elem in enumerate(range(var_g)): var_h = var_h / (i+1) var_i = var_c + var_h print(int(var_i))
Arithmetic calculation
Jimin had 33 notebooks. My father bought 7 more notebooks and my mother bought 14 more. How many more notebooks does Jimin have than at first?
21
33 7 [OP_ADD] 14 [OP_ADD] 33 [OP_SUB]
var_a = 33 var_b = 7 var_c = var_a + var_b var_d = 14 var_e = var_c + var_d var_f = 33 var_g = var_e - var_f print(int(var_g))
Geometry
5.9 centimeters (cm) and 3 centimeters (cm) are the lengths of the two sides of the rectangle. Find the area of this rectangle.
17.7
5.9 3 [OP_MUL]
var_a = 5.9 var_b = 3 var_c = var_a * var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
The blue box and the red box contain balls. After moving 152 balls from the red box to the blue box, the number of balls in the red box is 346 more than the number of balls in the blue box. Find the difference between the number of balls in the two boxes before moving the balls.
650
346 152 [OP_ADD] 152 [OP_ADD]
var_a = 346 var_b = 152 var_c = var_a + var_b var_d = 152 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
There is a banner 20 meters (m) long. I'm thinking of fixating this banner with nails. Nails were driven 1 meter (m) apart from both ends of the banner, and the remaining nails were nailed in at regular intervals. A total of 7 nails were used. Find the distance between one nail and another.
3
20 1 2 [OP_MUL] [OP_SUB] 7 1 [OP_SUB] [OP_DIV]
var_a = 20 var_b = 1 var_c = 2 var_d = var_b * var_c var_e = var_a - var_d var_f = 7 var_g = 1 var_h = var_f - var_g var_i = var_e / var_h print(int(var_i))
Correspondence
There are two different single-digit numbers A and B. Find the sum of A and B that satisfies the following addition formula AB+640=BBB.
8
AB+640=BBB A [OP_DIGIT_UNK_SOLVER] AB+640=BBB B [OP_DIGIT_UNK_SOLVER] [OP_ADD]
var_a = 'AB+640=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+640=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 print(int(var_g))
Comparison
Suho is taller than Minyoung, and Seongju is shorter than Minyoung. Seonmi is shorter than Seongju. Write down the shortest person.
Seonmi
[OP_LIST_SOL] Suho Minyoung Seongju Seonmi [OP_LIST_EOL] [OP_LIST_SOL] Suho Minyoung > Seongju Minyoung < Seongju Seonmi > [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET]
var_a = 'Suho' var_b = 'Minyoung' var_c = 'Seongju' var_d = 'Seonmi' 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 = 'Suho' var_f = 'Minyoung' var_g = '>' var_h = 'Seongju' var_i = 'Minyoung' var_j = '<' var_k = 'Seongju' var_l = 'Seonmi' 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)
Possibility
If 6 professional baseball teams play with each other once, how many matches will there be in total?
15
6 2 [OP_COMB]
var_a = 6 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))
Comparison
You are comparing the heights of 20 students. If there are 11 students taller than Yoongi, how many students are shorter than Yoongi?
8
20 11 [OP_SUB] 1 [OP_SUB]
var_a = 20 var_b = 11 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Correspondence
If you add 12 to a number and subtract 27, you get 24. Find the number.
39
24 27 [OP_ADD] 12 [OP_SUB]
var_a = 24 var_b = 27 var_c = var_a + var_b var_d = 12 var_e = var_c - var_d print(int(var_e))
Possibility
If there are 10, 50, and 100 won coins, and three coins are thrown at the same time, find the number of possible outcomes. (However, when a coin is thrown, it comes out either heads or tails.)
8
2 3 [OP_POW]
var_a = 2 var_b = 3 var_c = var_a ** var_b print(int(var_c))
Correspondence
The five digit number 26AA2 is a multiple of 3. If single-digit number A represents the same number, how many numbers can be in A?
3
26AA2 [OP_GEN_POSSIBLE_LIST] 3 [OP_LIST_DIVISIBLE] 26AA2 A [OP_LIST_FIND_UNK] [OP_LIST_LEN]
var_a = '26AA2' 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 = 3 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 = '26AA2' 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))
Arithmetic calculation
Yoongi's age is 2 years younger than Hoseok's. The sum of the ages of Yoongi and Hoseok is 18 years old. How old is Yoongi?
8
18 2 [OP_SUB] 2 [OP_DIV]
var_a = 18 var_b = 2 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Geometry
What is the perimeter of an equilateral triangle with a side of 7 centimeters (cm)?
21
7 3 [OP_MUL]
var_a = 7 var_b = 3 var_c = var_a * var_b print(int(var_c))
Correspondence
You are about to distribute the same two-digit number of pencils to the classmates. There is nothing left when distributing to 6 students and 9 students, and 1 pencil is left when distributing to 7 students. Find how many pencils there are.
36
10 100 1 [OP_LIST_ARANGE] 6 9 [OP_LCM] 0 [OP_LIST_DIVIDE_AND_REMAIN] 7 1 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_GET]
var_a = 10 var_b = 100 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 6 var_e = 9 var_f = var_e * var_d / math.gcd(int(var_e), int(var_d)) var_g = 0 list_b = [] var_f = int(var_f) var_g = int(var_g) if var_g < 0: var_g = var_g + var_f for i in list_a: i = int(i) if i%var_f == var_g: list_b.append(i) var_h = 7 var_i = 1 list_c = [] var_h = int(var_h) var_i = int(var_i) if var_i < 0: var_i = var_i + var_h for i in list_b: i = int(i) if i%var_h == var_i: list_c.append(i) var_j = 1 var_k = list_c[var_j-1] print(int(var_k))
Possibility
Adding a number to the smallest two-digit number you can make from two different numbers from 1, 3, 5, and 8 equals 88. Find the number.
75
[OP_LIST_SOL] 1 3 5 8 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] 88 [OP_SUB]
var_a = 1 var_b = 3 var_c = 5 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-1] var_h = 88 var_i = var_g - var_h print(int(var_i))
Arithmetic calculation
Of the people who visited the pool during the week, 1518 were women, of whom 536 were students. There were 525 more men than women, of whom 1257 were non-students. How many students visited the pool in total?
1322
1518 525 [OP_ADD] 1257 [OP_SUB] 536 [OP_ADD]
var_a = 1518 var_b = 525 var_c = var_a + var_b var_d = 1257 var_e = var_c - var_d var_f = 536 var_g = var_e + var_f print(int(var_g))
Correspondence
When 13 is divided by A, the quotient is 4, the remainder is B. A and B are both natural numbers. Find the largest possible value of A.
3
13 1 [OP_SUB] 4 [OP_FDIV]
var_a = 13 var_b = 1 var_c = var_a - var_b var_d = 4 var_e = var_c // var_d print(int(var_e))
Geometry
How many edges does a cube have?
12
6 2 [OP_SUB] 3 [OP_MUL]
var_a = 6 var_b = 2 var_c = var_a - var_b var_d = 3 var_e = var_c * var_d print(int(var_e))
Geometry
If the ratio of the surface areas of two cubes is 9:25, how many times the volume of the larger cube is the smaller one?
4.63
25 1/2 [OP_POW] 3 [OP_POW] 9 1/2 [OP_POW] 3 [OP_POW] [OP_DIV]
var_a = 25 var_b = 0.5 var_c = var_a ** var_b var_d = 3 var_e = var_c ** var_d var_f = 9 var_g = 0.5 var_h = var_f ** var_g var_i = 3 var_j = var_h ** var_i var_k = var_e / var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Comparison
Sangwoo's midterm math score is higher than Hana's score, and Yunyong's math score is lower than Hana's score. Which of the three friends has the highest midterm math score?
Sangwoo
[OP_LIST_SOL] Sangwoo Hana Yunyong [OP_LIST_EOL] [OP_LIST_SOL] Sangwoo Hana > Yunyong Hana < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'Sangwoo' var_b = 'Hana' var_c = 'Yunyong' 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 = 'Sangwoo' var_e = 'Hana' var_f = '>' var_g = 'Yunyong' var_h = 'Hana' var_i = '<' list_b= [] if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_j = 1 var_k = list_c[var_j-1] print(var_k)
Comparison
Taehyung and 10 of his friends are standing in a line. If 5 people are standing to Taehyung's left, how many people are standing to Taehyung's right?
4
10 5 [OP_SUB] 1 [OP_SUB]
var_a = 10 var_b = 5 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Correspondence
Seongjun spent half of his money and 300 won at the first store, half of the remaining money and 300 won at the second store, and 500 won at the third store. How much money did Seongjun have at the beginning?
4200
0 400 [OP_ADD] 500 [OP_ADD] 1 1/2 [OP_SUB] [OP_DIV] 300 [OP_ADD] 1 1/2 [OP_SUB] [OP_DIV]
var_a = 0 var_b = 400 var_c = var_a + var_b var_d = 500 var_e = var_c + var_d var_f = 1 var_g = 0.5 var_h = var_f - var_g var_i = var_e / var_h var_j = 300 var_k = var_i + var_j var_l = 1 var_m = 0.5 var_n = var_l - var_m var_o = var_k / var_n print(int(var_o))
Correspondence
A number divided by 6 is 26. What is the value of the number?
156
26 6 [OP_MUL]
var_a = 26 var_b = 6 var_c = var_a * var_b print(int(var_c))
Correspondence
You need to add 8 to a number and subtract 11. But ended up subtracting 9 and 12 by mistake, and got 24. Find the product of the correctly calculated value and the incorrectly calculated value.
1008
24 12 [OP_ADD] 9 [OP_ADD] 8 [OP_ADD] 11 [OP_SUB] 24 [OP_MUL]
var_a = 24 var_b = 12 var_c = var_a + var_b var_d = 9 var_e = var_c + var_d var_f = 8 var_g = var_e + var_f var_h = 11 var_i = var_g - var_h var_j = 24 var_k = var_i * var_j print(int(var_k))
Arithmetic calculation
If you can process 240 kg (kg) of rice in 4 days, how many days will it take to process 1920 kg (kg)?
32
1920 240 4 [OP_DIV] [OP_FDIV]
var_a = 1920 var_b = 240 var_c = 4 var_d = var_b / var_c var_e = var_a // var_d print(int(var_e))
Comparison
Among the four students, Minyoung passed the finish line faster than Yoongi, and Yoongi crossed the finish line faster than Jimin. If Jimin and Minyoung got through later than Yuna, who came in first?
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)
Arithmetic calculation
There are five numbers 10, 11, 12, 13, and 14. What is the sum of the 3rd and 2nd smallest numbers?
23
[OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 3 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_ADD]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 var_e = 14 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 3 list_b=list_a.copy() list_b.sort() var_g = list_b[var_f-1] var_h = 2 list_c=list_a.copy() list_c.sort() var_i = list_c[var_h-1] var_j = var_g + var_i print(int(var_j))
Arithmetic calculation
Minyoung ate 10 tangerines from the basket. And an hour later, when she ate 6 more tangerines, the basket was empty. How many tangerines were in the basket?
16
10 6 [OP_ADD]
var_a = 10 var_b = 6 var_c = var_a + var_b print(int(var_c))
Geometry
If a rectangle has the width of 0.9 times its length, and the length of 15 centimeters (cm), what is the area of this rectangle?
202.5
15 15 0.9 [OP_MUL] [OP_MUL]
var_a = 15 var_b = 15 var_c = 0.9 var_d = var_b * var_c var_e = var_a * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
Minha's hair grows at a rate of 0.39 millimeters (mm) per day. If the length of Minha's hair is 32.8 centimeters (cm) today, how many centimeters (cm) will it be after 30 days?
33.97
0.39 10 [OP_DIV] 30 [OP_MUL] 32.8 [OP_ADD]
var_a = 0.39 var_b = 10 var_c = var_a / var_b var_d = 30 var_e = var_c * var_d var_f = 32.8 var_g = var_e + var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Comparison
Sort 1.23, 3/4, 2.34, 2.12, 4.23, and 5/3 by largest to smallest. What could be the third?
2.12
[OP_LIST_SOL] 1.23 3 4 [OP_DIV] 2.34 2.12 4.23 5 3 [OP_DIV] [OP_LIST_EOL] 3 [OP_LIST_MAX]
var_a = 1.23 var_b = 3 var_c = 4 var_d = var_b / var_c var_e = 2.34 var_f = 2.12 var_g = 4.23 var_h = 5 var_i = 3 var_j = var_h / var_i list_a= [] if "/" in str(var_j): var_j = eval(str(var_j)) list_a.append(var_j) if "/" in str(var_g): var_g = eval(str(var_g)) list_a.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_k = 3 list_b=list_a.copy() list_b.sort() var_l = list_b[-var_k] print('{:.2f}'.format(round(var_l+1e-10,2)))
Comparison
There are 5 people: Juri, Jungwoo, Myunghyun, Seokjin, and Jungkook. Jungwoo is smaller than Juri and Seokjin is smaller than Myunghyun. Juri is shorter than Jungkook. Myunghyun is shorter than Jungwoo. Who is the tallest?
Jungkook
[OP_LIST_SOL] Juri Jungwoo Myunghyun Seokjin Jungkook [OP_LIST_EOL] [OP_LIST_SOL] Juri Jungwoo > Myunghyun Seokjin > Juri Jungkook < Myunghyun Jungwoo < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = 'Juri' var_b = 'Jungwoo' var_c = 'Myunghyun' var_d = 'Seokjin' var_e = 'Jungkook' 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 = 'Juri' var_g = 'Jungwoo' var_h = '>' var_i = 'Myunghyun' var_j = 'Seokjin' var_k = '>' var_l = 'Juri' var_m = 'Jungkook' var_n = '<' var_o = 'Myunghyun' var_p = 'Jungwoo' var_q = '<' list_b= [] if "/" in str(var_q): var_q = eval(str(var_q)) list_b.append(var_q) if "/" in str(var_p): var_p = eval(str(var_p)) list_b.append(var_p) if "/" in str(var_o): var_o = eval(str(var_o)) list_b.append(var_o) if "/" in str(var_n): var_n = eval(str(var_n)) list_b.append(var_n) if "/" in str(var_m): var_m = eval(str(var_m)) list_b.append(var_m) if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_r = 1 var_s = list_c[var_r-1] print(var_s)
Correspondence
The result of dividing a certain number by 7 mistake of dividing a certain number by 6 is 42. How much is it if you calculate it correctly?
49
42 7 [OP_MUL] 6 [OP_DIV]
var_a = 42 var_b = 7 var_c = var_a * var_b var_d = 6 var_e = var_c / var_d print(int(var_e))
Correspondence
Subtracting 17 from a number gives 55. If Yoongi wants to divide the number by 9, how much does Yoongi get?
8
55 17 [OP_ADD] 9 [OP_DIV]
var_a = 55 var_b = 17 var_c = var_a + var_b var_d = 9 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
What is the smallest 4-digit number that is a multiple of 3 and a multiple of 5?
1005
1000 9999 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MIN]
var_a = 1000 var_b = 9999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 3 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = 5 list_c = [] var_e = int(var_e) for i in list_b: i = int(i) if i % var_e == 0: list_c.append(i) var_f = 1 list_d=list_c.copy() list_d.sort() var_g = list_d[var_f-1] print(int(var_g))
Correspondence
Sunye's house has no electricity, so she has to rely on matches. There are 8 matches in a matchbox. Sunye has 9 matchboxes and 7 single matches. If she uses 6 matches a day, find the maximum number of days she can last completely.
13
8 9 [OP_MUL] 7 [OP_ADD] 6 [OP_FDIV]
var_a = 8 var_b = 9 var_c = var_a * var_b var_d = 7 var_e = var_c + var_d var_f = 6 var_g = var_e // var_f print(int(var_g))
Arithmetic calculation
You want to drink 19 liters (L) of water equally over 9 days. Find how many liters (l) of water you need to drink per day.
2.11
19 9 [OP_DIV]
var_a = 19 var_b = 9 var_c = var_a / var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
Suppose several monsters are trying to attack. If you shoot 4 times at a monster, 3 shots remain, and if you try to shoot 5 times, then you lack 6 shots. How many monsters are there?
9
3 6 [OP_ADD] 5 4 [OP_SUB] [OP_DIV]
var_a = 3 var_b = 6 var_c = var_a + var_b var_d = 5 var_e = 4 var_f = var_d - var_e var_g = var_c / var_f print(int(var_g))
Geometry
A parallelogram has an area of 44 square centimeters (cm2) and a height of 11 centimeters (cm). What is the length of the base?
4
44 11 [OP_DIV]
var_a = 44 var_b = 11 var_c = var_a / var_b print(int(var_c))
Correspondence
You mistakenly added what should have subtracted 0.42 from a number, and ended up with 0.9. What is 0.5 added to the correctly calculated value?
0.56
0.9 0.42 [OP_SUB] 0.42 [OP_SUB] 0.5 [OP_ADD]
var_a = 0.9 var_b = 0.42 var_c = var_a - var_b var_d = 0.42 var_e = var_c - var_d var_f = 0.5 var_g = var_e + var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Correspondence
When A is divided by 7, the quotient is 5 and the remainder is 3. Get A.
38
7 5 [OP_MUL] 3 [OP_ADD]
var_a = 7 var_b = 5 var_c = var_a * var_b var_d = 3 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
A bucket full of water weighs 320 kilograms (kg). After using 1/2 of the water, the bucket weighs 175 kilograms (kg). What is the weight of the empty bucket in kilograms (kg)?
30
320 320 175 [OP_SUB] 2 [OP_MUL] [OP_SUB]
var_a = 320 var_b = 320 var_c = 175 var_d = var_b - var_c var_e = 2 var_f = var_d * var_e var_g = var_a - var_f print(int(var_g))
Arithmetic calculation
I bought 7 boxes of soda, each box containing 16 cans. Thirteen of them were discarded because the cans were crushed during transport. I plan to distribute the remaining beverages equally among the eight boxes. How many pieces should I put in each box?
12
16 7 [OP_MUL] 13 [OP_SUB] 8 [OP_FDIV]
var_a = 16 var_b = 7 var_c = var_a * var_b var_d = 13 var_e = var_c - var_d var_f = 8 var_g = var_e // var_f print(int(var_g))
Geometry
There is a cube with 6 centimeters (cm) edge. If a smaller cube whose edge is 2 centimeters (cm) is cut out from the middle of each side of the original one, what will be the surface area in square centimeters (cm2)?
312
6 2 [OP_POW] 6 [OP_MUL] 2 2 [OP_POW] 4 [OP_MUL] 6 [OP_MUL] [OP_ADD]
var_a = 6 var_b = 2 var_c = var_a ** var_b var_d = 6 var_e = var_c * var_d var_f = 2 var_g = 2 var_h = var_f ** var_g var_i = 4 var_j = var_h * var_i var_k = 6 var_l = var_j * var_k var_m = var_e + var_l print(int(var_m))
Arithmetic calculation
The box contains 23 green and 23 purple marbles. If there are 7 more green marbles than purple marbles, how many green marbles are there?
8
23 7 [OP_SUB] 2 [OP_DIV]
var_a = 23 var_b = 7 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Possibility
Seven classes play soccer. If they play against each other once, how many matches are there in total?
21
7 7 1 [OP_SUB] [OP_MUL] 2 [OP_DIV]
var_a = 7 var_b = 7 var_c = 1 var_d = var_b - var_c var_e = var_a * var_d var_f = 2 var_g = var_e / var_f print(int(var_g))
Comparison
If a cinema has 4 rows of 8 chairs each, what is the total number of chairs in the cinema?
32
8 4 [OP_MUL]
var_a = 8 var_b = 4 var_c = var_a * var_b print(int(var_c))
Comparison
The average number of books the three had was 23 fewer than the average of the first and second persons, and 17 more than the average of the second and third persons. If the second person has 66 books, find the sum of the number of books the first person and the third person have.
96
66 23 [OP_SUB] 17 [OP_ADD] 2 3 [OP_DIV] 66 [OP_MUL] [OP_SUB] 2 3 [OP_DIV] 1 2 [OP_DIV] [OP_SUB] [OP_DIV]
var_a = 66 var_b = 23 var_c = var_a - var_b var_d = 17 var_e = var_c + var_d var_f = 2 var_g = 3 var_h = var_f / var_g var_i = 66 var_j = var_h * var_i var_k = var_e - var_j var_l = 2 var_m = 3 var_n = var_l / var_m var_o = 1 var_p = 2 var_q = var_o / var_p var_r = var_n - var_q var_s = var_k / var_r print(int(eval('{:.2f}'.format(round(var_s+1e-10,2)))))
Possibility
The number cards have numbers from 1 to 12 written on them. When a number card is drawn, find the number of cases where the number on the card is a multiple of 3.
4
1 12 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 1 var_b = 12 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 = len(list_b) print(int(var_e))
Possibility
You have two chances to pick fruit from a basket that contains one apple, one peach, one pear, one melon, and one strawberry. How many orders of fruit can there be?
20
[OP_LIST_SOL] apple peach pear melon strawberry [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_PERM]
var_a = 'apple' var_b = 'peach' var_c = 'pear' var_d = 'melon' var_e = 'strawberry' 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))
Arithmetic calculation
Multiplying product (a) produced in August by 8 gives you the number of product (a) produced in September. If you produced 72 items in September, how many items did you produce in August and September in total?
648
72 72 8 [OP_MUL] [OP_ADD]
var_a = 72 var_b = 72 var_c = 8 var_d = var_b * var_c var_e = var_a + var_d print(int(var_e))
Arithmetic calculation
The average of 7 numbers is 7. If you take one of these numbers and change it to 9, the average is 8. What was the original number before changing?
2
7 7 [OP_MUL] 7 8 [OP_MUL] 9 [OP_SUB] [OP_SUB]
var_a = 7 var_b = 7 var_c = var_a * var_b var_d = 7 var_e = 8 var_f = var_d * var_e var_g = 9 var_h = var_f - var_g var_i = var_c - var_h print(int(var_i))
Correspondence
While Yoongi was subtracting 57 from the three-digit number, Yoongi mistakenly saw the units digit of the three-digit number 9 as 6. When Yoongi got the result of 819, what is the three-digit number?
879
819 57 [OP_ADD] 6 9 [OP_SUB] [OP_SUB]
var_a = 819 var_b = 57 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
The stationery shop sold all 15 bundles of notebooks in 5 days. If each bundle contained 40 notebooks, how many notebooks did you sell on average per day?
120
15 40 [OP_MUL] 5 [OP_FDIV]
var_a = 15 var_b = 40 var_c = var_a * var_b var_d = 5 var_e = var_c // var_d print(int(var_e))
Arithmetic calculation
When Young-soo held the puppy and weighed it, it was 31 kilograms (kg), and when Ga-young held the same puppy and weighed it, it was 27 kilograms (kg) and 350 grams (g). If the weight of the dog is 1 kilogram (kg) and 400 grams (g), how many kilograms (kg) is the sum of the weights of Youngsoo, Gayoung, and the dog?
56.95
31 27 350 1000 [OP_DIV] [OP_ADD] [OP_ADD] 1 400 1000 [OP_DIV] [OP_ADD] [OP_SUB]
var_a = 31 var_b = 27 var_c = 350 var_d = 1000 var_e = var_c / var_d var_f = var_b + var_e var_g = var_a + var_f var_h = 1 var_i = 400 var_j = 1000 var_k = var_i / var_j var_l = var_h + var_k var_m = var_g - var_l print('{:.2f}'.format(round(var_m+1e-10,2)))
Arithmetic calculation
The airport is 300 kilometers (km) away from the house. Find the remaining distance after 2 hours when Jinwoo leaves home in a car traveling at 60 kilometers (km) per hour.
180
300 60 2 [OP_MUL] [OP_SUB]
var_a = 300 var_b = 60 var_c = 2 var_d = var_b * var_c var_e = var_a - var_d print(int(var_e))
Arithmetic calculation
There are five numbers 10, 11, 12, 13, and 14. What is the product of the second largest number and the second smallest number?
143
[OP_LIST_SOL] 10 11 12 13 14 [OP_LIST_EOL] 2 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_MUL]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 var_e = 14 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 2 list_b=list_a.copy() list_b.sort() var_g = list_b[-var_f] var_h = 2 list_c=list_a.copy() list_c.sort() var_i = list_c[var_h-1] var_j = var_g * var_i print(int(var_j))
Correspondence
You need to add 41 to a number, but mistakenly added 14, and got 68. Find the sum of a number and its correctly calculated value.
149
68 14 [OP_SUB] 68 14 [OP_SUB] 41 [OP_ADD] [OP_ADD]
var_a = 68 var_b = 14 var_c = var_a - var_b var_d = 68 var_e = 14 var_f = var_d - var_e var_g = 41 var_h = var_f + var_g var_i = var_c + var_h print(int(var_i))
Correspondence
14A+2B3=418. How much is A?
5
14A+2B3=418 A [OP_DIGIT_UNK_SOLVER]
var_a = '14A+2B3=418' 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
Find the number of numbers less than or equal to 0.4 among 0.8, 1/2, 0.3, and 1/3.
2
[OP_LIST_SOL] 0.8 1/2 0.3 1/3 [OP_LIST_EOL] 0.4 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 0.8 var_b = 0.5 var_c = 0.3 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.4 list_b = [] for i in list_a: if i <= var_e: list_b.append(i) var_f = len(list_b) print(int(var_f))
Geometry
When tossing two different coins, calculate the numbers of cases where both tails come up.
1
1
var_a = 1 print(int(var_a))
Arithmetic calculation
Namjoon rode his bike and traveled 96.967 kilometers (km) in 1.3 hours. If Namjoon went at a steady speed, how many kilometers (km) did he travel in 1 hour?
74.59
96.967 1.3 [OP_DIV] 1 [OP_MUL]
var_a = 96.967 var_b = 1.3 var_c = var_a / var_b var_d = 1 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Possibility
How many three-digit numbers are there in which each digit has only odd numbers less than or equal to 3?
8
0 3 [OP_LIST_ODD] 3 [OP_LIST_GET_PRODUCT] [OP_LIST_LEN]
var_a = 0 var_b = 3 list_a = [] if var_a%2==0: for i in range(var_a+1, var_b+1, 2): list_a.append(i) else: for i in range(var_a, var_b+1, 2): list_a.append(i) var_c = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=var_c)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_d = len(list_b) print(int(var_d))
Comparison
Jimin drank 0.7 liters (L) of juice. Eunji drank 1/10 liter (L) less than Jimin. Yoongi drank 4/5 liters (L), and Yuna drank 0.2 liters (L) more than Jimin. Who drank the most juice?
Yuna
[OP_LIST_SOL] Jimin Eunji Yoongi Yuna [OP_LIST_EOL] [OP_LIST_SOL] 0.7 0.7 1 10 [OP_DIV] [OP_SUB] 4 5 [OP_DIV] 0.7 0.2 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jimin' var_b = 'Eunji' var_c = 'Yoongi' 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 = 0.7 var_f = 0.7 var_g = 1 var_h = 10 var_i = var_g / var_h var_j = var_f - var_i var_k = 4 var_l = 5 var_m = var_k / var_l var_n = 0.7 var_o = 0.2 var_p = var_n + var_o list_b= [] if "/" in str(var_p): var_p = eval(str(var_p)) list_b.append(var_p) if "/" in str(var_m): var_m = eval(str(var_m)) list_b.append(var_m) if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_q = 1 list_c=list_b.copy() list_c.sort() var_r = list_c[-var_q] var_s = list_b.index(var_r)+1 var_t = list_a[var_s-1] print(var_t)
Comparison
Jian has 5,000 won, Doyun has 2,000 won, Harin has 8,000 won, and Joowon has 4,000 won. Who is the 3rd richest person?
Joowon
[OP_LIST_SOL] Jian Doyun Harin Joowon [OP_LIST_EOL] [OP_LIST_SOL] 5000 2000 8000 4000 [OP_LIST_EOL] 3 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jian' var_b = 'Doyun' var_c = 'Harin' var_d = 'Joowon' 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 = 5000 var_f = 2000 var_g = 8000 var_h = 4000 list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 3 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
10 times a number is 17, what is 1/100 times the number?
0.02
17 10 [OP_DIV] 1/100 [OP_MUL]
var_a = 17 var_b = 10 var_c = var_a / var_b var_d = 0.01 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
Bottles of milk are 18 less than slices of bread, and cookies are 27 more than slices of bread. If there are 58 slices of bread, how many bread, bottles of milk, and cookies are there in total?
183
58 58 18 [OP_SUB] [OP_ADD] 58 27 [OP_ADD] [OP_ADD]
var_a = 58 var_b = 58 var_c = 18 var_d = var_b - var_c var_e = var_a + var_d var_f = 58 var_g = 27 var_h = var_f + var_g var_i = var_e + var_h print(int(var_i))
Arithmetic calculation
A hardware store sells wire for 200 won for 0.1 meter (m). How many meters (m) of wire can you buy with 1200 won?
0.6
1200 200 [OP_DIV] 0.1 [OP_MUL]
var_a = 1200 var_b = 200 var_c = var_a / var_b var_d = 0.1 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Comparison
Yujeong arranged several colored balls on the desk. If the red, blue, yellow, purple and white balls are arranged in this order, what color is the first ball?
red
[OP_LIST_SOL] red blue yellow purple white [OP_LIST_EOL] 1 [OP_LIST_GET]
var_a = 'red' var_b = 'blue' var_c = 'yellow' var_d = 'purple' var_e = 'white' 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)
Geometry
Find the length in centimeters (cm) of a side of an equilateral triangle with length 9/20 centimeters (cm) and a regular pentagon with the same perimeter.
0.27
9/20 3 [OP_MUL] 5 [OP_DIV]
var_a = 0.45 var_b = 3 var_c = var_a * var_b var_d = 5 var_e = var_c / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
You should have divided a certain number by 8, but you mistakenly divided it by 6 and got a quotient of 124 and a remainder of 4. Find the answer to the correct calculation.
93.5
124 6 [OP_MUL] 4 [OP_ADD] 8 [OP_DIV]
var_a = 124 var_b = 6 var_c = var_a * var_b var_d = 4 var_e = var_c + var_d var_f = 8 var_g = var_e / var_f print('{:.2f}'.format(round(var_g+1e-10,2)))
Correspondence
The number of first-year students attending Woojung High School is 468 less than the number of non-first-year students. If the number of non-first year students is 954, how many students attend Woojung High School?
1440
954 468 [OP_SUB] 954 [OP_ADD]
var_a = 954 var_b = 468 var_c = var_a - var_b var_d = 954 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
There are 68 soccer balls, which are 12 less compared to volleyballs and 23 more than basketballs. How many soccer balls, volleyballs, and basketballs are there altogether?
193
68 12 [OP_ADD] 68 23 [OP_SUB] [OP_ADD] 68 [OP_ADD]
var_a = 68 var_b = 12 var_c = var_a + var_b var_d = 68 var_e = 23 var_f = var_d - var_e var_g = var_c + var_f var_h = 68 var_i = var_g + var_h print(int(var_i))
Comparison
Among 1.4, 9/10, 1.2, 0.5, and 13/10, find how many numbers are less than or equal to 1.1.
2
[OP_LIST_SOL] 1.4 9/10 1.2 0.5 13/10 [OP_LIST_EOL] 1.1 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 1.4 var_b = 0.9 var_c = 1.2 var_d = 0.5 var_e = 1.3 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 1.1 list_b = [] for i in list_a: if i <= var_f: list_b.append(i) var_g = len(list_b) print(int(var_g))
Possibility
Three out of five digits 0, 1, 2, 3, and 4 were chosen to make a three-digit odd number. If you can use the same number multiple times, how many odd numbers can you make?
40
[OP_LIST_SOL] 0 1 2 3 4 [OP_LIST_EOL] 3 [OP_LIST_GET_PRODUCT] 2 [OP_LIST_DIVISIBLE] [OP_SET_DIFFERENCE] [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 = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.product(list_b, repeat=var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = 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) list_d = list(set(list_b) - set(list_c)) var_h = len(list_d) print(int(var_h))
Geometry
Consider a rectangle whose long side is 1 meter (m) and whose short side is 2/8 meter (m) shorter than the long side. What is the sum of the lengths of the four sides of this rectangle in meters (m)?
3.5
1 1 2 8 [OP_DIV] [OP_SUB] [OP_ADD] 2 [OP_MUL]
var_a = 1 var_b = 1 var_c = 2 var_d = 8 var_e = var_c / var_d var_f = var_b - var_e var_g = var_a + var_f var_h = 2 var_i = var_g * var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Correspondence
A, B, and C are different numbers from 0 to 9. Find C from the subtraction sentence AAA-BB=AC.
2
AAA-BB=AC C [OP_DIGIT_UNK_SOLVER]
var_a = 'AAA-BB=AC' var_b = 'C' 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
Woo-gyeong is 9 centimeters (cm) shorter than Eun-mi. If Woo-gyeong's height is 1 meter (m) and 35 centimeters (cm), how many meters (m) is Eun-mi's height expressed as a decimal number?
1.44
1 35 100 [OP_DIV] [OP_ADD] 9 100 [OP_DIV] [OP_ADD]
var_a = 1 var_b = 35 var_c = 100 var_d = var_b / var_c var_e = var_a + var_d var_f = 9 var_g = 100 var_h = var_f / var_g var_i = var_e + var_h print('{:.2f}'.format(round(var_i+1e-10,2)))
Geometry
You are trying to find the number of vertices of a shape. If this figure is a cube, find the number of vertices.
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))
Arithmetic calculation
There are Seoraksan, Jirisan, Hallasan, and Baekdusan. Jirisan is 207 meters (m) higher than Seoraksan. Hallasan is 252 meters (m) higher than Seoraksan. Baekdusan is 839 meters (m) higher than Jirisan. Find the difference in height between Seoraksan and Baekdusan.
1046
207 839 [OP_ADD]
var_a = 207 var_b = 839 var_c = var_a + var_b print(int(var_c))
Correspondence
When A is divided by 9, the quotient is 2 and the remainder is 6. Find out the value of A.
24
9 2 [OP_MUL] 6 [OP_ADD]
var_a = 9 var_b = 2 var_c = var_a * var_b var_d = 6 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
There are 17 candies and two pouches with 19 candies. If you divide the candy equally among 9 people, how many can each person get?
4
17 19 [OP_ADD] 9 [OP_FDIV]
var_a = 17 var_b = 19 var_c = var_a + var_b var_d = 9 var_e = var_c // var_d print(int(var_e))
Possibility
Find the number of ways in which a card numbered 1 through 9 is drawn and multiplied by 21 is greater than 84 multiplied by 2.
1
1 9 1 [OP_LIST_ARANGE] 84 2 [OP_MUL] 21 [OP_DIV] [OP_LIST_MORE] [OP_LIST_LEN]
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 = 84 var_e = 2 var_f = var_d * var_e var_g = 21 var_h = var_f / var_g list_b = [] for i in list_a: if i > var_h: list_b.append(i) var_i = len(list_b) print(int(var_i))
Arithmetic calculation
In the set of even numbers from 600 to 800, find the sum of the digits of all the numbers in the set.
1508
600 800 2 [OP_LIST_ARANGE] [OP_LIST_NUM2SUM] [OP_LIST_SUM]
var_a = 600 var_b = 800 var_c = 2 list_a = [i for i in range(var_a, var_b + 1, var_c)] list_b=[] for i in list_a: var_d = 0 i = int(i) while i//10 > 0: var_d = var_d + i%10 i = i//10 var_d = var_d + i%10 list_b.append(var_d) list_b = [float(i) for i in list_b] var_e = sum(list_b) print(int(var_e))
Correspondence
When you multiply a number by 6, you get 72. What number do you get when you add 8 to the number?
20
72 6 [OP_DIV] 8 [OP_ADD]
var_a = 72 var_b = 6 var_c = var_a / var_b var_d = 8 var_e = var_c + var_d print(int(var_e))
Comparison
While Toy (A) is larger than (B), it is smaller than (C). If Toy (B) is bigger than Toy (D) and Toy (C) is smaller than Toy (E), which toy is the biggest?
(E)
[OP_LIST_SOL] (A) (B) (C) (D) (E) [OP_LIST_EOL] [OP_LIST_SOL] (A) (B) > (A) (C) < (B) (D) > (C) (E) < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = '(A)' var_b = '(B)' var_c = '(C)' var_d = '(D)' var_e = '(E)' list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = '(A)' var_g = '(B)' var_h = '>' var_i = '(A)' var_j = '(C)' var_k = '<' var_l = '(B)' var_m = '(D)' var_n = '>' var_o = '(C)' var_p = '(E)' var_q = '<' list_b= [] if "/" in str(var_q): var_q = eval(str(var_q)) list_b.append(var_q) if "/" in str(var_p): var_p = eval(str(var_p)) list_b.append(var_p) if "/" in str(var_o): var_o = eval(str(var_o)) list_b.append(var_o) if "/" in str(var_n): var_n = eval(str(var_n)) list_b.append(var_n) if "/" in str(var_m): var_m = eval(str(var_m)) list_b.append(var_m) if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_i): var_i = eval(str(var_i)) list_b.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_r = 1 var_s = list_c[var_r-1] print(var_s)
Geometry
Minyeong has drawn the largest circle that can be drawn inside a square with an area of 400 square centimeters (cm2). If pi is 3.1, how many square centimeters (cm2) is the area of the circle Minyeong drew?
310
3.1 400 1/2 [OP_POW] 2 [OP_DIV] 2 [OP_POW] [OP_MUL]
var_a = 3.1 var_b = 400 var_c = 0.5 var_d = var_b ** var_c var_e = 2 var_f = var_d / var_e var_g = 2 var_h = var_f ** var_g var_i = var_a * var_h print(int(var_i))
Geometry
Make a rectangle out of a wire that is 52 centimeters (cm) long. What is the maximum area of a rectangle that can be made?
169
52 4 [OP_DIV] 2 [OP_POW]
var_a = 52 var_b = 4 var_c = var_a / var_b var_d = 2 var_e = var_c ** var_d print(int(var_e))
Comparison
In Seokjin's classroom, the number of desks in each row, both horizontally and vertically, is placed in a square shape. Seokjin's seat is 3rd from the front, 5th from the back, 4th from the right, and 2nd from the left. How many desks are there in Seokjin's classroom?
35
3 5 [OP_ADD] 1 [OP_SUB] 4 2 [OP_ADD] 1 [OP_SUB] [OP_MUL]
var_a = 3 var_b = 5 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d var_f = 4 var_g = 2 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))
Correspondence
The multiplication of the five-digit number ABCDE and 3 is 111111. Find the sum of A, B, C, D, and E.
20
111111 3 [OP_DIV] [OP_NUM2LIST] [OP_LIST_SUM]
var_a = 111111 var_b = 3 var_c = var_a / var_b list_a = [] var_c = int(var_c) while var_c//10 > 0: list_a.append(var_c%10) var_c = var_c//10 list_a.append(var_c%10) list_a = list_a[::-1] list_a = [float(i) for i in list_a] var_d = sum(list_a) print(int(var_d))
Arithmetic calculation
Which of the five-digit numbers is the greatest common multiple of 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))