category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Possibility
Yoongi's class is preparing for the relay race. How many ways are there to determine the running order of 3 out of 5 candidates?
60
5 3 [OP_PERM]
var_a = 5 var_b = 3 var_c = 1 var_a = int(var_a) var_b = int(var_b) for i, elem in enumerate(range(var_b)): var_c = var_c * (var_a-i) print(int(var_c))
Comparison
The truck is loaded with (a) and (b) two boxes. (a) box is smaller than (b) box. If you arrive at your destination and the larger of the two boxes is missing, what is the missing box?
(b)
[OP_LIST_SOL] (a) (b) [OP_LIST_EOL] [OP_LIST_SOL] (a) (b) < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] 1 [OP_LIST_GET]
var_a = '(a)' var_b = '(b)' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = '(a)' var_d = '(b)' var_e = '<' list_b= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) list_b.reverse() global item_name_index_dict items_name_list = list_a.copy() conditions = [] condition_list = list_b.copy() temp_stack = [] for index_, cond_ in enumerate(map(str, condition_list)): if cond_ in ("<", ">", "="): operand_right = temp_stack.pop() operand_left = temp_stack.pop() if cond_ == "=": cond_ = "==" conditions.append(f"{operand_left} {cond_} {operand_right}") else: if not cond_.isdigit(): cond_ = "{" + cond_ + "}" temp_stack.append(cond_) item_name_index_dict = {} for perm in itertools.permutations(range(1, len(items_name_list) + 1)): item_name_index_dict = dict(zip(items_name_list, perm)) formatted_conditions = \ [condition.format_map(item_name_index_dict) for condition in conditions] if all(map(eval, formatted_conditions)): break list_c = list(item_name_index_dict.keys()) list_c.sort(key=item_name_index_dict.get, reverse=True) var_f = 1 var_g = list_c[var_f-1] print(var_g)
Possibility
Find the difference between the 2nd largest number and the 3rd smallest number when selecting 3 different numbers from 5, 0, 8, 6, 2 to make a 3-digit number.
654
[OP_LIST_SOL] 5 0 8 6 2 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 2 [OP_LIST_MAX] 3 [OP_LIST_MIN] [OP_SUB]
var_a = 5 var_b = 0 var_c = 8 var_d = 6 var_e = 2 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 = 2 list_c=list_b.copy() list_c.sort() var_h = list_c[-var_g] var_i = 3 list_d=list_b.copy() list_d.sort() var_j = list_d[var_i-1] var_k = var_h - var_j print(int(var_k))
Comparison
There are two numbers A and B. A is 3 groups of 10 and 7 units. B is one less than 40. Which number is smaller?
A
[OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] 10 3 [OP_MUL] 7 [OP_ADD] 40 1 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'A' var_b = 'B' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 10 var_d = 3 var_e = var_c * var_d var_f = 7 var_g = var_e + var_f var_h = 40 var_i = 1 var_j = var_h - var_i list_b= [] if "/" in str(var_j): var_j = eval(str(var_j)) list_b.append(var_j) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) list_b.reverse() var_k = 1 list_c=list_b.copy() list_c.sort() var_l = list_c[var_k-1] var_m = list_b.index(var_l)+1 var_n = list_a[var_m-1] print(var_n)
Arithmetic calculation
Find the largest odd number between 1 and 7.
7
1 7 [OP_LIST_ODD] 1 [OP_LIST_MAX]
var_a = 1 var_b = 7 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 = 1 list_b=list_a.copy() list_b.sort() var_d = list_b[-var_c] print(int(var_d))
Correspondence
A is 520. A is less than C by 204. C is greater than B by 179. Find out B.
545
520 204 [OP_ADD] 179 [OP_SUB]
var_a = 520 var_b = 204 var_c = var_a + var_b var_d = 179 var_e = var_c - var_d print(int(var_e))
Possibility
If there are 5 members A, B, C, D, and E, find the number of cases in which one president, one vice president, and one manager are selected.
60
5 1 1 [OP_ADD] 1 [OP_ADD] [OP_PERM]
var_a = 5 var_b = 1 var_c = 1 var_d = var_b + var_c var_e = 1 var_f = var_d + var_e var_g = 1 var_a = int(var_a) var_f = int(var_f) for i, elem in enumerate(range(var_f)): var_g = var_g * (var_a-i) print(int(var_g))
Possibility
Using 3 of 4, 8, 1, 2, what is the largest number with a ones digit of 2?
842
[OP_LIST_SOL] 4 8 1 2 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 2 [OP_LIST_SEARCH_FIXED_DIGIT] 1 [OP_LIST_MAX]
var_a = 4 var_b = 8 var_c = 1 var_d = 2 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 1 var_g = 2 list_c = [] var_f = int(var_f) var_g = int(var_g) for i in list_b: i = int(i) if (i//var_f)%10 == var_g: list_c.append(i) var_h = 1 list_d=list_c.copy() list_d.sort() var_i = list_d[-var_h] print(int(var_i))
Comparison
At the cinema, guests were seated in rows. If there are 30 chairs between the guest sitting on the far left and the guest sitting on the far right, how many chairs are occupied with guests?
32
30 2 [OP_ADD]
var_a = 30 var_b = 2 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
Nine weights of the same weight weigh a total of 4.5 kilograms (kg). Two of these weights and several pencil cases that weigh 850 grams (g) each were placed on one side of a pan balance scale, and five dictionaries that weigh 1050 grams (g) each were placed on the other side, and they were level. How many pencil cases are there?
5
1050 5 [OP_MUL] 4.5 1000 [OP_MUL] 9 [OP_DIV] 2 [OP_MUL] [OP_SUB] 850 [OP_DIV]
var_a = 1050 var_b = 5 var_c = var_a * var_b var_d = 4.5 var_e = 1000 var_f = var_d * var_e var_g = 9 var_h = var_f / var_g var_i = 2 var_j = var_h * var_i var_k = var_c - var_j var_l = 850 var_m = var_k / var_l print(int(var_m))
Arithmetic calculation
The sum of 39 consecutive odd numbers is 1989. Write the largest odd number among these.
89
1989 39 [OP_DIV] 39 2 [OP_FDIV] 2 [OP_MUL] [OP_ADD]
var_a = 1989 var_b = 39 var_c = var_a / var_b var_d = 39 var_e = 2 var_f = var_d // var_e var_g = 2 var_h = var_f * var_g var_i = var_c + var_h print(int(var_i))
Correspondence
I'm going to repack the chocolate that was packaged two by four. If you have eight packaged chocolates, find how many bundles come out when repackaged.
4
8 2 [OP_MUL] 4 [OP_DIV]
var_a = 8 var_b = 2 var_c = var_a * var_b var_d = 4 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
Taehyung divided 21/11 kilograms (kg) of wooden sticks in each box by 7/11 kilograms (kg), and Hoseok puts 8/17 kilograms (kg) of wooden sticks in each box by 2/17 kilograms (kg). If they are trying to distribute all wooden sticks into boxes without any remains, how many boxes will be needed?
7
21/11 7/11 [OP_DIV] 1 [OP_CEIL] 8/17 2/17 [OP_DIV] 1 [OP_CEIL] [OP_ADD]
var_a = 1.9090909090909092 var_b = 0.6363636363636364 var_c = var_a / var_b var_d = 1 var_e=int(((var_c+9*10**(var_d-2))//(10**(var_d-1)))*10**(var_d-1)) var_f = 0.47058823529411764 var_g = 0.11764705882352941 var_h = var_f / var_g var_i = 1 var_j=int(((var_h+9*10**(var_i-2))//(10**(var_i-1)))*10**(var_i-1)) var_k = var_e + var_j print(int(var_k))
Arithmetic calculation
Minji cleans the house for 0.6 hours every day. How many total hours did Minji spend cleaning the house in 3 weeks?
12.6
0.6 7 [OP_MUL] 3 [OP_MUL]
var_a = 0.6 var_b = 7 var_c = var_a * var_b var_d = 3 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
When Yuna surveyed her classmates, 27 students said they liked math, but 28 students said they liked Korean. When 22 of the friends who said they liked math said they also liked Korean, how many students answered Yuna's question?
33
28 27 [OP_ADD] 22 [OP_SUB]
var_a = 28 var_b = 27 var_c = var_a + var_b var_d = 22 var_e = var_c - var_d print(int(var_e))
Comparison
What is the 2nd smallest of 5, 8, 4, 3, and 7?
4
[OP_LIST_SOL] 5 8 4 3 7 [OP_LIST_EOL] 2 [OP_LIST_MIN]
var_a = 5 var_b = 8 var_c = 4 var_d = 3 var_e = 7 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 2 list_b=list_a.copy() list_b.sort() var_g = list_b[var_f-1] print(int(var_g))
Possibility
How many numbers greater than 100 and less than 1000 consist of only numbers 2 and 3?
8
[OP_LIST_SOL] 2 3 [OP_LIST_EOL] 3 [OP_LIST_GET_PRODUCT] [OP_LIST_LEN]
var_a = 2 var_b = 3 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 = 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
Choose the smallest of the three numbers 5, 8, and 4.
4
[OP_LIST_SOL] 5 8 4 [OP_LIST_EOL] 1 [OP_LIST_MIN]
var_a = 5 var_b = 8 var_c = 4 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 1 list_b=list_a.copy() list_b.sort() var_e = list_b[var_d-1] print(int(var_e))
Correspondence
There are two different numbers A and B. Find the value of B-A from the 4-digit and 3-digit subtraction formula: 2A32-BBB=1BBB.
3
2A32-BBB=1BBB B [OP_DIGIT_UNK_SOLVER] 2A32-BBB=1BBB A [OP_DIGIT_UNK_SOLVER] [OP_SUB]
var_a = '2A32-BBB=1BBB' 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] var_d = '2A32-BBB=1BBB' var_e = 'A' 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))
Arithmetic calculation
I spent 22,000 won on buying 15 apples that cost 1,000 won each and peaches that cost 2,000 won each. Find how many peaches were bought.
7
22000 1000 15 [OP_MUL] [OP_SUB] 2000 1000 [OP_SUB] [OP_DIV]
var_a = 22000 var_b = 1000 var_c = 15 var_d = var_b * var_c var_e = var_a - var_d var_f = 2000 var_g = 1000 var_h = var_f - var_g var_i = var_e / var_h print(int(var_i))
Correspondence
There is a broken calculator. This calculator divides when you press the multiply button, and multiplies when you press the divide button. Jiwoo didn't know that the calculator was broken, so he multiplied a number by 2, and he got 0.5 with the calculator. What is the answer Jiwoo was originally trying to find?
2
0.5 2 [OP_MUL] 2 [OP_MUL]
var_a = 0.5 var_b = 2 var_c = var_a * var_b var_d = 2 var_e = var_c * var_d print(int(var_e))
Geometry
You have a trapezoid with an upper side of 15 centimeters (cm), a lower side of 9 centimeters (cm), and a height of 12 centimeters (cm). How many centimeters (cm) is the side of a square with the same area as the trapezoid?
12
15 9 [OP_ADD] 12 [OP_MUL] 2 [OP_DIV] 1/2 [OP_POW]
var_a = 15 var_b = 9 var_c = var_a + var_b var_d = 12 var_e = var_c * var_d var_f = 2 var_g = var_e / var_f var_h = 0.5 var_i = var_g ** var_h print(int(var_i))
Arithmetic calculation
There are three numbers 10, 11, and 12. What is the sum of the smallest number and the next smallest number?
21
[OP_LIST_SOL] 10 11 12 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_ADD]
var_a = 10 var_b = 11 var_c = 12 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 1 list_b=list_a.copy() list_b.sort() var_e = list_b[var_d-1] var_f = 2 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))
Possibility
When two of the number cards 1, 7, and 0 are used once to form the largest two-digit number, what is the unused number?
0
[OP_LIST_SOL] 1 7 0 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] [OP_LIST_POP] [OP_NUM2LIST] [OP_SET_DIFFERENCE] 1 [OP_LIST_GET]
var_a = 1 var_b = 7 var_c = 0 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] list_d = [] var_f = int(var_f) while var_f//10 > 0: list_d.append(var_f%10) var_f = var_f//10 list_d.append(var_f%10) list_d = list_d[::-1] list_e = list(set(list_a) - set(list_d)) var_g = 1 var_h = list_e[var_g-1] print(int(var_h))
Possibility
When reordering the number magnet 586 to create another three-digit number, what is the largest number that can be made?
865
586 [OP_NUM2LIST] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX]
var_a = 586 list_a = [] var_a = int(var_a) while var_a//10 > 0: list_a.append(var_a%10) var_a = var_a//10 list_a.append(var_a%10) list_a = list_a[::-1] var_b = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_b)) 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_c = 1 list_c=list_b.copy() list_c.sort() var_d = list_c[-var_c] print(int(var_d))
Arithmetic calculation
There are four numbers 10, 11, 12, and 13. What is the difference between the smallest number and the second smallest number?
-1
[OP_LIST_SOL] 10 11 12 13 [OP_LIST_EOL] 1 [OP_LIST_MIN] 2 [OP_LIST_MIN] [OP_SUB]
var_a = 10 var_b = 11 var_c = 12 var_d = 13 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 1 list_b=list_a.copy() list_b.sort() var_f = list_b[var_e-1] var_g = 2 list_c=list_a.copy() list_c.sort() var_h = list_c[var_g-1] var_i = var_f - var_h print(int(var_i))
Arithmetic calculation
To go to her grandmother's house, Kyunghwan took a bus for 1/3 of the distance and the subway for 1/2 of the distance. If the remaining distance was walked, how many times the total distance he traveled on public transportation?
0.83
1/3 1/2 [OP_ADD]
var_a = 0.3333333333333333 var_b = 0.5 var_c = var_a + var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
There are single digits A, B, and C. A47BC is divided by 4, 5, and 9. Find all the number of numbers that can fit in A.
5
A47BC [OP_GEN_POSSIBLE_LIST] 4 [OP_LIST_DIVISIBLE] 5 [OP_LIST_DIVISIBLE] 9 [OP_LIST_DIVISIBLE] A47BC A [OP_LIST_FIND_UNK] [OP_LIST_LEN]
var_a = 'A47BC' 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 = 4 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 = 5 list_c = [] var_c = int(var_c) for i in list_b: i = int(i) if i % var_c == 0: list_c.append(i) var_d = 9 list_d = [] var_d = int(var_d) for i in list_c: i = int(i) if i % var_d == 0: list_d.append(i) var_e = 'A47BC' var_f = 'A' var_e = str(var_e) var_f = str(var_f) unk_idx = var_e.index(var_f) list_e = [] for elem in list_d: elem = str(elem) list_e.append(int(elem[unk_idx])) list_e = list(set(list_e)) var_g = len(list_e) print(int(var_g))
Arithmetic calculation
Sangheon is 1.56 meters (m) tall. Chiho is 0.14meters (m) shorter than Sangheon, and Nara is 0.27meters (m) taller than Chiho. How tall is Nara in meters (m)?
1.69
1.56 0.14 [OP_SUB] 0.27 [OP_ADD]
var_a = 1.56 var_b = 0.14 var_c = var_a - var_b var_d = 0.27 var_e = var_c + var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Geometry
The square-shaped fabric was buttoned regularly without gaps. If the number of buttons on the perimeter is 84, how many buttons are on one outermost side?
22
84 4 [OP_SUB] 4 [OP_DIV] 2 [OP_ADD]
var_a = 84 var_b = 4 var_c = var_a - var_b var_d = 4 var_e = var_c / var_d var_f = 2 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
How many multiples of 8 are there in a five-digit number?
11250
10000 99999 1 [OP_LIST_ARANGE] 8 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
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 = 8 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))
Comparison
Hoseok is standing at the 4th from the front. Consider that there are 5 students between Yoongi and Hoseok, where is Yoongi at counting from the front?
10
4 5 [OP_ADD] 1 [OP_ADD]
var_a = 4 var_b = 5 var_c = var_a + var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Geometry
In a cube-shaped box with one edge measuring 12 centimeters (cm), 54 pieces of colored paper in the shape of a square of a certain size were attached without overlapping and then there was no empty space. How many centimeters (cm) is one edge of this piece of colored paper?
4
12 2 [OP_POW] 6 [OP_MUL] 54 [OP_DIV] 1/2 [OP_POW]
var_a = 12 var_b = 2 var_c = var_a ** var_b var_d = 6 var_e = var_c * var_d var_f = 54 var_g = var_e / var_f var_h = 0.5 var_i = var_g ** var_h print(int(var_i))
Geometry
The length of the promenade near Hyeyoung's house is 6 kilometers (km). While Hyeyoung walked from the starting point to the halfway point of the trail, and Hyeyoung's younger brother walked from the starting point to the half of where Hyeyoung stopped, find how many kilometers (km) Hyeyoung walked.
3
6 2 [OP_DIV]
var_a = 6 var_b = 2 var_c = var_a / var_b print(int(var_c))
Correspondence
There are 6 consecutive natural numbers between 9 and a certain number. What is a certain number when it is greater than 9?
16
9 6 [OP_ADD] 1 [OP_ADD]
var_a = 9 var_b = 6 var_c = var_a + var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Correspondence
When 10+AB=64 is correct, what number should go in A?
5
10+AB=64 A [OP_DIGIT_UNK_SOLVER]
var_a = '10+AB=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))
Arithmetic calculation
Thirty flags were planted every 3 meters (m) on the straight track of the playground. Find the total length of the straight track. (However, flags are also planted at the beginning and the end of straight tracks.)
87
3 30 1 [OP_SUB] [OP_MUL]
var_a = 3 var_b = 30 var_c = 1 var_d = var_b - var_c var_e = var_a * var_d print(int(var_e))
Geometry
Find the edge of a cube whose volume is 3375 cubic centimeters (cm3).
15
3375 1/3 [OP_POW]
var_a = 3375 var_b = 0.3333333333333333 var_c = var_a ** var_b print(int(eval('{:.2f}'.format(round(var_c+1e-10,2)))))
Correspondence
During the experiment, Hyungjun threw away 200 milliliters (ml) of the liquid from the beaker and added 1000 milliliters (ml) of the new liquid. If the current solution in the beaker is 2000 milliliters (ml), find the amount of the solution in milliliters (ml) that was initially contained in the beaker.
1200
2000 1000 [OP_SUB] 200 [OP_ADD]
var_a = 2000 var_b = 1000 var_c = var_a - var_b var_d = 200 var_e = var_c + var_d print(int(var_e))
Possibility
When 5 people V, W, X, Y, and Z are lined up, find the number of ways to put X first and Y and Z next to each other.
12
[OP_LIST_SOL] V W X Y Z [OP_LIST_EOL] [OP_LIST_SOL] X [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_SOL] Y [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_LIST_SOL] Y Z [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_LEN] [OP_PERM] [OP_MUL]
var_a = 'V' var_b = 'W' var_c = 'X' var_d = 'Y' var_e = 'Z' 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 = 'X' list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() list_c = list(set(list_a) - set(list_b)) var_g = 'Y' list_d= [] if "/" in str(var_g): var_g = eval(str(var_g)) list_d.append(var_g) list_d.reverse() list_e = list(set(list_c) - set(list_d)) var_h = len(list_e) var_i = len(list_e) var_j = 1 var_h = int(var_h) var_i = int(var_i) for i, elem in enumerate(range(var_i)): var_j = var_j * (var_h-i) var_k = 'Y' var_l = 'Z' list_f= [] if "/" in str(var_l): var_l = eval(str(var_l)) list_f.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_f.append(var_k) list_f.reverse() var_m = len(list_f) var_n = len(list_f) var_o = 1 var_m = int(var_m) var_n = int(var_n) for i, elem in enumerate(range(var_n)): var_o = var_o * (var_m-i) var_p = var_j * var_o print(int(var_p))
Geometry
The bottom of the square box is filled regularly with glass marbles. If the number of marbles placed in contact with the wall is 84, how many marbles are in contact with one wall?
22
84 4 [OP_SUB] 4 [OP_DIV] 2 [OP_ADD]
var_a = 84 var_b = 4 var_c = var_a - var_b var_d = 4 var_e = var_c / var_d var_f = 2 var_g = var_e + var_f print(int(var_g))
Arithmetic calculation
The 9/16 meters (m) of a wooden stick weighs 1/9 kilogram (kg). Find the weight of a 3 meters (m) wooden stick in kilograms (kg).
0.59
1/9 9/16 [OP_DIV] 3 [OP_MUL]
var_a = 0.1111111111111111 var_b = 0.5625 var_c = var_a / var_b var_d = 3 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
Four people, Jimin, Seokjin, Minyoung, and Taehyung, planted 6, 14, 9, and 15 flowers, respectively. How many is different between the number of flowers planted by the person who planted the most flowers and the person who planted the second fewest?
6
[OP_LIST_SOL] 6 14 9 15 [OP_LIST_EOL] 1 [OP_LIST_MAX] 2 [OP_LIST_MIN] [OP_SUB]
var_a = 6 var_b = 14 var_c = 9 var_d = 15 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 1 list_b=list_a.copy() list_b.sort() var_f = list_b[-var_e] var_g = 2 list_c=list_a.copy() list_c.sort() var_h = list_c[var_g-1] var_i = var_f - var_h print(int(var_i))
Comparison
There are three numbers A, B and C. A is 10 multiplied by 2 plus 9. A is 16 greater than B. B multiplied by 3 is C. What is the largest minus the smallest number?
26
[OP_LIST_SOL] 10 2 [OP_MUL] 9 [OP_ADD] 10 2 [OP_MUL] 9 [OP_ADD] 16 [OP_SUB] 10 2 [OP_MUL] 9 [OP_ADD] 16 [OP_SUB] 3 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] 3 [OP_LIST_MAX] [OP_SUB]
var_a = 10 var_b = 2 var_c = var_a * var_b var_d = 9 var_e = var_c + var_d var_f = 10 var_g = 2 var_h = var_f * var_g var_i = 9 var_j = var_h + var_i var_k = 16 var_l = var_j - var_k var_m = 10 var_n = 2 var_o = var_m * var_n var_p = 9 var_q = var_o + var_p var_r = 16 var_s = var_q - var_r var_t = 3 var_u = var_s * var_t list_a= [] if "/" in str(var_u): var_u = eval(str(var_u)) list_a.append(var_u) if "/" in str(var_l): var_l = eval(str(var_l)) list_a.append(var_l) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) list_a.reverse() var_v = 1 list_b=list_a.copy() list_b.sort() var_w = list_b[-var_v] var_x = 3 list_c=list_a.copy() list_c.sort() var_y = list_c[-var_x] var_z = var_w - var_y print(int(var_z))
Possibility
When Ji An and Shin Young play rock-paper-scissors twice, find the number of cases in which Shin-Young wins both times. (However, a draw may also come out.)
9
3 3 [OP_MUL]
var_a = 3 var_b = 3 var_c = var_a * var_b print(int(var_c))
Correspondence
There is a number that equals 2 when divided by 5. What is the result of this number minus 6?
4
5 2 [OP_MUL] 6 [OP_SUB]
var_a = 5 var_b = 2 var_c = var_a * var_b var_d = 6 var_e = var_c - var_d print(int(var_e))
Correspondence
A certain number is less than 75 but greater than twice 35. Which number is it among 70, 71, 75, and 78?
71
[OP_LIST_SOL] 70 71 75 78 [OP_LIST_EOL] 75 [OP_LIST_LESS] 35 2 [OP_MUL] [OP_LIST_MORE] 1 [OP_LIST_GET]
var_a = 70 var_b = 71 var_c = 75 var_d = 78 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 = 75 list_b = [] for i in list_a: if i < var_e: list_b.append(i) var_f = 35 var_g = 2 var_h = var_f * var_g list_c = [] for i in list_b: if i > var_h: list_c.append(i) var_i = 1 var_j = list_c[var_i-1] print(int(var_j))
Arithmetic calculation
When 13 is divided by A, the quotient is B and the remainder is 3. A and B are both natural numbers. What is the smallest number of possible Bs?
1
1
var_a = 1 print(int(var_a))
Possibility
A book is said to have up to 413 pages. How many times will 4 be printed when page numbers are printed in this book?
95
1 413 1 [OP_LIST_ARANGE] [OP_LIST2NUM] [OP_NUM2LIST] 4 [OP_LIST_FIND_NUM]
var_a = 1 var_b = 413 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d="" for i in list_a: i = str(i) var_d = var_d + i list_b = [] var_d = int(var_d) while var_d//10 > 0: list_b.append(var_d%10) var_d = var_d//10 list_b.append(var_d%10) list_b = list_b[::-1] var_e = 4 var_f = 0 var_e = int(var_e) for i in list_b: i = int(i) if i == var_e: var_f = var_f + 1 print(int(var_f))
Geometry
The width of a rectangle is 2 centimeters (cm) longer than its length, and its perimeter is 16 centimeters (cm). What is length of the width?
5
16 2 [OP_DIV] 2 [OP_SUB] 2 [OP_DIV] 2 [OP_ADD]
var_a = 16 var_b = 2 var_c = var_a / var_b var_d = 2 var_e = var_c - var_d var_f = 2 var_g = var_e / var_f var_h = 2 var_i = var_g + var_h print(int(var_i))
Comparison
Yoongi collected 4, Jungkook collected 6 multiplied by 3, and Yuna collected 5. Who got the smallest number?
Yoongi
[OP_LIST_SOL] Yoongi Jungkook Yuna [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_MUL] 5 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yoongi' var_b = 'Jungkook' var_c = 'Yuna' 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 = 3 var_g = var_e * var_f var_h = 5 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_d): var_d = eval(str(var_d)) list_b.append(var_d) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[var_i-1] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Arithmetic calculation
What is the sum of the numbers 7.52 and 12.23?
19.75
7.52 12.23 [OP_ADD]
var_a = 7.52 var_b = 12.23 var_c = var_a + var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Possibility
How many possible ways are there to create a natural number less than or equal to 100 by selecting two out of five pieces of paper with the numbers 0, 2, 4, 5, and 8 written on them?
16
[OP_LIST_SOL] 0 2 4 5 8 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 100 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 0 var_b = 2 var_c = 4 var_d = 5 var_e = 8 list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 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 = 100 list_c = [] for i in list_b: if i <= var_g: list_c.append(i) var_h = len(list_c) print(int(var_h))
Possibility
Find the total sum of each digit of numbers that are a multiple of 9, and less than 80.
72
1 80 1 [OP_SUB] 1 [OP_LIST_ARANGE] 9 [OP_LIST_DIVISIBLE] [OP_LIST2NUM] [OP_NUM2LIST] [OP_LIST_SUM]
var_a = 1 var_b = 80 var_c = 1 var_d = var_b - var_c var_e = 1 list_a = [i for i in range(var_a, var_d + 1, var_e)] var_f = 9 list_b = [] var_f = int(var_f) for i in list_a: i = int(i) if i % var_f == 0: list_b.append(i) var_g="" for i in list_b: i = str(i) var_g = var_g + i list_c = [] var_g = int(var_g) while var_g//10 > 0: list_c.append(var_g%10) var_g = var_g//10 list_c.append(var_g%10) list_c = list_c[::-1] list_c = [float(i) for i in list_c] var_h = sum(list_c) print(int(var_h))
Arithmetic calculation
Mingyu's mobile phone charges 30 won per ten seconds for a video call. If Mingyu made a video call with her grandmother for 2 minutes and 40 seconds, how much would it cost?
480
2 60 [OP_MUL] 40 [OP_ADD] 10 [OP_DIV] 30 [OP_MUL]
var_a = 2 var_b = 60 var_c = var_a * var_b var_d = 40 var_e = var_c + var_d var_f = 10 var_g = var_e / var_f var_h = 30 var_i = var_g * var_h print(int(var_i))
Possibility
When you press buttons 1, 2, and 3 once, how many different ways can you press them in a different order?
6
[OP_LIST_SOL] 1 2 3 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 1 var_b = 2 var_c = 3 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = len(list_a) 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))
Correspondence
Rounding down 17A7 to the tens place gives 1710. Get A.
1
17A7 [OP_GEN_POSSIBLE_LIST] 1710 [OP_LIST_MORE_EQUAL] 1710 10 [OP_ADD] [OP_LIST_LESS] 17A7 A [OP_LIST_FIND_UNK]
var_a = '17A7' 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 = 1710 list_b = [] for i in list_a: if i >= var_b: list_b.append(i) var_c = 1710 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 = '17A7' 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))
Arithmetic calculation
Jinhee tries to read the entire 220-page children's book in a week. How many pages at least should she read a day?
32
220 7 [OP_DIV] 1 [OP_CEIL]
var_a = 220 var_b = 7 var_c = var_a / var_b var_d = 1 var_e=int(((var_c+9*10**(var_d-2))//(10**(var_d-1)))*10**(var_d-1)) print(int(var_e))
Geometry
There is a park in the shape of a square with sides measuring 8 meters (m) and 10 meters (m). Find the sum of the areas of the two parks.
164
8 2 [OP_POW] 10 2 [OP_POW] [OP_ADD]
var_a = 8 var_b = 2 var_c = var_a ** var_b var_d = 10 var_e = 2 var_f = var_d ** var_e var_g = var_c + var_f print(int(var_g))
Possibility
You want to create a three-digit number by drawing three different numbers from 0, 1, 3, and 5. Find the sum of the largest and smallest possible numbers.
634
[OP_LIST_SOL] 0 1 3 5 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD]
var_a = 0 var_b = 1 var_c = 3 var_d = 5 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_e)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_f = 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))
Geometry
A rectangle was made from a piece of string that was 50 centimeters (cm) long. The horizontal length is 13 centimeters (cm). What is the vertical length?
12
50 2 [OP_DIV] 13 [OP_SUB]
var_a = 50 var_b = 2 var_c = var_a / var_b var_d = 13 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
There are 20 children's books in a box. How many children's books are in the 5 boxes?
100
20 5 [OP_MUL]
var_a = 20 var_b = 5 var_c = var_a * var_b print(int(var_c))
Arithmetic calculation
After folding 45 sheets of colored paper, folded 18 more. How many sheets of colored paper are all folded?
63
45 18 [OP_ADD]
var_a = 45 var_b = 18 var_c = var_a + var_b print(int(var_c))
Arithmetic calculation
In the multiplication of two-digit numbers, the number 2 in the tens digit of the number being multiplied was misinterpreted as 6, resulting in a calculated value of 2496. When the correctly calculated value is 936, find the sum of the two two-digit numbers.
63
[OP_LIST_SOL] 2496 936 [OP_SUB] 6 2 [OP_SUB] 10 [OP_MUL] [OP_DIV] 936 2496 936 [OP_SUB] 6 2 [OP_SUB] 10 [OP_MUL] [OP_DIV] [OP_DIV] [OP_LIST_EOL] [OP_LIST_SUM]
var_a = 2496 var_b = 936 var_c = var_a - var_b var_d = 6 var_e = 2 var_f = var_d - var_e var_g = 10 var_h = var_f * var_g var_i = var_c / var_h var_j = 936 var_k = 2496 var_l = 936 var_m = var_k - var_l var_n = 6 var_o = 2 var_p = var_n - var_o var_q = 10 var_r = var_p * var_q var_s = var_m / var_r var_t = var_j / var_s list_a= [] if "/" in str(var_t): var_t = eval(str(var_t)) list_a.append(var_t) if "/" in str(var_i): var_i = eval(str(var_i)) list_a.append(var_i) list_a.reverse() list_a = [float(i) for i in list_a] var_u = sum(list_a) print(int(var_u))
Geometry
There are 54 square-shaped pieces of colored paper that can cover the face of a cube with edges measuring 12 centimeters (cm) without gaps. How many centimeters (cm) is one side of this sheet of paper?
4
12 2 [OP_POW] 6 [OP_MUL] 54 [OP_DIV] 1/2 [OP_POW]
var_a = 12 var_b = 2 var_c = var_a ** var_b var_d = 6 var_e = var_c * var_d var_f = 54 var_g = var_e / var_f var_h = 0.5 var_i = var_g ** var_h print(int(var_i))
Geometry
There are 5 men whose arms are 1 meter (m) 70 centimeters (cm) when they are stretched out to the sides. If these men stand side by side with their arms extended and their fingertips connected along the long side of a rectangular swimming pool, and it is 80 centimeters (cm) shorter than the pool wall, how long is the longer side of the pool, in meters (m)?
9.3
1 100 [OP_MUL] 70 [OP_ADD] 5 [OP_MUL] 80 [OP_ADD] 100 [OP_DIV]
var_a = 1 var_b = 100 var_c = var_a * var_b var_d = 70 var_e = var_c + var_d var_f = 5 var_g = var_e * var_f var_h = 80 var_i = var_g + var_h var_j = 100 var_k = var_i / var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Comparison
912 is the value calculated correctly from multiplication of two digits. The calculated value is 2432 when the number 2 in the tens place of the multiplication number is incorrectly calculated as 6. Write the smaller one of the two two digit numbers.
24
[OP_LIST_SOL] 2432 912 [OP_SUB] 6 2 [OP_SUB] 10 [OP_MUL] [OP_DIV] 912 2432 912 [OP_SUB] 6 2 [OP_SUB] 10 [OP_MUL] [OP_DIV] [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MIN]
var_a = 2432 var_b = 912 var_c = var_a - var_b var_d = 6 var_e = 2 var_f = var_d - var_e var_g = 10 var_h = var_f * var_g var_i = var_c / var_h var_j = 912 var_k = 2432 var_l = 912 var_m = var_k - var_l var_n = 6 var_o = 2 var_p = var_n - var_o var_q = 10 var_r = var_p * var_q var_s = var_m / var_r var_t = var_j / var_s list_a= [] if "/" in str(var_t): var_t = eval(str(var_t)) list_a.append(var_t) if "/" in str(var_i): var_i = eval(str(var_i)) list_a.append(var_i) list_a.reverse() var_u = 1 list_b=list_a.copy() list_b.sort() var_v = list_b[var_u-1] print(int(var_v))
Arithmetic calculation
There are 19 candy bags of 46 each, and several tins of sunflower seeds, each containing 170 seeds. If the number of candies and sunflower seeds added together gives the number 1894, how many tins of sunflower seeds are there?
6
1894 46 19 [OP_MUL] [OP_SUB] 170 [OP_FDIV]
var_a = 1894 var_b = 46 var_c = 19 var_d = var_b * var_c var_e = var_a - var_d var_f = 170 var_g = var_e // var_f print(int(var_g))
Geometry
Find the number of diagonals that can be drawn from the pentadecagon.
90
15 15 3 [OP_SUB] [OP_MUL] 2 [OP_DIV]
var_a = 15 var_b = 15 var_c = 3 var_d = var_b - var_c var_e = var_a * var_d var_f = 2 var_g = var_e / var_f print(int(var_g))
Arithmetic calculation
How many three-digit numbers are divisible by the both three numbers 5, 8, and 2?
22
100 999 1 [OP_LIST_ARANGE] 5 [OP_LIST_DIVISIBLE] 8 [OP_LIST_DIVISIBLE] 2 [OP_LIST_DIVISIBLE] [OP_LIST_LEN]
var_a = 100 var_b = 999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 5 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 = 8 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 = len(list_d) print(int(var_g))
Correspondence
A is a natural number from 1 to 9. When 63×2>21×A, find the sum of all the numbers that can fit in A.
15
63×2>21×A A [OP_DIGIT_UNK_SOLVER] [OP_LIST_SUM]
var_a = '63×2>21×A' 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] = [] 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].append(int(c[i])) list_a = list(set(ans_dict[var_b])) list_a = [float(i) for i in list_a] var_c = sum(list_a) print(int(var_c))
Arithmetic calculation
The father panda in the zoo weighs 145/4 kilograms (kg), and the mother panda is 47/10 kilograms (kg) lighter than the father panda. How many kilograms (kg) does the mother panda weigh?
31.55
145/4 47/10 [OP_SUB]
var_a = 36.25 var_b = 4.7 var_c = var_a - var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Arithmetic calculation
You want to sell 180 apples in a mart divided equally into 6 baskets. If you sell apples for 200 won each, how much are the apples in a basket?
6000
180 6 [OP_DIV] 200 [OP_MUL]
var_a = 180 var_b = 6 var_c = var_a / var_b var_d = 200 var_e = var_c * var_d print(int(var_e))
Comparison
At a Gimbap shop, basic Gimbap is 2,000 won, tuna Gimbap is 3,500 won, red pepper Gimbap is 3,000 won, beef Gimbap is 4,000 won, and nude Gimbap is 3,500 won. how much would you have to pay if you bought two gimbaps each that cost more than or equal to 3500 won?
22000
[OP_LIST_SOL] 2000 3500 3000 4000 3500 [OP_LIST_EOL] 3500 [OP_LIST_MORE_EQUAL] [OP_LIST_SUM] 2 [OP_MUL]
var_a = 2000 var_b = 3500 var_c = 3000 var_d = 4000 var_e = 3500 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 = 3500 list_b = [] for i in list_a: if i >= var_f: list_b.append(i) list_b = [float(i) for i in list_b] var_g = sum(list_b) var_h = 2 var_i = var_g * var_h print(int(var_i))
Arithmetic calculation
Jungkook's weight is 154 grams (g) heavier than 54 kilograms (kg). Write Jungkook's weight in grams (g).
54154
54 1000 [OP_MUL] 154 [OP_ADD]
var_a = 54 var_b = 1000 var_c = var_a * var_b var_d = 154 var_e = var_c + var_d print(int(var_e))
Arithmetic calculation
What is the greatest two-digit multiple of 3?
99
10 99 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 1 [OP_LIST_MAX]
var_a = 10 var_b = 99 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 3 list_b = [] var_d = int(var_d) for i in list_a: i = int(i) if i % var_d == 0: list_b.append(i) var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] print(int(var_f))
Comparison
Seokjin is 15th in line at the mart, and Namjoon is 6 people ahead of Seokjin. What number is Namjoon on?
8
15 6 [OP_SUB] 1 [OP_SUB]
var_a = 15 var_b = 6 var_c = var_a - var_b var_d = 1 var_e = var_c - var_d print(int(var_e))
Possibility
Use the number cards 1, 4, 9, and 5 once each to form the biggest number.
9541
[OP_LIST_SOL] 1 4 9 5 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX]
var_a = 1 var_b = 4 var_c = 9 var_d = 5 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 = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] print(int(var_g))
Arithmetic calculation
I bought 8 cupboards of the same shape. This cupboard has 5 compartments and each compartment can hold 85 tea cups. How many teacups can I put in my new cupboard?
3400
8 5 [OP_MUL] 85 [OP_MUL]
var_a = 8 var_b = 5 var_c = var_a * var_b var_d = 85 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
I am trying to create numbers from 1 to 300 with number cards from 0 to 9. How many number card 3 are needed in all?
61
1 300 1 [OP_LIST_ARANGE] [OP_LIST2NUM] [OP_NUM2LIST] 3 [OP_LIST_FIND_NUM]
var_a = 1 var_b = 300 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 = 3 var_f = 0 var_e = int(var_e) for i in list_b: i = int(i) if i == var_e: var_f = var_f + 1 print(int(var_f))
Arithmetic calculation
The total weight of persimmon is 3 kg (kg). If the weight of 5 persimmons is 1 kg, how many persimmons are there in all?
15
5 1 [OP_MUL] 3 [OP_MUL]
var_a = 5 var_b = 1 var_c = var_a * var_b var_d = 3 var_e = var_c * var_d print(int(var_e))
Comparison
As a result of the Korean test at school, Taehyung, Minju, Sangmin, Yoonjung, and Yoojung scored higher in the order of name. Who has the highest score?
Taehyung
[OP_LIST_SOL] Taehyung Minju Sangmin Yoonjung Yoojung [OP_LIST_EOL] 1 [OP_LIST_GET]
var_a = 'Taehyung' var_b = 'Minju' var_c = 'Sangmin' var_d = 'Yoonjung' var_e = 'Yoojung' list_a= [] if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_f = 1 var_g = list_a[var_f-1] print(var_g)
Correspondence
We have the expression 3A+B82=216. Find the number that goes into B
1
3A+B82=216 B [OP_DIGIT_UNK_SOLVER]
var_a = '3A+B82=216' 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))
Arithmetic calculation
There are 7, 1, 3, 2, 4, 9 and 5. How many of them are between 2 and 6?
4
[OP_LIST_SOL] 7 1 3 2 4 9 5 [OP_LIST_EOL] 2 [OP_LIST_MORE_EQUAL] 6 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 7 var_b = 1 var_c = 3 var_d = 2 var_e = 4 var_f = 9 var_g = 5 list_a= [] if "/" in str(var_g): var_g = eval(str(var_g)) list_a.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_h = 2 list_b = [] for i in list_a: if i >= var_h: list_b.append(i) var_i = 6 list_c = [] for i in list_b: if i <= var_i: list_c.append(i) var_j = len(list_c) print(int(var_j))
Comparison
There are 5 boxes of 30 tangerines, each weighing 200 grams (g). There are 3 boxes of 20 apples, each weighing 450 grams (g). In addition, there are 4 boxes containing 15 pears, each weighing 800 grams (g). Which fruit has the highest frequency?
tangerines
[OP_LIST_SOL] tangerines apples pears [OP_LIST_EOL] [OP_LIST_SOL] 30 5 [OP_MUL] 20 3 [OP_MUL] 15 4 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'tangerines' var_b = 'apples' var_c = 'pears' 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 = 30 var_e = 5 var_f = var_d * var_e var_g = 20 var_h = 3 var_i = var_g * var_h var_j = 15 var_k = 4 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)
Comparison
Yoongi had 4 apples and Jungkook had 6 apples, but he ate 3 of them. Who has more apples?
Yoongi
[OP_LIST_SOL] Yoongi Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_SUB] [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)
Arithmetic calculation
Find the sum of odd numbers from 1 to 50.
625
1 50 [OP_LIST_ODD] [OP_LIST_SUM]
var_a = 1 var_b = 50 list_a = [] if var_a%2==0: for i in range(var_a+1, var_b+1, 2): list_a.append(i) else: for i in range(var_a, var_b+1, 2): list_a.append(i) list_a = [float(i) for i in list_a] var_c = sum(list_a) print(int(var_c))
Arithmetic calculation
There are 60 red balls and 30 blue balls. If there are 5 more number of red balls than the number of blue and white balls combined. How many white balls are there?
25
60 30 [OP_SUB] 5 [OP_SUB]
var_a = 60 var_b = 30 var_c = var_a - var_b var_d = 5 var_e = var_c - var_d print(int(var_e))
Geometry
Find the volume of a quadrangular prism whose base and sides are squares with a perimeter of 32 centimeters (cm).
512
32 4 [OP_DIV] 3 [OP_POW]
var_a = 32 var_b = 4 var_c = var_a / var_b var_d = 3 var_e = var_c ** var_d print(int(var_e))
Arithmetic calculation
The total weight of Hanbyul and Hansol is 88 kg (kg). If Hanbyul is 4 kilograms (kg) heavier than Hansol, how many kilograms (kg) does Hansol weigh?
42
88 4 [OP_SUB] 2 [OP_DIV]
var_a = 88 var_b = 4 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Geometry
Find the sum of the interior angles of a regular decagon divided by the number of interior angles.
144
10 2 [OP_SUB] 180 [OP_MUL] 10 [OP_DIV]
var_a = 10 var_b = 2 var_c = var_a - var_b var_d = 180 var_e = var_c * var_d var_f = 10 var_g = var_e / var_f print(int(var_g))
Arithmetic calculation
Street lamps are erected at 50 meter (m) intervals along the both sides of lake road. If the total length of the lake road is 1650 meters (m) and there are street lamps at the beginning and end of the bridge, how many street lamps are there on both sides of the lake road?
68
1650 50 [OP_DIV] 1 [OP_ADD] 2 [OP_MUL]
var_a = 1650 var_b = 50 var_c = var_a / var_b var_d = 1 var_e = var_c + var_d var_f = 2 var_g = var_e * var_f print(int(var_g))
Possibility
Use number cards 1, 6, 3, and 9 all and once to find the sum of the largest and smallest numbers that can be made.
11000
[OP_LIST_SOL] 1 6 3 9 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 1 [OP_LIST_MIN] [OP_ADD]
var_a = 1 var_b = 6 var_c = 3 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) 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))
Correspondence
A company has 928 employees. If 713 employees of those are working in Korea, find how many fewer employees work abroad than those working in Korea?
498
713 928 713 [OP_SUB] [OP_SUB]
var_a = 713 var_b = 928 var_c = 713 var_d = var_b - var_c var_e = var_a - var_d print(int(var_e))
Arithmetic calculation
Taehyung has 12,000 won and Minwoo has 4,000 won. Taehyung gets an allowance of 300 won every day and Minwoo gets an allowance of 500 won every day. How many days later will Taehyung and Minwoo have the same amount of money?
40
12000 4000 [OP_SUB] 500 300 [OP_SUB] [OP_DIV]
var_a = 12000 var_b = 4000 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))
Correspondence
Divide a number by 11 and get 2. Find the result of 6 multiplied by a number.
132
2 11 [OP_MUL] 6 [OP_MUL]
var_a = 2 var_b = 11 var_c = var_a * var_b var_d = 6 var_e = var_c * var_d print(int(var_e))
Comparison
In the auditorium at Yunju's school, the number of chairs in each row is the same in a square shape. The seat for Yunju is 2nd from the front, 5th from the back, 3rd from the right, and 4th from the left. How many chairs are there in the auditorium at Yunju's school?
36
2 5 [OP_ADD] 1 [OP_SUB] 3 4 [OP_ADD] 1 [OP_SUB] [OP_MUL]
var_a = 2 var_b = 5 var_c = var_a + var_b var_d = 1 var_e = var_c - var_d var_f = 3 var_g = 4 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
What number must go into A to make AB2-41=591 valid?
6
AB2-41=591 A [OP_DIGIT_UNK_SOLVER]
var_a = 'AB2-41=591' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) if len(new_eq) == len(var_a): new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: eval_result = eval(new_eq) except: pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] print(int(var_c))
Comparison
Jina gave Donghwa 4 out of 12 tangerines, and Youngho gave Donghwa 6 out of 15 tangerines. Who has the most tangerines when Donghwa has only the tangerines that were given by Jina and Youngho?
Donghwa
[OP_LIST_SOL] Jina Youngho Donghwa [OP_LIST_EOL] [OP_LIST_SOL] 12 4 [OP_SUB] 15 6 [OP_SUB] 4 6 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jina' var_b = 'Youngho' var_c = 'Donghwa' list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 12 var_e = 4 var_f = var_d - var_e var_g = 15 var_h = 6 var_i = var_g - var_h var_j = 4 var_k = 6 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)
Comparison
Namjoon came second, and Yoongi came right behind him. 3 people came after Yoongi and after them, Hoseok came. What's Hoseok's ranking?
6
2 1 [OP_ADD] 3 [OP_ADD]
var_a = 2 var_b = 1 var_c = var_a + var_b var_d = 3 var_e = var_c + var_d print(int(var_e))