category
stringclasses 5
values | question
stringlengths 20
555
| answer
stringlengths 1
20
| solution_abst
stringlengths 1
287
| solution_code
stringlengths 27
5.97k
|
---|---|---|---|---|
Arithmetic calculation | There are 10 tangerines in the basket. Minyoung put 6 more tangerines in the basket. Find the number of tangerines. | 16 | 10 6 [OP_ADD] | var_a = 10
var_b = 6
var_c = var_a + var_b
print(int(var_c)) |
Arithmetic calculation | Taewon tries to solve 220 problems in the workbook for a week. How many problems does Taewon have to solve in 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)) |
Comparison | The lowest temperatures in Seoul during the week were 18 degrees, 20 degrees, 15 degrees, 19 degrees, 14 degrees, 13 degrees, and 17 degrees. How many days did the temperature drop below 17 degrees in one week? | 4 | [OP_LIST_SOL] 18 20 15 19 14 13 17 [OP_LIST_EOL] 17 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN] | var_a = 18
var_b = 20
var_c = 15
var_d = 19
var_e = 14
var_f = 13
var_g = 17
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 = 17
list_b = []
for i in list_a:
if i <= var_h:
list_b.append(i)
var_i = len(list_b)
print(int(var_i)) |
Arithmetic calculation | A barrel full of fish of the same size and weight was weighed and found to be 54 kilograms (kg). After removing half of the fish from the barrel, it turned out to be 29 kilograms (kg). How many kilograms (kg) was the fish in the first place? | 50 | 54 29 [OP_SUB] 2 [OP_MUL] | var_a = 54
var_b = 29
var_c = var_a - var_b
var_d = 2
var_e = var_c * var_d
print(int(var_e)) |
Geometry | 16 pieces of colored tape, each 10.4 centimeters (cm) long, were overlapped by 3.5 centimeters (cm) and connected in a circle shape. What is the total length in centimeters (cm) of the circle-shaped colored tapes that were connected together? | 110.4 | 10.4 16 [OP_MUL] 3.5 16 [OP_MUL] [OP_SUB] | var_a = 10.4
var_b = 16
var_c = var_a * var_b
var_d = 3.5
var_e = 16
var_f = var_d * var_e
var_g = var_c - var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Possibility | When number cards 2 and 4 are given, find the smallest number that can be made by using all number cards once. | 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)) |
Comparison | Seokjin has 78 candies, and Taehyung has 81 candies. Who has more candies? | Taehyung | [OP_LIST_SOL] Seokjin Taehyung [OP_LIST_EOL] [OP_LIST_SOL] 78 81 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Seokjin'
var_b = 'Taehyung'
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 = 78
var_d = 81
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 | Hose A takes 10 hours to fill the bathtub, and Hose B takes 15 hours to fill the bathtub. Determine how many hours it will take to fill the bathtub if both hoses are used. | 6 | 1 1 10 [OP_DIV] 1 15 [OP_DIV] [OP_ADD] [OP_DIV] | var_a = 1
var_b = 1
var_c = 10
var_d = var_b / var_c
var_e = 1
var_f = 15
var_g = var_e / var_f
var_h = var_d + var_g
var_i = var_a / var_h
print(int(eval('{:.2f}'.format(round(var_i+1e-10,2))))) |
Arithmetic calculation | Daejun was presented with 20 bags containing 156 marbles. How many marbles does Daejun have? | 3120 | 156 20 [OP_MUL] | var_a = 156
var_b = 20
var_c = var_a * var_b
print(int(var_c)) |
Possibility | Yoongi can choose 3 out of 10 classes for after-school classes. How many ways can Yoongi take classes? | 120 | 10 3 [OP_COMB] | var_a = 10
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)
for i, elem in enumerate(range(var_b)):
var_c = var_c / (i+1)
print(int(var_c)) |
Correspondence | There is a product that is packaged in 7 pieces. Hyeonsu has 12 bundles and 5 individual pieces of this product. If this product is repackaged in units of 8, how many bundles can be made? | 11 | 12 7 [OP_MUL] 5 [OP_ADD] 8 [OP_FDIV] | var_a = 12
var_b = 7
var_c = var_a * var_b
var_d = 5
var_e = var_c + var_d
var_f = 8
var_g = var_e // var_f
print(int(var_g)) |
Arithmetic calculation | My father is 34 years old and my mother is 30 years old. What is the age of my father in the year when the sum of the ages of my father and mother becomes 100? | 52 | 34 100 34 30 [OP_ADD] [OP_SUB] 2 [OP_DIV] [OP_ADD] | var_a = 34
var_b = 100
var_c = 34
var_d = 30
var_e = var_c + var_d
var_f = var_b - var_e
var_g = 2
var_h = var_f / var_g
var_i = var_a + var_h
print(int(var_i)) |
Arithmetic calculation | Hyeji decided to drink 2 liters (L) of water a day. If she drank 460 milliliters (ml) more by eating spicy food after drinking all the water she needs to drink today, how many milliliters (ml) of water Hyeji drank today? | 2460 | 2 1000 [OP_MUL] 460 [OP_ADD] | var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 460
var_e = var_c + var_d
print(int(var_e)) |
Geometry | I made the widest square out of wire, and its size is 324 square centimeters (cm2). Find the length of the wire. | 72 | 324 1/2 [OP_POW] 4 [OP_MUL] | var_a = 324
var_b = 0.5
var_c = var_a ** var_b
var_d = 4
var_e = var_c * var_d
print(int(var_e)) |
Arithmetic calculation | How many five-digit numbers are divisible by the two numbers 3 and 4? | 7500 | 10000 99999 1 [OP_LIST_ARANGE] 3 [OP_LIST_DIVISIBLE] 4 [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 = 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 = 4
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 = len(list_c)
print(int(var_f)) |
Arithmetic calculation | Hyeonjun takes a bus for 2 kilometers (km) and walks 560 meters (m) to go to school from home. How many meters (m) does Hyunjun travel to go to school? | 2560 | 2 1000 [OP_MUL] 560 [OP_ADD] | var_a = 2
var_b = 1000
var_c = var_a * var_b
var_d = 560
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | Yesterday Seok-jin bought 10 fish and paid 3,000 won. He paid 6,000 won more than yesterday because he bought more fish from the same store. Find the total number of fish that Seok-jin bought yesterday and today. | 40 | 3000 6000 [OP_ADD] 3000 10 [OP_DIV] [OP_DIV] 10 [OP_ADD] | var_a = 3000
var_b = 6000
var_c = var_a + var_b
var_d = 3000
var_e = 10
var_f = var_d / var_e
var_g = var_c / var_f
var_h = 10
var_i = var_g + var_h
print(int(var_i)) |
Correspondence | 695 minus 329 equals a number minus 254. Find the number. | 620 | 695 329 [OP_SUB] 254 [OP_ADD] | var_a = 695
var_b = 329
var_c = var_a - var_b
var_d = 254
var_e = var_c + var_d
print(int(var_e)) |
Arithmetic calculation | At the bank, 1 yuan in Chinese money is exchanged for 17.25 yen in Japanese money. Saeyoung has one 1000 yuan bill and one 10 yuan coin. How much is Seyoung's Chinese money in Japanese money? | 17422.5 | 17.25 1000 [OP_MUL] 17.25 10 [OP_MUL] [OP_ADD] | var_a = 17.25
var_b = 1000
var_c = var_a * var_b
var_d = 17.25
var_e = 10
var_f = var_d * var_e
var_g = var_c + var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Arithmetic calculation | There are 200 grams (g) of 5% sugar water. If water evaporated from this sugar water to make it 8% sugar water, find how many grams (g) of water has evaporated. | 75 | 200 200 5 100 [OP_DIV] [OP_MUL] 100 8 [OP_DIV] [OP_MUL] [OP_SUB] | var_a = 200
var_b = 200
var_c = 5
var_d = 100
var_e = var_c / var_d
var_f = var_b * var_e
var_g = 100
var_h = 8
var_i = var_g / var_h
var_j = var_f * var_i
var_k = var_a - var_j
print(int(var_k)) |
Correspondence | What number must go in A to make A78-2B4=364? | 5 | A78-2B4=364 A [OP_DIGIT_UNK_SOLVER] | var_a = 'A78-2B4=364'
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 | 1.2 kg (kg) of glutinous rice flour is needed to make 3.8 kg (kg) of chapsalttock. The total weight of chapsalttocks made in the store is 53.2 kg (kg), and the amount of glutinous rice flour in a box is 3 kg (kg). How many boxes of glutinous rice flour do they need to make all the chapsalttocks in the store? | 6 | 1.2 3.8 [OP_DIV] 53.2 [OP_MUL] 3 [OP_DIV] 1 [OP_CEIL] | var_a = 1.2
var_b = 3.8
var_c = var_a / var_b
var_d = 53.2
var_e = var_c * var_d
var_f = 3
var_g = var_e / var_f
var_h = 1
var_i=int(((var_g+9*10**(var_h-2))//(10**(var_h-1)))*10**(var_h-1))
print(int(var_i)) |
Geometry | If the largest rhombus is drawn inside a circle with a radius of 10 centimeters (cm), how long centimeters (cm) is the diagonal of the rhombus? | 20 | 2 10 [OP_MUL] | var_a = 2
var_b = 10
var_c = var_a * var_b
print(int(var_c)) |
Arithmetic calculation | I paid 1,000 won after buying a glue for 270 won and pencils for 210 won and received 100 won as change. How many pencils did I buy? | 3 | 1000 100 [OP_SUB] 270 1 [OP_MUL] [OP_SUB] 210 [OP_DIV] | var_a = 1000
var_b = 100
var_c = var_a - var_b
var_d = 270
var_e = 1
var_f = var_d * var_e
var_g = var_c - var_f
var_h = 210
var_i = var_g / var_h
print(int(var_i)) |
Correspondence | Sumin's candies are in two flavors, strawberry and grape. If there are 821 candies and 267 strawberry candies, find the difference between the number of grape and strawberry candies. | 287 | 821 267 [OP_SUB] 267 [OP_SUB] | var_a = 821
var_b = 267
var_c = var_a - var_b
var_d = 267
var_e = var_c - var_d
print(int(var_e)) |
Geometry | I have square notebooks. When these notebooks were laid out in a big square shape without gaps, a total of 36 notebooks were left over. I then increased one horizontal and one vertical side by one column, and there were still three notebooks left over. How many notebooks did I have? | 397 | 36 3 [OP_ADD] 1 [OP_ADD] 2 [OP_DIV] 2 [OP_POW] 3 [OP_SUB] | var_a = 36
var_b = 3
var_c = var_a + var_b
var_d = 1
var_e = var_c + var_d
var_f = 2
var_g = var_e / var_f
var_h = 2
var_i = var_g ** var_h
var_j = 3
var_k = var_i - var_j
print(int(var_k)) |
Possibility | Find the number of numbers less than 500 when choosing 3 out of 4 number cards 8, 4, 6, 9 to make a three-digit number. | 6 | [OP_LIST_SOL] 8 4 6 9 [OP_LIST_EOL] 3 [OP_LIST_GET_PERM] 500 [OP_LIST_LESS] [OP_LIST_LEN] | var_a = 8
var_b = 4
var_c = 6
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 = 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 = 500
list_c = []
for i in list_b:
if i < var_f:
list_c.append(i)
var_g = len(list_c)
print(int(var_g)) |
Geometry | There is a square with a perimeter of 52 centimeters (cm), and a rectangle with a length of 15 centimeters (cm) and a perimeter of 52 centimeters (cm). What is the difference between the areas of the two shapes? | 4 | 52 4 [OP_DIV] 2 [OP_POW] 52 2 [OP_DIV] 15 [OP_SUB] 15 [OP_MUL] [OP_SUB] [OP_ABS] | var_a = 52
var_b = 4
var_c = var_a / var_b
var_d = 2
var_e = var_c ** var_d
var_f = 52
var_g = 2
var_h = var_f / var_g
var_i = 15
var_j = var_h - var_i
var_k = 15
var_l = var_j * var_k
var_m = var_e - var_l
var_n = abs(var_m)
print(int(var_n)) |
Possibility | How many numbers among the two-digit numbers consisting of 0, 1, 3, 5, 7, and 9 change when each digit is rearranged? | 25 | [OP_LIST_SOL] 0 1 3 5 7 9 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] [OP_LIST_LEN] | var_a = 0
var_b = 1
var_c = 3
var_d = 5
var_e = 7
var_f = 9
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 = 2
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 = len(list_b)
print(int(var_h)) |
Arithmetic calculation | If there are 12 cars in the parking lot, but no additional cars have entered, and there are currently 9 cars remaining, how many cars have left the parking lot? | 3 | 12 9 [OP_SUB] | var_a = 12
var_b = 9
var_c = var_a - var_b
print(int(var_c)) |
Correspondence | Find the smallest natural number B that satisfies the equation 360÷(A×A×A/B)=5. | 3 | 360÷(A×A×A/B)=5 B [OP_NUM_UNK_SOLVER] 1 [OP_LIST_MIN] | var_a = '360÷(A×A×A/B)=5'
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] = []
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].append(int(c[i]))
list_a = list(set(ans_dict[var_b]))
var_c = 1
list_b=list_a.copy()
list_b.sort()
var_d = list_b[var_c-1]
print(int(var_d)) |
Correspondence | Dividing 90.1 by a number gets you 5.3. What number is it? | 17 | 1 5.3 90.1 [OP_DIV] [OP_DIV] | var_a = 1
var_b = 5.3
var_c = 90.1
var_d = var_b / var_c
var_e = var_a / var_d
print(int(var_e)) |
Comparison | Jimin did 30 laps in 3 hours and 30 minutes and Dongguk did 10 laps in 1 hour. Which of the two ran faster? | Dongguk | [OP_LIST_SOL] Jimin Dongguk [OP_LIST_EOL] [OP_LIST_SOL] 30 3 60 [OP_MUL] 30 [OP_ADD] [OP_DIV] 10 1 60 [OP_MUL] [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Jimin'
var_b = 'Dongguk'
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 = 30
var_d = 3
var_e = 60
var_f = var_d * var_e
var_g = 30
var_h = var_f + var_g
var_i = var_c / var_h
var_j = 10
var_k = 1
var_l = 60
var_m = var_k * var_l
var_n = var_j / var_m
list_b= []
if "/" in str(var_n):
var_n = eval(str(var_n))
list_b.append(var_n)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
list_b.reverse()
var_o = 1
list_c=list_b.copy()
list_c.sort()
var_p = list_c[-var_o]
var_q = list_b.index(var_p)+1
var_r = list_a[var_q-1]
print(var_r) |
Correspondence | Subtract 26 from any number and divide by 2 is 37. Find the value of dividing a number by 4 and subtracting it from 48. | 23 | 48 37 2 [OP_MUL] 26 [OP_ADD] 4 [OP_DIV] [OP_SUB] | var_a = 48
var_b = 37
var_c = 2
var_d = var_b * var_c
var_e = 26
var_f = var_d + var_e
var_g = 4
var_h = var_f / var_g
var_i = var_a - var_h
print(int(var_i)) |
Geometry | A figure with one side of 16 centimeters (cm) and all sides of the same length has a perimeter of 80 centimeters (cm). How many angles does this shape have? | 5 | 80 16 [OP_DIV] | var_a = 80
var_b = 16
var_c = var_a / var_b
print(int(var_c)) |
Correspondence | 24 minus AB equals 6. What is the value of A, where AB is two-digit number? | 3 | 6 24 [OP_ADD] 10 [OP_FDIV] | var_a = 6
var_b = 24
var_c = var_a + var_b
var_d = 10
var_e = var_c // var_d
print(int(var_e)) |
Correspondence | AB19 rounded up to the hundreds place equals 7300. Round down AB19 to the tens place. | 7210 | AB19 [OP_GEN_POSSIBLE_LIST] 7200 [OP_LIST_MORE] 7300 [OP_LIST_LESS_EQUAL] AB19 A [OP_LIST_FIND_UNK] 1000 [OP_MUL] AB19 B [OP_LIST_FIND_UNK] 100 [OP_MUL] [OP_ADD] 19 [OP_ADD] 2 [OP_FLOOR] | var_a = 'AB19'
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 = 7200
list_b = []
for i in list_a:
if i > var_b:
list_b.append(i)
var_c = 7300
list_c = []
for i in list_b:
if i <= var_c:
list_c.append(i)
var_d = 'AB19'
var_e = 'A'
var_d = str(var_d)
var_e = str(var_e)
unk_idx = var_d.index(var_e)
var_f = 0
for elem in list_c:
elem = str(elem)
var_f = int(elem[unk_idx])
var_g = 1000
var_h = var_f * var_g
var_i = 'AB19'
var_j = 'B'
var_i = str(var_i)
var_j = str(var_j)
unk_idx = var_i.index(var_j)
var_k = 0
for elem in list_c:
elem = str(elem)
var_k = int(elem[unk_idx])
var_l = 100
var_m = var_k * var_l
var_n = var_h + var_m
var_o = 19
var_p = var_n + var_o
var_q = 2
var_r=int((var_p//(10**(var_q-1)))*10**(var_q-1))
print(int(var_r)) |
Comparison | Minjeong has 6 marbles and Joohwan has 7. Minjeong has 1 more marble than Sunho, and Jinyoung has 3 fewer marbles than Joohwan. Who has the fewest marbles? | Jinyoung | [OP_LIST_SOL] Minjeong Joohwan Sunho Jinyoung [OP_LIST_EOL] [OP_LIST_SOL] 6 7 6 1 [OP_SUB] 7 3 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Minjeong'
var_b = 'Joohwan'
var_c = 'Sunho'
var_d = 'Jinyoung'
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 = 6
var_f = 7
var_g = 6
var_h = 1
var_i = var_g - var_h
var_j = 7
var_k = 3
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)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_m = 1
list_c=list_b.copy()
list_c.sort()
var_n = list_c[var_m-1]
var_o = list_b.index(var_n)+1
var_p = list_a[var_o-1]
print(var_p) |
Arithmetic calculation | Each box contains 100 persimmons. How many persimmons are there in all 6 boxes? | 600 | 100 6 [OP_MUL] | var_a = 100
var_b = 6
var_c = var_a * var_b
print(int(var_c)) |
Correspondence | It took 13/5 tins of paint to paint one wooden board. Another identical wooden plank is painted and the amount of paint remaining is 9/7 tins. Find how many cans of paint were in the beginning. | 6.49 | 9/7 13/5 [OP_ADD] 13/5 [OP_ADD] | var_a = 1.2857142857142858
var_b = 2.6
var_c = var_a + var_b
var_d = 2.6
var_e = var_c + var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Correspondence | Yoongi divided 11 by some number and got 2. Next, he wants to multiply some number by 6. What is the value of this result? | 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)) |
Correspondence | In art class, Cheol-su and Young-hee brought clay, but Cheol-su's clay was heavier than Young-hee's. When Young-hee removed 7/5 grams (g) from her clay and stuck it to Cheol-su’s clay, Young-hee’s clay was 81/20 grams (g) lighter than Cheol-su’s clay. Find the difference in weight between the clay that Cheol-su and Young-hee brought at first. | 6.85 | 81/20 7/5 [OP_ADD] 7/5 [OP_ADD] | var_a = 4.05
var_b = 1.4
var_c = var_a + var_b
var_d = 1.4
var_e = var_c + var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Correspondence | You had to add a number to 36 but added 7 to the number by mistake and the result was 70. How much is it if you calculate it correctly? | 46 | 36 70 7 [OP_DIV] [OP_ADD] | var_a = 36
var_b = 70
var_c = 7
var_d = var_b / var_c
var_e = var_a + var_d
print(int(var_e)) |
Arithmetic calculation | There are 7 boxes with each box containing 9 bottles of milk. If you eat 7 of these bottles of milk and divide the remaining milk equally among 8 people, Find how many bottles of milk you should give per person. | 7 | 9 7 [OP_MUL] 7 [OP_SUB] 8 [OP_DIV] | var_a = 9
var_b = 7
var_c = var_a * var_b
var_d = 7
var_e = var_c - var_d
var_f = 8
var_g = var_e / var_f
print(int(var_g)) |
Correspondence | When 14A+B73=418, what number should be in A, where 14A and B73 are three-digit numbers? | 5 | 14A+B73=418 A [OP_DIGIT_UNK_SOLVER] | var_a = '14A+B73=418'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Comparison | Thirty people voted in the Class Representative Election. A got 12 votes, 3 votes for B, and C got 15 votes. The candidate with the most votes is said to be the class president. Write down who is the candidate who won the election. | C | [OP_LIST_SOL] A B C [OP_LIST_EOL] [OP_LIST_SOL] 12 3 15 [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'
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 = 3
var_f = 15
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)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
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) |
Comparison | There are three numbers A, B, and C. A is 7 greater than 32. B is a number of 3 groups of 10 and 3 units. C is 9 less than 50. Which number is the smallest? | B | [OP_LIST_SOL] A B C [OP_LIST_EOL] [OP_LIST_SOL] 32 7 [OP_ADD] 3 10 [OP_MUL] 3 [OP_ADD] 50 9 [OP_SUB] [OP_LIST_EOL] 1 [OP_LIST_MIN] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'A'
var_b = 'B'
var_c = 'C'
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 = 32
var_e = 7
var_f = var_d + var_e
var_g = 3
var_h = 10
var_i = var_g * var_h
var_j = 3
var_k = var_i + var_j
var_l = 50
var_m = 9
var_n = var_l - var_m
list_b= []
if "/" in str(var_n):
var_n = eval(str(var_n))
list_b.append(var_n)
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_o = 1
list_c=list_b.copy()
list_c.sort()
var_p = list_c[var_o-1]
var_q = list_b.index(var_p)+1
var_r = list_a[var_q-1]
print(var_r) |
Geometry | If all the angles of a figure with eight angles are in the same size and the perimeter of the figure is 23.6 centimeters (cm), how long is one side of the figure in centimeters (cm)? | 2.95 | 23.6 8 [OP_DIV] | var_a = 23.6
var_b = 8
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Arithmetic calculation | There were 38 people in the bus. If 9 more people stepped off at the stop than those who got on at the stop, how many people are on the bus now? | 29 | 38 9 [OP_SUB] | var_a = 38
var_b = 9
var_c = var_a - var_b
print(int(var_c)) |
Arithmetic calculation | A basket full of persimmons of the same weight weighed 62 kilograms (kg). After leaving only half of the persimmons, I weighed it with the basket and it was 34 kilograms (kg). How many kilograms (kg) does the basket alone weigh? | 6 | 62 62 34 [OP_SUB] 2 [OP_MUL] [OP_SUB] | var_a = 62
var_b = 62
var_c = 34
var_d = var_b - var_c
var_e = 2
var_f = var_d * var_e
var_g = var_a - var_f
print(int(var_g)) |
Possibility | 16 teams are having a soccer game. The losing team is eliminated and the winning team advances to the next match. How many matches are played in total when the last winning team wins the game? | 15 | 16 1 [OP_SUB] | var_a = 16
var_b = 1
var_c = var_a - var_b
print(int(var_c)) |
Correspondence | How many three-digit numbers are there where the sum of all the digits is 12? | 66 | 100 1000 1 [OP_SUB] 1 [OP_LIST_ARANGE] [OP_LIST_NUM2SUM] 12 [OP_LIST_MORE_EQUAL] 12 [OP_LIST_LESS_EQUAL] [OP_LIST_LEN] | var_a = 100
var_b = 1000
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 = 12
list_c = []
for i in list_b:
if i >= var_g:
list_c.append(i)
var_h = 12
list_d = []
for i in list_c:
if i <= var_h:
list_d.append(i)
var_i = len(list_d)
print(int(var_i)) |
Comparison | Students line up in five lines every time they jump rope, with an equal number of students in each line. Hoseok is always 4th from the left and 9th from the right in a row. How many students are there in all? | 60 | 5 4 9 [OP_ADD] 1 [OP_SUB] [OP_MUL] | var_a = 5
var_b = 4
var_c = 9
var_d = var_b + var_c
var_e = 1
var_f = var_d - var_e
var_g = var_a * var_f
print(int(var_g)) |
Correspondence | When 11 is divided by 3, the remainder is 2 and the quotient is A. Find the value of A at this time. | 3 | 11 2 [OP_SUB] 3 [OP_DIV] | var_a = 11
var_b = 2
var_c = var_a - var_b
var_d = 3
var_e = var_c / var_d
print(int(var_e)) |
Comparison | There are two numbers, A and B. A is 33 greater than 49. B is 9 multiplied by 9. Which number is greater? | A | [OP_LIST_SOL] A B [OP_LIST_EOL] [OP_LIST_SOL] 49 33 [OP_ADD] 9 9 [OP_MUL] [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 = 49
var_d = 33
var_e = var_c + var_d
var_f = 9
var_g = 9
var_h = var_f * var_g
list_b= []
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_i = 1
list_c=list_b.copy()
list_c.sort()
var_j = list_c[-var_i]
var_k = list_b.index(var_j)+1
var_l = list_a[var_k-1]
print(var_l) |
Arithmetic calculation | Jungwoo takes 20 seconds to run 150 meters (m). If Jungwoo runs for 1 minute, find how many meters (m) he can run. | 450 | 1 60 [OP_MUL] 20 [OP_DIV] 150 [OP_MUL] | var_a = 1
var_b = 60
var_c = var_a * var_b
var_d = 20
var_e = var_c / var_d
var_f = 150
var_g = var_e * var_f
print(int(var_g)) |
Correspondence | The three digit number 3AB is a multiple of 3. How many possible B's are there? | 10 | 3AB [OP_GEN_POSSIBLE_LIST] 3 [OP_LIST_DIVISIBLE] 3AB B [OP_LIST_FIND_UNK] [OP_LIST_LEN] | var_a = '3AB'
ans_dict = dict()
var_a = str(var_a)
list_a = []
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 0
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
if len(var_a) == len(str(int(temp))):
new_elem = int(temp)
list_a.append(new_elem)
var_b = 3
list_b = []
var_b = int(var_b)
for i in list_a:
i = int(i)
if i % var_b == 0:
list_b.append(i)
var_c = '3AB'
var_d = 'B'
var_c = str(var_c)
var_d = str(var_d)
unk_idx = var_c.index(var_d)
list_c = []
for elem in list_b:
elem = str(elem)
list_c.append(int(elem[unk_idx]))
list_c = list(set(list_c))
var_e = len(list_c)
print(int(var_e)) |
Arithmetic calculation | Jungkook solved 15 math problems. He got 8 questions worth 2 points and 2 questions worth 1 point correct, and he got the rest wrong, so no points were awarded for that. How many points did Jungkook get? | 18 | 2 8 [OP_MUL] 1 2 [OP_MUL] [OP_ADD] | var_a = 2
var_b = 8
var_c = var_a * var_b
var_d = 1
var_e = 2
var_f = var_d * var_e
var_g = var_c + var_f
print(int(var_g)) |
Possibility | Two of the numbers 3, 5, and 9 were drawn and used only once to create the largest two-digit number. Find the number 27 less than the two digit number you created. | 68 | [OP_LIST_SOL] 3 5 9 [OP_LIST_EOL] 2 [OP_LIST_GET_PERM] 1 [OP_LIST_MAX] 27 [OP_SUB] | var_a = 3
var_b = 5
var_c = 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 = 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]
var_g = 27
var_h = var_f - var_g
print(int(var_h)) |
Arithmetic calculation | Find what the sum of the natural numbers is in the range of 6 and 21. | 216 | 6 21 1 [OP_LIST_ARANGE] [OP_LIST_SUM] | var_a = 6
var_b = 21
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)) |
Comparison | Hyunji walked 3.97 kilometers (km), and Gayoung walked 4028 meters (m). Who has walked more distances? | Gayoung | [OP_LIST_SOL] Hyunji Gayoung [OP_LIST_EOL] [OP_LIST_SOL] 3.97 4028 1000 [OP_DIV] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Hyunji'
var_b = 'Gayoung'
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.97
var_d = 4028
var_e = 1000
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 | Hoseok did 8 workouts on Monday, 5 on Tuesday, 12 on Wednesday, 17 on Thursday, and 10 on Friday. Find the number of times he worked out on Thursday minus the number of times he worked out on Tuesday. | 12 | 17 5 [OP_SUB] | var_a = 17
var_b = 5
var_c = var_a - var_b
print(int(var_c)) |
Comparison | Yuna, Minyoung, and Yoojeong are drinking milk. Yoojeong drank the most milk, and Minyoung drank less milk than Yuna. Who drank the least milk? | Minyoung | [OP_LIST_SOL] Yuna Minyoung Yoojeong [OP_LIST_EOL] [OP_LIST_SOL] Yoojeong Minyoung > Yoojeong Yuna > Minyoung Yuna < [OP_LIST_EOL] [OP_LIST_COND_MAX_MIN] [OP_LIST_LEN] [OP_LIST_GET] | var_a = 'Yuna'
var_b = 'Minyoung'
var_c = 'Yoojeong'
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 = 'Yoojeong'
var_e = 'Minyoung'
var_f = '>'
var_g = 'Yoojeong'
var_h = 'Yuna'
var_i = '>'
var_j = 'Minyoung'
var_k = 'Yuna'
var_l = '<'
list_b= []
if "/" in str(var_l):
var_l = eval(str(var_l))
list_b.append(var_l)
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
if "/" in str(var_d):
var_d = eval(str(var_d))
list_b.append(var_d)
list_b.reverse()
global item_name_index_dict
items_name_list = list_a.copy()
conditions = []
condition_list = list_b.copy()
temp_stack = []
for index_, cond_ in enumerate(map(str, condition_list)):
if cond_ in ("<", ">", "="):
operand_right = temp_stack.pop()
operand_left = temp_stack.pop()
if cond_ == "=":
cond_ = "=="
conditions.append(f"{operand_left} {cond_} {operand_right}")
else:
if not cond_.isdigit():
cond_ = "{" + cond_ + "}"
temp_stack.append(cond_)
item_name_index_dict = {}
for perm in itertools.permutations(range(1, len(items_name_list) + 1)):
item_name_index_dict = dict(zip(items_name_list, perm))
formatted_conditions = \
[condition.format_map(item_name_index_dict) for condition in conditions]
if all(map(eval, formatted_conditions)):
break
list_c = list(item_name_index_dict.keys())
list_c.sort(key=item_name_index_dict.get, reverse=True)
var_m = len(list_c)
var_n = list_c[var_m-1]
print(var_n) |
Correspondence | A number has to be multiplied by 15, but I accidentally multiplied by 51 and it became 244.8. Find the correct value. | 72 | 244.8 51 [OP_DIV] 15 [OP_MUL] | var_a = 244.8
var_b = 51
var_c = var_a / var_b
var_d = 15
var_e = var_c * var_d
print(int(var_e)) |
Comparison | It is said that Mother used 5 liters (L) of water to wash rice, and Father used 4900 milliliters (㎖) of water. Who used more water? | Mother | [OP_LIST_SOL] Mother Father [OP_LIST_EOL] [OP_LIST_SOL] 5 1000 [OP_MUL] 4900 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'Mother'
var_b = 'Father'
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 = 5
var_d = 1000
var_e = var_c * var_d
var_f = 4900
list_b= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j) |
Arithmetic calculation | Hyejin only has 100 won coins in her piggy bank. If you put 24 more 100 wons in the piggy bank, it will be 4 times the current amount. How many coins is currently in Hyejin's piggy bank? | 8 | 24 4 1 [OP_SUB] [OP_DIV] | var_a = 24
var_b = 4
var_c = 1
var_d = var_b - var_c
var_e = var_a / var_d
print(int(var_e)) |
Comparison | There is one box whose base looks like a square. To investigate whether the bottom of the box is actually square, the horizontal length and vertical length were measured, and it turned out that the box was not square as it measured 1.618 meters (m) wide and 162.3 centimeters (cm) long. Which is longer, the horizontal lenght or the vertical length? | vertical | [OP_LIST_SOL] horizontal vertical [OP_LIST_EOL] [OP_LIST_SOL] 1.618 100 [OP_MUL] 162.3 [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 'horizontal'
var_b = 'vertical'
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 = 1.618
var_d = 100
var_e = var_c * var_d
var_f = 162.3
list_b= []
if "/" in str(var_f):
var_f = eval(str(var_f))
list_b.append(var_f)
if "/" in str(var_e):
var_e = eval(str(var_e))
list_b.append(var_e)
list_b.reverse()
var_g = 1
list_c=list_b.copy()
list_c.sort()
var_h = list_c[-var_g]
var_i = list_b.index(var_h)+1
var_j = list_a[var_i-1]
print(var_j) |
Comparison | Find the smallest number greater than 0.4 from 0.8, 1/2, and 0.3. | 0.5 | [OP_LIST_SOL] 0.8 1/2 0.3 [OP_LIST_EOL] 0.4 [OP_LIST_MORE] 1 [OP_LIST_MIN] | 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-1]
print('{:.2f}'.format(round(var_f+1e-10,2))) |
Comparison | Yoongi had 4 apples, Jungkook had 6 apples, but he ate 3. If Yuna has 5 apples, who has the fewest? | Jungkook | [OP_LIST_SOL] Yoongi Jungkook Yuna [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_SUB] 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) |
Geometry | How many faces are in a regular dodecahedron? | 12 | 12 | var_a = 12
print(int(var_a)) |
Arithmetic calculation | The 30 students in Yejin's class have their own attendance numbers from 1 to 30. Among the students in Yejin's class, students wearing short sleeves today are students number 1, 3, 7, 10, 23, and 27, and students number 1, 9, 11, 20, and 23 are wearing short pants today, how many students were wearing short sleeves but not short pants today? | 4 | [OP_LIST_SOL] 1 3 7 10 23 27 [OP_LIST_EOL] [OP_LIST_SOL] 1 9 11 20 23 [OP_LIST_EOL] [OP_SET_DIFFERENCE] [OP_LIST_LEN] | var_a = 1
var_b = 3
var_c = 7
var_d = 10
var_e = 23
var_f = 27
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 = 1
var_h = 9
var_i = 11
var_j = 20
var_k = 23
list_b= []
if "/" in str(var_k):
var_k = eval(str(var_k))
list_b.append(var_k)
if "/" in str(var_j):
var_j = eval(str(var_j))
list_b.append(var_j)
if "/" in str(var_i):
var_i = eval(str(var_i))
list_b.append(var_i)
if "/" in str(var_h):
var_h = eval(str(var_h))
list_b.append(var_h)
if "/" in str(var_g):
var_g = eval(str(var_g))
list_b.append(var_g)
list_b.reverse()
list_c = list(set(list_a) - set(list_b))
var_l = len(list_c)
print(int(var_l)) |
Possibility | We are trying to pick a class president and a vice president from Jungkook, Jimin, Yoongi, and Yuna. How many possible cases are there? | 12 | [OP_LIST_SOL] Jungkook Jimin Yoongi Yuna [OP_LIST_EOL] [OP_LIST_LEN] 2 [OP_PERM] | var_a = 'Jungkook'
var_b = 'Jimin'
var_c = 'Yoongi'
var_d = 'Yuna'
list_a= []
if "/" in str(var_d):
var_d = eval(str(var_d))
list_a.append(var_d)
if "/" in str(var_c):
var_c = eval(str(var_c))
list_a.append(var_c)
if "/" in str(var_b):
var_b = eval(str(var_b))
list_a.append(var_b)
if "/" in str(var_a):
var_a = eval(str(var_a))
list_a.append(var_a)
list_a.reverse()
var_e = len(list_a)
var_f = 2
var_g = 1
var_e = int(var_e)
var_f = int(var_f)
for i, elem in enumerate(range(var_f)):
var_g = var_g * (var_e-i)
print(int(var_g)) |
Comparison | There are 13 students behind Youngbin. If a total of 25 students are standing in a line, how many students are in front of Youngbin? | 11 | 25 13 [OP_SUB] 1 [OP_SUB] | var_a = 25
var_b = 13
var_c = var_a - var_b
var_d = 1
var_e = var_c - var_d
print(int(var_e)) |
Arithmetic calculation | Jungkook has 5 red balls, 4 blue balls, and 3 yellow balls. When Yoongi gives 1 yellow ball to Jungkook, how many red balls does Jungkook have? | 5 | 5 | var_a = 5
print(int(var_a)) |
Comparison | There are 221 first-year female students, and 255 first-year male students at Taein's School, 275 second-year female students and 226 second-year male students. Find which grade has more students. | 2 | [OP_LIST_SOL] 1 2 [OP_LIST_EOL] [OP_LIST_SOL] 221 255 [OP_ADD] 275 226 [OP_ADD] [OP_LIST_EOL] 1 [OP_LIST_MAX] [OP_LIST_INDEX] [OP_LIST_POP] [OP_LIST_GET] | var_a = 1
var_b = 2
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 = 221
var_d = 255
var_e = var_c + var_d
var_f = 275
var_g = 226
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(int(var_l)) |
Arithmetic calculation | 7 out of 13 flowers are withered and discarded. How many live flowers are there? | 6 | 13 7 [OP_SUB] | var_a = 13
var_b = 7
var_c = var_a - var_b
print(int(var_c)) |
Comparison | A certain number is a natural number greater than 52. If there are 15 consecutive natural numbers between 52 and the certain number, which number is in the middle of the numbers between 52 and the certain number? | 60 | 52 15 [OP_ADD] 1 [OP_ADD] 52 [OP_ADD] 2 [OP_DIV] | var_a = 52
var_b = 15
var_c = var_a + var_b
var_d = 1
var_e = var_c + var_d
var_f = 52
var_g = var_e + var_f
var_h = 2
var_i = var_g / var_h
print(int(var_i)) |
Geometry | A polygon can draw only one diagonal from one vertex. How many sides does this polygon have? | 4 | 1 3 [OP_ADD] | var_a = 1
var_b = 3
var_c = var_a + var_b
print(int(var_c)) |
Correspondence | 812 divided by a particular number equals 25. Find out the value when that particular number is divided by 4. | 8.12 | 812 25 [OP_DIV] 4 [OP_DIV] | var_a = 812
var_b = 25
var_c = var_a / var_b
var_d = 4
var_e = var_c / var_d
print('{:.2f}'.format(round(var_e+1e-10,2))) |
Comparison | The heights of 7 students in class 1 of 6th grade are 161.5 centimeters (cm), 154.3 centimeters (cm), 143.7 centimeters (cm), 160.1 centimeters (cm), 158.0 centimeters (cm), 153.5 centimeters (cm), 147.8 centimeters (cm). Find how many of these students are above average. | 4 | [OP_LIST_SOL] 161.5 154.3 143.7 160.1 158.0 153.5 147.8 [OP_LIST_EOL] [OP_LIST_MEAN] [OP_LIST_MORE] [OP_LIST_LEN] | var_a = 161.5
var_b = 154.3
var_c = 143.7
var_d = 160.1
var_e = 158
var_f = 153.5
var_g = 147.8
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()
list_a = [float(i) for i in list_a]
var_h = sum(list_a)/len(list_a)
list_b = []
for i in list_a:
if i > var_h:
list_b.append(i)
var_i = len(list_b)
print(int(var_i)) |
Comparison | What is the largest number between 5 and 8? | 8 | [OP_LIST_SOL] 5 8 [OP_LIST_EOL] 1 [OP_LIST_MAX] | var_a = 5
var_b = 8
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 = 1
list_b=list_a.copy()
list_b.sort()
var_d = list_b[-var_c]
print(int(var_d)) |
Possibility | You would like to buy 2 fruits. If there are 4 types of fruit to choose from, how many ways are there for you to buy?
| 6 | 4 2 [OP_COMB] | var_a = 4
var_b = 2
var_c = 1
var_a = int(var_a)
var_b = int(var_b)
for i, elem in enumerate(range(var_b)):
var_c = var_c * (var_a-i)
for i, elem in enumerate(range(var_b)):
var_c = var_c / (i+1)
print(int(var_c)) |
Possibility | 1234567891011121314...998999 was created by writing the numbers from 1 to 999 in order. Find the sum of each digit in this number. | 13500 | 1 999 1 [OP_LIST_ARANGE] [OP_LIST_NUM2SUM] [OP_LIST_SUM] | var_a = 1
var_b = 999
var_c = 1
list_a = [i for i in range(var_a, var_b + 1, var_c)]
list_b=[]
for i in list_a:
var_d = 0
i = int(i)
while i//10 > 0:
var_d = var_d + i%10
i = i//10
var_d = var_d + i%10
list_b.append(var_d)
list_b = [float(i) for i in list_b]
var_e = sum(list_b)
print(int(var_e)) |
Possibility | When there are 6 students A, B, C, D, E, and F, find the number of ways to select 1 president and 1 secretary. | 30 | 6 1 1 [OP_ADD] [OP_PERM] | var_a = 6
var_b = 1
var_c = 1
var_d = var_b + var_c
var_e = 1
var_a = int(var_a)
var_d = int(var_d)
for i, elem in enumerate(range(var_d)):
var_e = var_e * (var_a-i)
print(int(var_e)) |
Geometry | A necklace is made by attaching 16 pieces of colored paper each 10.4 centimeters (cm) in length, overlapping each other by 3.5 centimeters (cm). How many centimeters (cm) is the total length of the necklace made of colored paper? | 110.4 | 10.4 16 [OP_MUL] 3.5 16 [OP_MUL] [OP_SUB] | var_a = 10.4
var_b = 16
var_c = var_a * var_b
var_d = 3.5
var_e = 16
var_f = var_d * var_e
var_g = var_c - var_f
print('{:.2f}'.format(round(var_g+1e-10,2))) |
Geometry | Miyoung made a large cube using 8 cube-shaped boxes with a surface area of 96 square centimeters (㎠). What is the volume of this large cube? | 512 | 96 6 [OP_DIV] 1/2 [OP_POW] 8 2 [OP_DIV] 2 [OP_DIV] [OP_MUL] 3 [OP_POW] | var_a = 96
var_b = 6
var_c = var_a / var_b
var_d = 0.5
var_e = var_c ** var_d
var_f = 8
var_g = 2
var_h = var_f / var_g
var_i = 2
var_j = var_h / var_i
var_k = var_e * var_j
var_l = 3
var_m = var_k ** var_l
print(int(var_m)) |
Correspondence | Find A from this formula AB9=459 which is expressed as a three-digit number. | 4 | AB9=459 A [OP_DIGIT_UNK_SOLVER] | var_a = 'AB9=459'
var_b = 'A'
ans_dict = dict()
var_a = var_a.replace('×','*')
var_a = var_a.replace('x','*')
var_a = var_a.replace('÷','/')
variable_candi = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
for v in set(var_a):
if v in variable_candi:
ans_dict[v] = 1
candi = list(itertools.product('0123456789', repeat=len(ans_dict)))
for c in candi:
temp = var_a
for i, (k, _) in enumerate(ans_dict.items()):
temp = temp.replace(k, str(c[i]))
term_list = []
op_list = []
temp_c = ''
for tc in temp:
if tc not in '+-*/=><().':
temp_c += tc
else:
op_list.append(tc)
term_list.append(temp_c)
temp_c = ''
term_list.append(temp_c)
new_eq = ''
for i in range(len(op_list)):
new_eq += str(int(term_list[i]))+op_list[i]
new_eq += str(int(term_list[-1]))
if len(new_eq) == len(var_a):
new_eq=new_eq.replace('=', '==')
new_eq=new_eq.replace('>==', '>=')
new_eq=new_eq.replace('<==', '<=')
eval_result = False
try:
eval_result = eval(new_eq)
except:
pass
if eval_result:
for i, (k, _) in enumerate(ans_dict.items()):
ans_dict[k] = int(c[i])
var_c = ans_dict[var_b]
print(int(var_c)) |
Correspondence | The three-digit number 751 is less than 7A5. A is a tens digit and can contain any number from 0 to 9. How many digits can you write in A? | 5 | 7A5 [OP_GEN_POSSIBLE_LIST] 751 [OP_LIST_LESS] [OP_LIST_LEN] | var_a = '7A5'
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 = 751
list_b = []
for i in list_a:
if i < var_b:
list_b.append(i)
var_c = len(list_b)
print(int(var_c)) |
Arithmetic calculation | There were 7 crates containing 6 bottles of juice each, and I broke the juice bottles in 3 of the crates while moving the crates. How many bottles of juice are left? | 24 | 7 3 [OP_SUB] 6 [OP_MUL] | var_a = 7
var_b = 3
var_c = var_a - var_b
var_d = 6
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | Moving a decimal point to the left by one place makes a particular decimal number 0.72 less than it originally was. Find the original decimal. | 0.8 | 0.72 0.9 [OP_DIV] | var_a = 0.72
var_b = 0.9
var_c = var_a / var_b
print('{:.2f}'.format(round(var_c+1e-10,2))) |
Correspondence | I made the mistake of multiplying a number by 4, when I should have divided this number by 4. I got 32 from this miscalculation. Find out how much it is if I calculate it correctly. | 2 | 32 4 [OP_DIV] 4 [OP_DIV] | var_a = 32
var_b = 4
var_c = var_a / var_b
var_d = 4
var_e = var_c / var_d
print(int(var_e)) |
Geometry | 12 friends, including Yoonseok, are standing as a dodecagon. Every student shook hands once with every friend except for the friend on either side of them. How many handshakes did Yoonseok shake? | 9 | 12 3 [OP_SUB] | var_a = 12
var_b = 3
var_c = var_a - var_b
print(int(var_c)) |
Comparison | There are two circles A and B. The area of A is 25 square centimeters (cm2), and the area of B is 49 square centimeters (cm2). How many centimeters (cm) is the diameter of the larger circle when pi is calculated as 3.1? | 7.95 | [OP_LIST_SOL] 25 49 [OP_LIST_EOL] 1 [OP_LIST_MAX] 3.1 [OP_DIV] 0.5 [OP_POW] 2 [OP_MUL] | var_a = 25
var_b = 49
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 = 1
list_b=list_a.copy()
list_b.sort()
var_d = list_b[-var_c]
var_e = 3.1
var_f = var_d / var_e
var_g = 0.5
var_h = var_f ** var_g
var_i = 2
var_j = var_h * var_i
print('{:.2f}'.format(round(var_j+1e-10,2))) |
Comparison | Yoongi has 4 apples and Jungkook has 6 plus 3 apples. Who has fewer apples? | Yoongi | [OP_LIST_SOL] Yoongi Jungkook [OP_LIST_EOL] [OP_LIST_SOL] 4 6 3 [OP_ADD] [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) |
Possibility | When using all of the given number cards 7, 5, and 2 once to make a number greater than 530 and less than 710, write the number that can be placed in the ones place. | 2 | [OP_LIST_SOL] 7 5 2 [OP_LIST_EOL] [OP_LIST_LEN] [OP_LIST_GET_PERM] 530 [OP_LIST_MORE] 710 [OP_LIST_LESS] 1 [OP_LIST_GET] 100 [OP_MOD] 10 [OP_MOD] | var_a = 7
var_b = 5
var_c = 2
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 = 530
list_c = []
for i in list_b:
if i > var_e:
list_c.append(i)
var_f = 710
list_d = []
for i in list_c:
if i < var_f:
list_d.append(i)
var_g = 1
var_h = list_d[var_g-1]
var_i = 100
var_j = var_h % var_i
var_k = 10
var_l = var_j % var_k
print(int(var_l)) |
Arithmetic calculation | A one bundle means 10. If X is comprised of 6 plus 2 bundles, and Y is comprised of 1 plus 4 bundles, what is the sum of X and Y? | 67 | 10 2 [OP_MUL] 6 [OP_ADD] 10 4 [OP_MUL] 1 [OP_ADD] [OP_ADD] | var_a = 10
var_b = 2
var_c = var_a * var_b
var_d = 6
var_e = var_c + var_d
var_f = 10
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)) |
Arithmetic calculation | Minji took the train and Seonkyung took the car. If the car travels 65 kilometers (km) per hour and the train travels 95 kilometers (km) per hour, how long is the distance between Minjin and Seonkyung after 8 hours? | 240 | 95 65 [OP_SUB] 8 [OP_MUL] | var_a = 95
var_b = 65
var_c = var_a - var_b
var_d = 8
var_e = var_c * var_d
print(int(var_e)) |
Correspondence | Find the number B that satisfies 6A5+10B=748, where 6A5 and 10B are three-digit numbers. | 3 | 6A5+10B=748 B [OP_DIGIT_UNK_SOLVER] | var_a = '6A5+10B=748'
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)) |
Comparison | What is the average of all natural numbers greater than 28 and less than or equal to 31? | 30 | 28 1 [OP_ADD] 31 1 [OP_LIST_ARANGE] [OP_LIST_MEAN] | var_a = 28
var_b = 1
var_c = var_a + var_b
var_d = 31
var_e = 1
list_a = [i for i in range(var_c, var_d + 1, var_e)]
list_a = [float(i) for i in list_a]
var_f = sum(list_a)/len(list_a)
print(int(var_f)) |
Correspondence | When you add 43 to a number, you get 81. What is the result of adding 25 to this number? | 63 | 81 43 [OP_SUB] 25 [OP_ADD] | var_a = 81
var_b = 43
var_c = var_a - var_b
var_d = 25
var_e = var_c + var_d
print(int(var_e)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.