category
stringclasses
5 values
question
stringlengths
20
555
answer
stringlengths
1
20
solution_abst
stringlengths
1
287
solution_code
stringlengths
27
5.97k
Geometry
A fishbowl containing an object called (A) has been filled with water to a height of 16 centimeters (cm). If the length of one corner of the fishbowl is 20 centimeters (cm) and if (A) is removed, the height is 9 centimeters (cm), then what is the volume of the (A)?
2800
20 20 [OP_MUL] 16 9 [OP_SUB] [OP_MUL]
var_a = 20 var_b = 20 var_c = var_a * var_b var_d = 16 var_e = 9 var_f = var_d - var_e var_g = var_c * var_f print(int(var_g))
Comparison
60 presses printed 40680 sheets of paper in print shop A and 55 presses printed 37510 sheets of paper in print shop B. Which printshop printed more sheets per press on average?
B
[OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] 40680 60 [OP_DIV] 37510 55 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [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 = 40680 var_d = 60 var_e = var_c / var_d var_f = 37510 var_g = 55 var_h = var_f / var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Arithmetic calculation
Eunji bought a 350 won snack at the mart with the money she had and received 800 won from her mother as an allowance. I bought a pencil with half of the remaining money, and I had 550 won left. How much money did Eunji have at first?
650
550 2 [OP_MUL] 800 [OP_SUB] 350 [OP_ADD]
var_a = 550 var_b = 2 var_c = var_a * var_b var_d = 800 var_e = var_c - var_d var_f = 350 var_g = var_e + var_f print(int(var_g))
Comparison
There are numbers 0.8, 1/2, 0.9, and 1/3. Find the largest of the given numbers that are less than 0.6.
0.5
[OP_LIST_SOL] 0.8 1/2 0.9 1/3 [OP_LIST_EOL] 0.6 [OP_LIST_LESS] 1 [OP_LIST_MAX]
var_a = 0.8 var_b = 0.5 var_c = 0.9 var_d = 0.3333333333333333 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 0.6 list_b = [] for i in list_a: if i < var_e: list_b.append(i) var_f = 1 list_c=list_b.copy() list_c.sort() var_g = list_c[-var_f] print('{:.2f}'.format(round(var_g+1e-10,2)))
Possibility
How many total amounts can you pay with 4 500-won coins, 2 100-won coins, and 10 10-won coins? (However, the case where the payment amount is 0 won is excluded.)
154
4 1 [OP_ADD] 100 2 [OP_MUL] 10 [OP_FDIV] 10 [OP_ADD] 1 [OP_ADD] [OP_MUL] 1 [OP_SUB]
var_a = 4 var_b = 1 var_c = var_a + var_b var_d = 100 var_e = 2 var_f = var_d * var_e var_g = 10 var_h = var_f // var_g var_i = 10 var_j = var_h + var_i var_k = 1 var_l = var_j + var_k var_m = var_c * var_l var_n = 1 var_o = var_m - var_n print(int(var_o))
Correspondence
Yoongi wants to add a four-digit number to 57. Yoongi confused 9 as a 6 in the units digit of a four-digit number. When the sum obtained by Yoongi is 1823, find the correct calculation result.
1826
1823 57 [OP_SUB] 6 9 [OP_SUB] [OP_SUB] 57 [OP_ADD]
var_a = 1823 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 var_h = 57 var_i = var_g + var_h print(int(var_i))
Arithmetic calculation
Yoojung gave 5 notebooks she had at first to her older sister, and then gave half of the remaining ones to her younger sister. She counted the number of notebooks left at the end, and it was 4. How many notebooks did Yoojung have at first?
13
4 2 [OP_MUL] 5 [OP_ADD]
var_a = 4 var_b = 2 var_c = var_a * var_b var_d = 5 var_e = var_c + var_d print(int(var_e))
Correspondence
When 1/6×1/3=1/(A×3)=1/B, what is the sum of A and B?
24
1/6×1/3=1/(A×3)=1/B A [OP_NUM_UNK_SOLVER] 1/6×1/3=1/(A×3)=1/B B [OP_NUM_UNK_SOLVER] [OP_ADD]
var_a = '1/6×1/3=1/(A×3)=1/B' var_b = 'A' ans_dict = dict() var_a = var_a.replace('×','*') var_a = var_a.replace('x','*') var_a = var_a.replace('÷','/') variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']) for v in set(var_a): if v in variable_candi: ans_dict[v] = 0 candidate_num = [i for i in range(51)] candi = list(itertools.product(candidate_num, repeat=len(ans_dict))) for c in candi: temp = var_a for i, (k, _) in enumerate(ans_dict.items()): temp = temp.replace(k, str(c[i])) term_list = [] op_list = [] temp_c = '' for tc in temp: if tc not in '+-*/=><().': temp_c += tc else: op_list.append(tc) term_list.append(temp_c) temp_c = '' term_list.append(temp_c) new_eq = '' for i in range(len(op_list)): if term_list[i] == '': new_eq += str(term_list[i])+op_list[i] else: new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: if '=' in new_eq and '>' not in new_eq and '<' not in new_eq: new_eq=new_eq.replace('==','=') new_eq=new_eq.replace('>','') new_eq=new_eq.replace('<','') new_eq=new_eq.split('=') for i in range(len(new_eq)-1): eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1])) if not eval_result: break else: eval_result = eval(new_eq) except: eval_result = False pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_c = ans_dict[var_b] var_d = '1/6×1/3=1/(A×3)=1/B' 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] = 0 candidate_num = [i for i in range(51)] candi = list(itertools.product(candidate_num, repeat=len(ans_dict))) for c in candi: temp = var_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)): if term_list[i] == '': new_eq += str(term_list[i])+op_list[i] else: new_eq += str(int(term_list[i]))+op_list[i] new_eq += str(int(term_list[-1])) new_eq=new_eq.replace('=', '==') new_eq=new_eq.replace('>==', '>=') new_eq=new_eq.replace('<==', '<=') eval_result = False try: if '=' in new_eq and '>' not in new_eq and '<' not in new_eq: new_eq=new_eq.replace('==','=') new_eq=new_eq.replace('>','') new_eq=new_eq.replace('<','') new_eq=new_eq.split('=') for i in range(len(new_eq)-1): eval_result = math.isclose(eval(new_eq[i]), eval(new_eq[i+1])) if not eval_result: break else: eval_result = eval(new_eq) except: eval_result = False pass if eval_result: for i, (k, _) in enumerate(ans_dict.items()): ans_dict[k] = int(c[i]) var_f = ans_dict[var_e] var_g = var_c + var_f print(int(var_g))
Comparison
There are four numbers A, B, C, and D. A is 19 less than D. C is 4 times A. C is 15 greater than B. If A is 3 multiplied by 3, what is the second largest number among A, B, C, and D?
D
[OP_LIST_SOL] A C B D [OP_LIST_EOL] [OP_LIST_SOL] 3 3 [OP_MUL] 3 3 4 [OP_MUL] [OP_MUL] 9 4 19 [OP_MUL] [OP_SUB] 3 3 19 [OP_MUL] [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'A' var_b = 'C' var_c = 'B' var_d = 'D' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 var_f = 3 var_g = var_e * var_f var_h = 3 var_i = 3 var_j = 4 var_k = var_i * var_j var_l = var_h * var_k var_m = 9 var_n = 4 var_o = 19 var_p = var_n * var_o var_q = var_m - var_p var_r = 3 var_s = 3 var_t = 19 var_u = var_s * var_t var_v = var_r + var_u list_b= [] if "/" in str(var_v): var_v = eval(str(var_v)) list_b.append(var_v) if "/" in str(var_q): var_q = eval(str(var_q)) list_b.append(var_q) if "/" in str(var_l): var_l = eval(str(var_l)) list_b.append(var_l) if "/" in str(var_g): var_g = eval(str(var_g)) list_b.append(var_g) list_b.reverse() var_w = 1 list_c=list_b.copy() list_c.sort() var_x = list_c[-var_w] var_y = list_b.index(var_x)+1 var_z = list_a[var_y-1] print(var_z)
Geometry
There is a pyramid with a regular hexagon at the base and a side edge measuring 8 centimeters (cm). If the sum of the lengths of all the edges of this pyramid is 120 centimeters (cm), what is the length of one edge of the base in centimeters (cm)?
12
120 8 6 [OP_MUL] [OP_SUB] 6 [OP_DIV]
var_a = 120 var_b = 8 var_c = 6 var_d = var_b * var_c var_e = var_a - var_d var_f = 6 var_g = var_e / var_f print(int(var_g))
Correspondence
Find the answer, including the decimal point, for the sum of the largest and smallest numbers with two decimals, which give 3.5 when rounded off from two decimal places.
6.99
3.45 3.54 [OP_ADD]
var_a = 3.45 var_b = 3.54 var_c = var_a + var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Possibility
How many odd numbers are there when you press 2 of the 5 buttons which are 0, 1, 2, 3, and 4 on the calculator to create a two-digit integer?
6
[OP_LIST_SOL] 0 1 2 3 4 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 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 = 2 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_f)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_g = 2 list_c = [] var_g = int(var_g) for i in list_b: i = int(i) if i % var_g == 0: list_c.append(i) list_d = list(set(list_b) - set(list_c)) var_h = len(list_d) print(int(var_h))
Geometry
A quadrilateral has a pair of parallel sides. The length of one of the parallel sides is 25 centimeters (cm), and the distance between the two sides is 13 centimeters (cm). If the area of this rectangle is 286 square cm (cm2), find the length of the side that is not 25 centimeters (cm) in centimeters (cm).
19
286 13 [OP_DIV] 2 [OP_MUL] 25 [OP_SUB]
var_a = 286 var_b = 13 var_c = var_a / var_b var_d = 2 var_e = var_c * var_d var_f = 25 var_g = var_e - var_f print(int(var_g))
Correspondence
Add 8 to a certain number and multiply by 3 to get 36. Find this particular number.
4
36 3 [OP_DIV] 8 [OP_SUB]
var_a = 36 var_b = 3 var_c = var_a / var_b var_d = 8 var_e = var_c - var_d print(int(var_e))
Arithmetic calculation
When there are 57 boys and 82 girls on the playground, the number of female students is 13 more than male students plus teachers. How many teachers are there in the playground?
12
82 13 [OP_SUB] 57 [OP_SUB]
var_a = 82 var_b = 13 var_c = var_a - var_b var_d = 57 var_e = var_c - var_d print(int(var_e))
Correspondence
A number is divisible by 5 and the quotient is 96. What is the result of adding 17 to the number and then multiplying by 69?
34293
5 96 [OP_MUL] 17 [OP_ADD] 69 [OP_MUL]
var_a = 5 var_b = 96 var_c = var_a * var_b var_d = 17 var_e = var_c + var_d var_f = 69 var_g = var_e * var_f print(int(var_g))
Geometry
If the lengths of the two sides of a parallelogram are 10 centimeters (cm) and 7 centimeters (cm), how many centimeters (cm) is the sum of the lengths of the four sides?
34
10 7 [OP_ADD] 2 [OP_MUL]
var_a = 10 var_b = 7 var_c = var_a + var_b var_d = 2 var_e = var_c * var_d print(int(var_e))
Correspondence
Which number from 2 to 5 is less than 4?
3
2 1 [OP_ADD] 5 1 [OP_SUB] 1 [OP_LIST_ARANGE] 4 [OP_LIST_LESS] 1 [OP_LIST_GET]
var_a = 2 var_b = 1 var_c = var_a + var_b var_d = 5 var_e = 1 var_f = var_d - var_e var_g = 1 list_a = [i for i in range(var_c, var_f + 1, var_g)] var_h = 4 list_b = [] for i in list_a: if i < var_h: list_b.append(i) var_i = 1 var_j = list_b[var_i-1] print(int(var_j))
Possibility
Find the difference between the smallest number and the third smallest number you can make by using all the stones 1, 6, and 8 once each to make a three-digit number.
450
[OP_LIST_SOL] 1 6 8 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 1 [OP_LIST_MIN] 3 [OP_LIST_MIN] [OP_SUB] [OP_ABS]
var_a = 1 var_b = 6 var_c = 8 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 3 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_d)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[var_e-1] var_g = 3 list_d=list_b.copy() list_d.sort() var_h = list_d[var_g-1] var_i = var_f - var_h var_j = abs(var_i) print(int(var_j))
Comparison
How many of 0.8, 1/2, and 0.9 are greater than 0.4?
3
[OP_LIST_SOL] 0.8 1/2 0.9 [OP_LIST_EOL] 0.4 [OP_LIST_MORE] [OP_LIST_LEN]
var_a = 0.8 var_b = 0.5 var_c = 0.9 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 0.4 list_b = [] for i in list_a: if i > var_d: list_b.append(i) var_e = len(list_b) print(int(var_e))
Arithmetic calculation
The red, yellow and blue bags contain a number of books. The total weight of the books in the three bags is 1 kilogram (kg) and 200 grams (g). If you move a 200 gram (g) book from a blue bag to a yellow bag and a 100 gram (g) book to a red bag, the books in the three bags will weigh the same. Find the sum of the weights of the books that were originally in the red bag.
300
1 1000 [OP_MUL] 200 [OP_ADD] 200 [OP_SUB] 100 [OP_SUB] 3 [OP_DIV]
var_a = 1 var_b = 1000 var_c = var_a * var_b var_d = 200 var_e = var_c + var_d var_f = 200 var_g = var_e - var_f var_h = 100 var_i = var_g - var_h var_j = 3 var_k = var_i / var_j print(int(var_k))
Possibility
From the four types of marbles - red, blue, yellow, and green, find the number of cases in which you select 21 balls allowing overlaps but draw 3 or more balls from each color.
220
4 21 [OP_ADD] 4 3 [OP_MUL] [OP_SUB] 1 [OP_SUB] 21 4 3 [OP_MUL] [OP_SUB] [OP_COMB]
var_a = 4 var_b = 21 var_c = var_a + var_b var_d = 4 var_e = 3 var_f = var_d * var_e var_g = var_c - var_f var_h = 1 var_i = var_g - var_h var_j = 21 var_k = 4 var_l = 3 var_m = var_k * var_l var_n = var_j - var_m var_o = 1 var_i = int(var_i) var_n = int(var_n) for i, elem in enumerate(range(var_n)): var_o = var_o * (var_i-i) for i, elem in enumerate(range(var_n)): var_o = var_o / (i+1) print(int(var_o))
Comparison
When there are 4 numbers of 0.8, 1/2, 0.5, and 1/3, how many of them are less than or equal to 3?
4
[OP_LIST_SOL] 0.8 1/2 0.5 1/3 [OP_LIST_EOL] 3 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 0.8 var_b = 0.5 var_c = 0.5 var_d = 0.3333333333333333 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 3 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
An oil drum in the shape of a cuboid with a height of 5 meters (m) and 20 centimeters (cm) and two sides of the bottom each measuring 6 meters (m), 40 centimeters (cm), and 9 meters (m), is filled with oil. We're going to split it up into several barrels of oil into a oil drum with a volume of 1 cubic meter (m3). Find at least how many oil drums you need.
300
6 40 100 [OP_DIV] [OP_ADD] 9 [OP_MUL] 5 20 100 [OP_DIV] [OP_ADD] [OP_MUL] 1 [OP_DIV] 1 [OP_CEIL]
var_a = 6 var_b = 40 var_c = 100 var_d = var_b / var_c var_e = var_a + var_d var_f = 9 var_g = var_e * var_f var_h = 5 var_i = 20 var_j = 100 var_k = var_i / var_j var_l = var_h + var_k var_m = var_g * var_l var_n = 1 var_o = var_m / var_n var_p = 1 var_q=int(((var_o+9*10**(var_p-2))//(10**(var_p-1)))*10**(var_p-1)) print(int(var_q))
Comparison
Jungkook collects the number 6 minus 3, and Yoongi collects 4. Whose number is smaller?
Jungkook
[OP_LIST_SOL] Jungkook Yoongi [OP_LIST_EOL] [OP_LIST_SOL] 6 3 [OP_SUB] 4 [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Yoongi' list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = 6 var_d = 3 var_e = var_c - var_d var_f = 4 list_b= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_g = 1 list_c=list_b.copy() list_c.sort() var_h = list_c[var_g-1] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Arithmetic calculation
Yoojeong gave Eunji 8 of the marbles she had at first, and there are 24 left. How many marbles did Yoojeong have before giving them to Eunji?
32
24 8 [OP_ADD]
var_a = 24 var_b = 8 var_c = var_a + var_b print(int(var_c))
Geometry
I have a rectangular piece of cloth. If the length of this cloth is 150 centimeters (cm) and the area is 3 square meters (m2), how many centimeters (cm) is the width?
200
3 100 2 [OP_POW] [OP_MUL] 150 [OP_DIV]
var_a = 3 var_b = 100 var_c = 2 var_d = var_b ** var_c var_e = var_a * var_d var_f = 150 var_g = var_e / var_f print(int(var_g))
Arithmetic calculation
At Eunji's school, class (A) planted 35 trees, class (B) planted 6 more trees than class (A), and class (C) planted 3 less trees than class (A). What is the average number of trees planted by three classes (A), (B), and (C)?
36
35 35 6 [OP_ADD] [OP_ADD] 35 3 [OP_SUB] [OP_ADD] 3 [OP_DIV]
var_a = 35 var_b = 35 var_c = 6 var_d = var_b + var_c var_e = var_a + var_d var_f = 35 var_g = 3 var_h = var_f - var_g var_i = var_e + var_h var_j = 3 var_k = var_i / var_j print(int(var_k))
Correspondence
4 out of 40 dolls are defective. When you send the non-defective remainder out to four stores equally, how many should you send per store?
9
40 4 [OP_SUB] 4 [OP_DIV]
var_a = 40 var_b = 4 var_c = var_a - var_b var_d = 4 var_e = var_c / var_d print(int(var_e))
Geometry
Jinsu has 125 dice, each with an edge of 2 centimeters (cm). If these dice are stacked to form a cube, what is the volume of the cube?
1000
2 3 [OP_POW] 125 [OP_MUL]
var_a = 2 var_b = 3 var_c = var_a ** var_b var_d = 125 var_e = var_c * var_d print(int(var_e))
Correspondence
We have DCBA+ABCD=ABCD0, which is the addition of two four-digit numbers. If A, B, C, and D are different numbers, what is the sum of A through D?
18
[OP_LIST_SOL] DCBA+ABCD=ABCD0 A [OP_DIGIT_UNK_SOLVER] DCBA+ABCD=ABCD0 B [OP_DIGIT_UNK_SOLVER] DCBA+ABCD=ABCD0 C [OP_DIGIT_UNK_SOLVER] DCBA+ABCD=ABCD0 D [OP_DIGIT_UNK_SOLVER] [OP_LIST_EOL] [OP_LIST_SUM]
var_a = 'DCBA+ABCD=ABCD0' 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 = 'DCBA+ABCD=ABCD0' 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 = 'DCBA+ABCD=ABCD0' var_h = 'C' ans_dict = dict() var_g = var_g.replace('×','*') var_g = var_g.replace('x','*') var_g = var_g.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_g): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_g 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_g): 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_i = ans_dict[var_h] var_j = 'DCBA+ABCD=ABCD0' var_k = 'D' ans_dict = dict() var_j = var_j.replace('×','*') var_j = var_j.replace('x','*') var_j = var_j.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_j): if v in variable_candi: ans_dict[v] = 1 candi = list(itertools.product('0123456789', repeat=len(ans_dict))) for c in candi: temp = var_j 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_j): 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_l = ans_dict[var_k] list_a= [] if "/" in str(var_l): var_l = eval(str(var_l)) list_a.append(var_l) if "/" in str(var_i): var_i = eval(str(var_i)) list_a.append(var_i) if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) list_a.reverse() list_a = [float(i) for i in list_a] var_m = sum(list_a) print(int(var_m))
Correspondence
When you mistakenly add 30 which should have been multiplied to by number, you get 86. Find out how much it is if you calculate it correctly.
1680
86 30 [OP_SUB] 30 [OP_MUL]
var_a = 86 var_b = 30 var_c = var_a - var_b var_d = 30 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
How many two-digit numbers are there that are greater than 29 and less than 36?
6
29 1 [OP_ADD] 36 1 [OP_SUB] 1 [OP_LIST_ARANGE] [OP_LIST_LEN]
var_a = 29 var_b = 1 var_c = var_a + var_b var_d = 36 var_e = 1 var_f = var_d - var_e var_g = 1 list_a = [i for i in range(var_c, var_f + 1, var_g)] var_h = len(list_a) print(int(var_h))
Arithmetic calculation
The car ran through the school zone at 27 kilometers per hour (km) for 50 seconds. How many meters (m) did the car move?
375
27 1000 [OP_MUL] 60 2 [OP_POW] [OP_DIV] 50 [OP_MUL]
var_a = 27 var_b = 1000 var_c = var_a * var_b var_d = 60 var_e = 2 var_f = var_d ** var_e var_g = var_c / var_f var_h = 50 var_i = var_g * var_h print(int(var_i))
Correspondence
When Hyung-wook's father is 32 years old, Hyung-wook is 5 years old, and when Hyung-wook is 7 years old, Hyung-wook's elder brother is 10 years old. Find the sum of the ages of Hyung-wook and his father when Hyung-wook's elder brother is 12 years old.
45
12 7 10 [OP_SUB] [OP_ADD] 12 7 10 [OP_SUB] [OP_ADD] 32 5 [OP_SUB] [OP_ADD] [OP_ADD]
var_a = 12 var_b = 7 var_c = 10 var_d = var_b - var_c var_e = var_a + var_d var_f = 12 var_g = 7 var_h = 10 var_i = var_g - var_h var_j = var_f + var_i var_k = 32 var_l = 5 var_m = var_k - var_l var_n = var_j + var_m var_o = var_e + var_n print(int(var_o))
Geometry
The base of a pyramid with A sides is an octagon. What number fits in A?
8
8
var_a = 8 print(int(var_a))
Correspondence
How many packs of candies are there if you pack 98 of them in 7 packs?
14
98 7 [OP_DIV]
var_a = 98 var_b = 7 var_c = var_a / var_b print(int(var_c))
Possibility
What is the smallest number that can be formed by using natural numbers 2 and 4?
24
[OP_LIST_SOL] 2 4 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MIN]
var_a = 2 var_b = 4 list_a= [] if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_c = len(list_a) list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, 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 = 1 list_c=list_b.copy() list_c.sort() var_e = list_c[var_d-1] print(int(var_e))
Geometry
Donggeon drew a triangle with a base of 3 centimeters (cm) and a height of 6.02 centimeters (cm), and Jihye drew a triangle with a base of 3 centimeters (cm) and a height of 2 centimeters (cm). How many times the width of the triangle drawn by Donggeon is the width of the triangle drawn by Jihye?
3.01
3 6.02 [OP_MUL] 2 [OP_DIV] 3 2 [OP_MUL] 2 [OP_DIV] [OP_DIV]
var_a = 3 var_b = 6.02 var_c = var_a * var_b var_d = 2 var_e = var_c / var_d var_f = 3 var_g = 2 var_h = var_f * var_g var_i = 2 var_j = var_h / var_i var_k = var_e / var_j print('{:.2f}'.format(round(var_k+1e-10,2)))
Arithmetic calculation
1250 coins are scattered on the floor. If the number of coins with heads is 124 more than the number of coins with tails, find the number of coins with tails.
563
1250 124 [OP_SUB] 2 [OP_DIV]
var_a = 1250 var_b = 124 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
Misoo and Joohee are trying to deliver a total of 2 liters (L) and 100 milliliters (㎖) of milk. How many milliliters (ml) of milk must Misoo deliver if Misoo delivers 200 milliliters (ml) more milk than Joohee does?
1150
2 1000 [OP_MUL] 100 [OP_ADD] 200 [OP_ADD] 2 [OP_DIV]
var_a = 2 var_b = 1000 var_c = var_a * var_b var_d = 100 var_e = var_c + var_d var_f = 200 var_g = var_e + var_f var_h = 2 var_i = var_g / var_h print(int(var_i))
Arithmetic calculation
I am trying to make a number from 1 to 300. How many of the number cards from 0 to 9 must contain the number 3?
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))
Geometry
There are two types of letter paper. Letter A is a rectangle with a width of 6 centimeters (cm) and a length of 9 centimeters (cm) long, and letter paper B is a square shape with a width of 8 centimeters (cm) and a length of 8 centimeters (cm) long. If both letter papers are decorated with stickers of the same size around the perimeter, which one has more stickers?
B
[OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] 6 9 [OP_ADD] 8 8 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [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 = 6 var_d = 9 var_e = var_c + var_d var_f = 8 var_g = 8 var_h = var_f + var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Correspondence
I had to multiply a number by 7 but mistakenly divided it by 6 instead to get 12. What is the correctly calculated value?
504
12 6 [OP_MUL] 7 [OP_MUL]
var_a = 12 var_b = 6 var_c = var_a * var_b var_d = 7 var_e = var_c * var_d print(int(var_e))
Correspondence
You need to multiply a number by 5 and then add 14, but you mistakenly subtracted 5 and added 14, getting 39 as an answer. Find the sum of the correctly calculated and incorrectly calculated values.
203
39 14 [OP_SUB] 5 [OP_ADD] 5 [OP_MUL] 14 [OP_ADD] 39 [OP_ADD]
var_a = 39 var_b = 14 var_c = var_a - var_b var_d = 5 var_e = var_c + var_d var_f = 5 var_g = var_e * var_f var_h = 14 var_i = var_g + var_h var_j = 39 var_k = var_i + var_j print(int(var_k))
Arithmetic calculation
Suhwan drinks 0.2 liters (L) of milk three times a day. How many liters (L) of milk does Suhwan drink in a week?
4.2
0.2 3 [OP_MUL] 7 [OP_MUL]
var_a = 0.2 var_b = 3 var_c = var_a * var_b var_d = 7 var_e = var_c * var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Correspondence
A and B are two-digit numbers. A is 8 less than 23. The number that is 7 greater than B is 18. Find the value of A-B.
4
23 8 [OP_SUB] 18 7 [OP_SUB] [OP_SUB]
var_a = 23 var_b = 8 var_c = var_a - var_b var_d = 18 var_e = 7 var_f = var_d - var_e var_g = var_c - var_f print(int(var_g))
Geometry
If the radius of a circle is 4 centimeters (cm), what is the diameter of the circle in centimeters (cm)?
8
4 2 [OP_MUL]
var_a = 4 var_b = 2 var_c = var_a * var_b print(int(var_c))
Arithmetic calculation
There are 24 students in the 5th and 6th grades together. Of these, 50 cherries were distributed equally to the 5th graders only, leaving 2 cherries. If the number of 6th graders is half the number of 5th graders, how many cherries did the 5th graders get?
6
50 2 [OP_SUB] 24 2 1 [OP_ADD] [OP_FDIV] [OP_FDIV]
var_a = 50 var_b = 2 var_c = var_a - var_b var_d = 24 var_e = 2 var_f = 1 var_g = var_e + var_f var_h = var_d // var_g var_i = var_c // var_h print(int(var_i))
Comparison
There are 24 balloons. Of these, there are 6 more blue balloons than red balloons, red balloons are 1/4 of the total, and the rest are all yellow balloons. What color balloons will be the most?
blue
[OP_LIST_SOL] red blue yellow [OP_LIST_EOL] [OP_LIST_SOL] 24 1/4 [OP_MUL] 24 1/4 [OP_MUL] 6 [OP_ADD] 24 24 1/4 [OP_MUL] 6 [OP_ADD] [OP_SUB] 24 1/4 [OP_MUL] [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'red' var_b = 'blue' var_c = 'yellow' 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 = 24 var_e = 0.25 var_f = var_d * var_e var_g = 24 var_h = 0.25 var_i = var_g * var_h var_j = 6 var_k = var_i + var_j var_l = 24 var_m = 24 var_n = 0.25 var_o = var_m * var_n var_p = 6 var_q = var_o + var_p var_r = var_l - var_q var_s = 24 var_t = 0.25 var_u = var_s * var_t var_v = var_r - var_u list_b= [] if "/" in str(var_v): var_v = eval(str(var_v)) list_b.append(var_v) if "/" in str(var_k): var_k = eval(str(var_k)) list_b.append(var_k) if "/" in str(var_f): var_f = eval(str(var_f)) list_b.append(var_f) list_b.reverse() var_w = 1 list_c=list_b.copy() list_c.sort() var_x = list_c[-var_w] var_y = list_b.index(var_x)+1 var_z = list_a[var_y-1] print(var_z)
Comparison
The number of visitors to an exhibition was 350 on the first day, 427 on the second day, 384 on the third day, 402 on the fourth day, and 431 on the fifth day. How many days were there no more than than 400 visitors?
2
[OP_LIST_SOL] 350 427 384 402 431 [OP_LIST_EOL] 400 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 350 var_b = 427 var_c = 384 var_d = 402 var_e = 431 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 = 400 list_b = [] for i in list_a: if i <= var_f: list_b.append(i) var_g = len(list_b) print(int(var_g))
Geometry
A square is formed by placing several marbles of the same size without gaps so that each side is filled with 8 marbles. How many more marbles do you need to place marbles around this square to enclose it again?
36
8 4 [OP_MUL] 4 [OP_ADD]
var_a = 8 var_b = 4 var_c = var_a * var_b var_d = 4 var_e = var_c + var_d print(int(var_e))
Comparison
Which number is the 2nd smallest among 5, 8, and 4?
5
[OP_LIST_SOL] 5 8 4 [OP_LIST_EOL] 2 [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 = 2 list_b=list_a.copy() list_b.sort() var_e = list_b[var_d-1] print(int(var_e))
Correspondence
The average weight of 10 watermelons is 4.2 kg. If one of these watermelons is replaced by a watermelon weighing 5 kilograms (kg), the average weight of the watermelons becomes 4.4 kilograms (kg). How many kilograms (kg) is the watermelon that has been replaced?
3
5 4.4 4.2 [OP_SUB] 10 [OP_MUL] [OP_SUB]
var_a = 5 var_b = 4.4 var_c = 4.2 var_d = var_b - var_c var_e = 10 var_f = var_d * var_e var_g = var_a - var_f print(int(eval('{:.2f}'.format(round(var_g+1e-10,2)))))
Arithmetic calculation
A 15 liter (L) bowl contains 7 liters (L) and 200 milliliters (㎖) of water. At least how many times would it take to pour water into a 600-milliliter (mL) bowl to fill this bowl?
13
15 1000 [OP_MUL] 7 1000 [OP_MUL] 200 [OP_ADD] [OP_SUB] 600 [OP_DIV] 1 [OP_CEIL]
var_a = 15 var_b = 1000 var_c = var_a * var_b var_d = 7 var_e = 1000 var_f = var_d * var_e var_g = 200 var_h = var_f + var_g var_i = var_c - var_h var_j = 600 var_k = var_i / var_j var_l = 1 var_m=int(((var_k+9*10**(var_l-2))//(10**(var_l-1)))*10**(var_l-1)) print(int(var_m))
Possibility
When Jiyoung and Shinwoo play rock-paper-scissors twice, find the number of cases in which Shinwoo does not win both times. (However, a draw may also come out.)
36
3 3 [OP_ADD] 3 3 [OP_ADD] [OP_MUL]
var_a = 3 var_b = 3 var_c = var_a + var_b var_d = 3 var_e = 3 var_f = var_d + var_e var_g = var_c * var_f print(int(var_g))
Arithmetic calculation
Hyung-wook's classmates are standing in a line on the playground. If the distance between students is 25 meters (m) and the distance between the first and last students is 1500 meters (m), find the number of students in Hyung-wook's class.
61
1500 25 [OP_DIV] 1 [OP_ADD]
var_a = 1500 var_b = 25 var_c = var_a / var_b var_d = 1 var_e = var_c + var_d print(int(var_e))
Comparison
Seulgi has 23 red marbles. Miran has 34 blue marbles and Hohyun has 32 yellow marbles. Who has more marbles among Seulgi and Hohyun ?
Hohyun
[OP_LIST_SOL] Seulgi Hohyun [OP_LIST_EOL] [OP_LIST_SOL] 23 32 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Seulgi' var_b = 'Hohyun' 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 = 23 var_d = 32 list_b= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_b.append(var_c) list_b.reverse() var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] var_g = list_b.index(var_f)+1 var_h = list_a[var_g-1] print(var_h)
Arithmetic calculation
There are 156 dureums of gulbis. When there are 20 fish in one dureum, write a solution to find out how many gulbis there are in total and find out the answer.
3120
156 20 [OP_MUL]
var_a = 156 var_b = 20 var_c = var_a * var_b print(int(var_c))
Possibility
If there are 6 women's president candidates A, B, C, D, E, and F in an apartment complex, find the number of ways to select 3 women's president representatives.
20
[OP_LIST_SOL] A B C D E F [OP_LIST_EOL] [OP_LIST_LEN] 3 [OP_COMB]
var_a = 'A' var_b = 'B' var_c = 'C' var_d = 'D' var_e = 'E' var_f = 'F' list_a= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_g = len(list_a) var_h = 3 var_i = 1 var_g = int(var_g) var_h = int(var_h) for i, elem in enumerate(range(var_h)): var_i = var_i * (var_g-i) for i, elem in enumerate(range(var_h)): var_i = var_i / (i+1) print(int(var_i))
Possibility
How many 4-digit numbers are there where the sum of all digits is 34?
10
1000 10000 1 [OP_SUB] 1 [OP_LIST_ARANGE] [OP_LIST_NUM2SUM] 34 [OP_LIST_MORE_EQUAL] 34 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN]
var_a = 1000 var_b = 10000 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)] list_b=[] for i in list_a: var_f = 0 i = int(i) while i//10 > 0: var_f = var_f + i%10 i = i//10 var_f = var_f + i%10 list_b.append(var_f) var_g = 34 list_c = [] for i in list_b: if i >= var_g: list_c.append(i) var_h = 34 list_d = [] for i in list_c: if i <= var_h: list_d.append(i) var_i = len(list_d) print(int(var_i))
Possibility
We want to take 2 balls from a box containing a red ball, a blue ball, a black ball, a yellow ball and a white ball. How many balls can we draw if we allow duplicates?
15
[OP_LIST_SOL] red blue black yellow white [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_ADD] 1 [OP_SUB] 2 [OP_COMB]
var_a = 'red' var_b = 'blue' var_c = 'black' var_d = 'yellow' 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 = len(list_a) var_g = 2 var_h = var_f + var_g var_i = 1 var_j = var_h - var_i var_k = 2 var_l = 1 var_j = int(var_j) var_k = int(var_k) for i, elem in enumerate(range(var_k)): var_l = var_l * (var_j-i) for i, elem in enumerate(range(var_k)): var_l = var_l / (i+1) print(int(var_l))
Comparison
The average math test score of 5 students in the competition class was 81.6. After excluding the highest score, we averaged the scores and it was said to be 6 points lower than averaging the scores after excluding the lowest score. If the scores of the remaining students, excluding the highest and lowest score, are 88, 84, and 76, find the highest score.
92
81.6 5 [OP_MUL] 88 84 [OP_ADD] 76 [OP_ADD] [OP_SUB] 6 4 [OP_MUL] [OP_ADD] 2 [OP_DIV]
var_a = 81.6 var_b = 5 var_c = var_a * var_b var_d = 88 var_e = 84 var_f = var_d + var_e var_g = 76 var_h = var_f + var_g var_i = var_c - var_h var_j = 6 var_k = 4 var_l = var_j * var_k var_m = var_i + var_l var_n = 2 var_o = var_m / var_n print(int(var_o))
Possibility
Find the number of cases in which Shin-Young and Ji-An tied when Ji-An and Shin-Young play rock-paper-scissors. (However, a draw may also occur.)
3
3
var_a = 3 print(int(var_a))
Arithmetic calculation
You can make one square out of 5 centimeters (cm) of wire. How many equally sized squares can you make with 48.5 centimeters (cm) of wire?
9
48.5 5 [OP_FDIV]
var_a = 48.5 var_b = 5 var_c = var_a // var_b print(int(var_c))
Correspondence
153 is the result of accidentally multiplying a certain number by 9 while it had to be multiplied by 6. Find the result when you calculate correctly.
102
153 9 [OP_DIV] 6 [OP_MUL]
var_a = 153 var_b = 9 var_c = var_a / var_b var_d = 6 var_e = var_c * var_d print(int(var_e))
Geometry
The width of the rectangular-shaped park is 9 kilometers (km). If you walk around the edge of the park, you walk 46 kilometers (km). How many kilometers (km) is the length of the park?
14
46 2 [OP_DIV] 9 [OP_SUB]
var_a = 46 var_b = 2 var_c = var_a / var_b var_d = 9 var_e = var_c - var_d print(int(var_e))
Geometry
What is the area of a rectangle measuring 47.3 centimeters (cm) long and 24 centimeters (cm) wide?
1135.2
47.3 24 [OP_MUL]
var_a = 47.3 var_b = 24 var_c = var_a * var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Correspondence
Subtracting 5 from a number equals 35. Find the value of that number divided by 5.
8
35 5 [OP_ADD] 5 [OP_DIV]
var_a = 35 var_b = 5 var_c = var_a + var_b var_d = 5 var_e = var_c / var_d print(int(var_e))
Comparison
Jungkook drank 1.3 liters (l) of milk. Seokjin drank 11/10 liters (l), and Yoongi drank 7/5 liters (l). Who drank the least milk?
Seokjin
[OP_LIST_SOL] Jungkook Seokjin Yoongi [OP_LIST_EOL] [OP_LIST_SOL] 1.3 11 10 [OP_DIV] 7 5 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Jungkook' var_b = 'Seokjin' var_c = 'Yoongi' 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.3 var_e = 11 var_f = 10 var_g = var_e / var_f var_h = 7 var_i = 5 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) if "/" in str(var_d): var_d = eval(str(var_d)) list_b.append(var_d) 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)
Comparison
Both Hyomin and Jinseop solved the same math problem book. Hyomin completely solved 4/15, and Jinsub completely solved 6/15. Who has solved more math problems?
Jinseop
[OP_LIST_SOL] Hyomin Jinseop [OP_LIST_EOL] [OP_LIST_SOL] 4 15 [OP_DIV] 6 15 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Hyomin' var_b = 'Jinseop' 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 = 15 var_e = var_c / var_d var_f = 6 var_g = 15 var_h = var_f / var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_i = 1 list_c=list_b.copy() list_c.sort() var_j = list_c[-var_i] var_k = list_b.index(var_j)+1 var_l = list_a[var_k-1] print(var_l)
Correspondence
Beong-gun added 156 to the result of dividing a certain number by 11, and he got 178 as the correct answer. Find the number.
242
178 156 [OP_SUB] 11 [OP_MUL]
var_a = 178 var_b = 156 var_c = var_a - var_b var_d = 11 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
There are 120 go stones. If there are 36 more white go stones than black go stones, how many white go stones are there?
78
120 36 [OP_SUB] 2 [OP_DIV] 36 [OP_ADD]
var_a = 120 var_b = 36 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d var_f = 36 var_g = var_e + var_f print(int(var_g))
Comparison
The 25 stickers are going to be shared by Junghyeon and Yejin. Find how many stickers Junghyeon will have when Junghyeon wants to have 1 more sticker than twice Ye-jin's.
17
25 1 [OP_SUB] 2 1 [OP_ADD] [OP_DIV] 2 [OP_MUL] 1 [OP_ADD]
var_a = 25 var_b = 1 var_c = var_a - var_b var_d = 2 var_e = 1 var_f = var_d + var_e var_g = var_c / var_f var_h = 2 var_i = var_g * var_h var_j = 1 var_k = var_i + var_j print(int(var_k))
Geometry
You have a box in the shape of a square prism with a height of 8 centimeters (cm), and the sum of the lengths of all edges is 104 centimeters (cm). On all sides of this box, you are going to attach pieces of colored paper in a square shape with a side length of 4 centimeters (cm) without overlapping. How many sheets of colored paper do you need in all?
18
104 8 4 [OP_MUL] [OP_SUB] 4 2 [OP_MUL] [OP_DIV] 8 [OP_MUL] 4 [OP_MUL] 4 2 [OP_POW] [OP_DIV]
var_a = 104 var_b = 8 var_c = 4 var_d = var_b * var_c var_e = var_a - var_d var_f = 4 var_g = 2 var_h = var_f * var_g var_i = var_e / var_h var_j = 8 var_k = var_i * var_j var_l = 4 var_m = var_k * var_l var_n = 4 var_o = 2 var_p = var_n ** var_o var_q = var_m / var_p print(int(var_q))
Arithmetic calculation
What is the sum of the three-digit natural numbers?
494550
100 999 1 [OP_LIST_ARANGE] [OP_LIST_SUM]
var_a = 100 var_b = 999 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] list_a = [float(i) for i in list_a] var_d = sum(list_a) print(int(var_d))
Arithmetic calculation
The train covered 704 kilometers (km) in 9/45 minutes. If the speed of this train is constant, find how many kilometers (km) it traveled in 12/10 minutes.
4224
704 9/45 [OP_DIV] 12/10 [OP_MUL]
var_a = 704 var_b = 0.2 var_c = var_a / var_b var_d = 1.2 var_e = var_c * var_d print(int(var_e))
Arithmetic calculation
The new paint can was weighed 24 kilograms (kg). After using half the paint, I reweighed the can and it weighed 14 kilograms (kg). What is the weight in kilograms (kg) of the paint in the new can, excluding the weight of the can?\
20
24 14 [OP_SUB] 2 [OP_MUL]
var_a = 24 var_b = 14 var_c = var_a - var_b var_d = 2 var_e = var_c * var_d print(int(var_e))
Comparison
Yuna and six of her friends are standing in a line. If there are 2 people standing in front of Yuna, how many people are standing behind Yuna?
4
6 1 [OP_ADD] 2 [OP_SUB] 1 [OP_SUB]
var_a = 6 var_b = 1 var_c = var_a + var_b var_d = 2 var_e = var_c - var_d var_f = 1 var_g = var_e - var_f print(int(var_g))
Comparison
There are 4 numbers A, B, C, D and A is 27. A is 7 less than B. B is 9 greater than C. If D is twice C, what is the largest number?
D
[OP_LIST_SOL] A B C D [OP_LIST_EOL] [OP_LIST_SOL] 27 27 7 [OP_ADD] 27 7 [OP_ADD] 9 [OP_SUB] 27 7 [OP_ADD] 9 [OP_SUB] 2 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'A' var_b = 'B' var_c = 'C' var_d = 'D' list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 27 var_f = 27 var_g = 7 var_h = var_f + var_g var_i = 27 var_j = 7 var_k = var_i + var_j var_l = 9 var_m = var_k - var_l var_n = 27 var_o = 7 var_p = var_n + var_o var_q = 9 var_r = var_p - var_q var_s = 2 var_t = var_r * var_s list_b= [] if "/" in str(var_t): var_t = eval(str(var_t)) list_b.append(var_t) if "/" in str(var_m): var_m = eval(str(var_m)) list_b.append(var_m) if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) list_b.reverse() var_u = 1 list_c=list_b.copy() list_c.sort() var_v = list_c[-var_u] var_w = list_b.index(var_v)+1 var_x = list_a[var_w-1] print(var_x)
Geometry
If the sum of the lengths of all the sides of an equilateral triangle is 18 centimeters (cm), find the length of one side of the equilateral triangle in centimeters (cm).
6
18 3 [OP_DIV]
var_a = 18 var_b = 3 var_c = var_a / var_b print(int(var_c))
Arithmetic calculation
Today's date is December 27, 2021, and the current time is 12:42. How many times do you have to press the number 2 key to enter today's date and time?
6
[OP_LIST_SOL] 2 0 2 1 1 2 2 7 1 2 4 2 [OP_LIST_EOL] 2 [OP_LIST_FIND_NUM]
var_a = 2 var_b = 0 var_c = 2 var_d = 1 var_e = 1 var_f = 2 var_g = 2 var_h = 7 var_i = 1 var_j = 2 var_k = 4 var_l = 2 list_a= [] if "/" in str(var_l): var_l = eval(str(var_l)) list_a.append(var_l) if "/" in str(var_k): var_k = eval(str(var_k)) list_a.append(var_k) if "/" in str(var_j): var_j = eval(str(var_j)) list_a.append(var_j) if "/" in str(var_i): var_i = eval(str(var_i)) list_a.append(var_i) if "/" in str(var_h): var_h = eval(str(var_h)) list_a.append(var_h) if "/" in str(var_g): var_g = eval(str(var_g)) list_a.append(var_g) if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_m = 2 var_n = 0 var_m = int(var_m) for i in list_a: i = int(i) if i == var_m: var_n = var_n + 1 print(int(var_n))
Comparison
In 0.8, 1/2, 0.3 to less than or equal to 0.4 which is the largest or the same number?
0.3
[OP_LIST_SOL] 0.8 1/2 0.3 [OP_LIST_EOL] 0.4 [OP_LIST_LESS_EQUAL] 1 [OP_LIST_MAX]
var_a = 0.8 var_b = 0.5 var_c = 0.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 = 0.4 list_b = [] for i in list_a: if i <= var_d: list_b.append(i) var_e = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] print('{:.2f}'.format(round(var_f+1e-10,2)))
Correspondence
If we multiply 4 by a number and subtract 23 again, what is a number if we get 33?
14
33 23 [OP_ADD] 4 [OP_DIV]
var_a = 33 var_b = 23 var_c = var_a + var_b var_d = 4 var_e = var_c / var_d print(int(var_e))
Arithmetic calculation
The milk that Suyeong's family drank today is 0.4 of the total amount. If the remaining milk is 0.69 liters (L), how many liters (L) of milk were there at the beginning?
1.15
0.69 1 0.4 [OP_SUB] [OP_DIV]
var_a = 0.69 var_b = 1 var_c = 0.4 var_d = var_b - var_c var_e = var_a / var_d print('{:.2f}'.format(round(var_e+1e-10,2)))
Arithmetic calculation
A dumpling factory makes 182.88 kilograms (kg) of dumplings per month. Find how many kilograms (kg) of dumplings are made in this factory in one year.
2194.56
182.88 12 [OP_MUL]
var_a = 182.88 var_b = 12 var_c = var_a * var_b print('{:.2f}'.format(round(var_c+1e-10,2)))
Possibility
Kahi bought 4 erasers with numbers on them from a stationery shop. Each eraser had 0, 2, 4, and 6 written on it. If she chooses three of them and makes numbers that are greater than 100 and less than 1000, what is the sum of the total numbers that she can make?
7728
[OP_LIST_SOL] 0 2 4 6 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] [OP_LIST_SUM]
var_a = 0 var_b = 2 var_c = 4 var_d = 6 list_a= [] if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_e = 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] list_b = [float(i) for i in list_b] var_f = sum(list_b) print(int(var_f))
Correspondence
31+6A2=683 is true. What is A?
5
31+6A2=683 A [OP_DIGIT_UNK_SOLVER]
var_a = '31+6A2=683' 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
The number of questions that Min-joo and Sang-hyeon got right in the quiz was 43, and Min-joo got 5 more questions than Sang-hyeon. How many quiz questions did Sanghyun get right?
19
43 5 [OP_SUB] 2 [OP_DIV]
var_a = 43 var_b = 5 var_c = var_a - var_b var_d = 2 var_e = var_c / var_d print(int(var_e))
Possibility
You want to create a four-digit number by drawing four out of 1, 7, 0, 3, 5, and 6 and using them only once. Find the difference between the second smallest number and the first smallest number that can be made.
1
[OP_LIST_SOL] 1 7 0 3 5 6 [OP_LIST_EOL] 4 [OP_LIST_GET_PERM] 2 [OP_LIST_MIN] 1 [OP_LIST_MIN] [OP_SUB] [OP_ABS]
var_a = 1 var_b = 7 var_c = 0 var_d = 3 var_e = 5 var_f = 6 list_a= [] if "/" in str(var_f): var_f = eval(str(var_f)) list_a.append(var_f) if "/" in str(var_e): var_e = eval(str(var_e)) list_a.append(var_e) if "/" in str(var_d): var_d = eval(str(var_d)) list_a.append(var_d) if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_g = 4 list_b = [str(i) for i in list_a] list_b = list(itertools.permutations(list_b, var_g)) list_b = [''.join(num_list) for num_list in list_b] list_b = [str_num for str_num in list_b if str_num[0] != '0'] list_b = [float(i) for i in list_b] var_h = 2 list_c=list_b.copy() list_c.sort() var_i = list_c[var_h-1] var_j = 1 list_d=list_b.copy() list_d.sort() var_k = list_d[var_j-1] var_l = var_i - var_k var_m = abs(var_l) print(int(var_m))
Possibility
Three students and two teachers are standing in line. Find the number of cases if students must go next to each other.
36
2 1 [OP_ADD] 2 1 [OP_ADD] [OP_PERM] 3 3 [OP_PERM] [OP_MUL]
var_a = 2 var_b = 1 var_c = var_a + var_b var_d = 2 var_e = 1 var_f = var_d + var_e var_g = 1 var_c = int(var_c) var_f = int(var_f) for i, elem in enumerate(range(var_f)): var_g = var_g * (var_c-i) var_h = 3 var_i = 3 var_j = 1 var_h = int(var_h) var_i = int(var_i) for i, elem in enumerate(range(var_i)): var_j = var_j * (var_h-i) var_k = var_g * var_j print(int(var_k))
Possibility
Find the number of two-digit natural numbers that can be made by drawing two of the number cards 0, 1, 7, and 9.
9
[OP_LIST_SOL] 0 1 7 9 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN]
var_a = 0 var_b = 1 var_c = 7 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 = 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 = len(list_b) print(int(var_f))
Correspondence
A number is greater than 24 but less than 28. Find out which number it is among 20, 23, 26, and 29.
26
[OP_LIST_SOL] 20 23 26 29 [OP_LIST_EOL] 24 [OP_LIST_MORE] 28 [OP_LIST_LESS] 1 [OP_LIST_GET]
var_a = 20 var_b = 23 var_c = 26 var_d = 29 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 = 24 list_b = [] for i in list_a: if i > var_e: list_b.append(i) var_f = 28 list_c = [] for i in list_b: if i < var_f: list_c.append(i) var_g = 1 var_h = list_c[var_g-1] print(int(var_h))
Comparison
Yoongi collected 4 points, Yuna collected 5 points, and Jungkook collected 6 minus 3 points. Who has the smallest number?
Jungkook
[OP_LIST_SOL] Yoongi Yuna Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 4 5 6 3 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET]
var_a = 'Yoongi' var_b = 'Yuna' var_c = 'Jungkook' 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 = 5 var_f = 6 var_g = 3 var_h = var_f - var_g list_b= [] if "/" in str(var_h): var_h = eval(str(var_h)) list_b.append(var_h) if "/" in str(var_e): var_e = eval(str(var_e)) list_b.append(var_e) 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)
Comparison
Yoongi collected 4 points, and Jungkook collected 6 multiplied by 3 points. Whose number is smaller?
Yoongi
[OP_LIST_SOL] Yoongi Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_MUL] [OP_LIST_EOL] 1 [OP_LIST_MIN] [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-1] var_i = list_b.index(var_h)+1 var_j = list_a[var_i-1] print(var_j)
Correspondence
When a number is divided by 5 and 6, it is divisible, and when divided by 7, the remainder is 6. Find the smallest two-digit number in any number.
90
10 99 1 [OP_LIST_ARANGE] 5 6 [OP_LCM] [OP_LIST_DIVISIBLE] 7 6 [OP_LIST_DIVIDE_AND_REMAIN] 1 [OP_LIST_MIN]
var_a = 10 var_b = 99 var_c = 1 list_a = [i for i in range(var_a, var_b + 1, var_c)] var_d = 5 var_e = 6 var_f = var_e * var_d / math.gcd(int(var_e), int(var_d)) 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 = 7 var_h = 6 list_c = [] var_g = int(var_g) var_h = int(var_h) if var_h < 0: var_h = var_h + var_g for i in list_b: i = int(i) if i%var_g == var_h: list_c.append(i) var_i = 1 list_d=list_c.copy() list_d.sort() var_j = list_d[var_i-1] print(int(var_j))
Comparison
Rabbits and ducks are playing in the garden. If the sum of the legs of all animals is 48 and there are 9 rabbits, how many ducks are there?
6
48 4 9 [OP_MUL] [OP_SUB] 2 [OP_DIV]
var_a = 48 var_b = 4 var_c = 9 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))
Correspondence
A is a single digit number. If A567 is rounded down in the tens place to get 2560, What is A?
2
A567 [OP_GEN_POSSIBLE_LIST] 2560 [OP_LIST_MORE_EQUAL] 2560 10 [OP_ADD] [OP_LIST_LESS] A567 A [OP_LIST_FIND_UNK]
var_a = 'A567' 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 = 2560 list_b = [] for i in list_a: if i >= var_b: list_b.append(i) var_c = 2560 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 = 'A567' 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
How many divisors of 24 are there?
8
24 [OP_LIST_GET_DIVISOR] [OP_LIST_LEN]
var_a = 24 list_a = [] num_sqrt = int(math.sqrt(var_a)) for i in range(1, num_sqrt+1): if var_a % i == 0: list_a.append(i) list_a.append(int(var_a/i)) list_a = sorted(set(list_a)) var_b = len(list_a) print(int(var_b))
Possibility
We want to create the largest number by using a given number once. Given the numbers 1, 4, and 5, what number should we make?
541
[OP_LIST_SOL] 1 4 5 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 1 [OP_LIST_MAX]
var_a = 1 var_b = 4 var_c = 5 list_a= [] if "/" in str(var_c): var_c = eval(str(var_c)) list_a.append(var_c) if "/" in str(var_b): var_b = eval(str(var_b)) list_a.append(var_b) if "/" in str(var_a): var_a = eval(str(var_a)) list_a.append(var_a) list_a.reverse() var_d = 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 = 1 list_c=list_b.copy() list_c.sort() var_f = list_c[-var_e] print(int(var_f))