Python 9219b
Questa è la mia seconda voce. Ho iniziato da zero e ho provato una nuova disposizione dei dati, incluso l'uso del pacchetto blist per elenchi e dicts ordinati, e alcuni nuovi approcci per trovare soluzioni di grandi dimensioni. Penso di avere un 1-256 ottimale. L'aumento del tempo di esecuzione da 30 a 4 m ha ridotto i grandi casi di test di circa 30 byte.
# https://pypi.python.org/pypi/blist/
# provides sorteddict
from blist import *
import math, sys
TABLE_SIZE=2**8
MAX_INT = 2**31
repr = sorteddict()
for i in range(12):
repr[i] = sorteddict({(i*2+2,-1,-1):("["*(i+1)+"]"*(i+1), str(i))});
repr [65536] = sorteddict({(18, 4, 4):("[[[]]] [[[[]]]]", "2^^^3")}); # 2^^^3 = 2^^(2^^2) = 2^(2^(2^2))
repr [16] = sorteddict({(17, 3, 3):("[[[]]] [[[[]]]]", "2^^3")}); # 2^^3 = 2^(2^2)
repr [27] = sorteddict({(17, 3, 3):("[[[[]]]] [[[]]]", "3^^2")}); # 3^^2 = 3^3
repr [256] = sorteddict({(19, 3, 3):("[[[[[]]]]] [[[]]]", "4^^2")}); # 4^^2 = 4^4
repr [3125] = sorteddict({(21, 3, 3):("[[[[[[]]]]]] [[[]]]", "5^^2")}); # 5^^2 = 5^5
repr [46656] = sorteddict({(23, 3, 3):("[[[[[[[]]]]]]] [[[]]]", "6^^2")}); # 6^^2 = 6^6
repr [823543] = sorteddict({(25, 3, 3):("[[[[[[[[]]]]]]]] [[[]]]", "7^^2")}); # 7^^2 = 7^7
repr [16777216] = sorteddict({(27, 3, 3):("[[[[[[[[[]]]]]]]]] [[[]]]", "8^^2")}); # 8^^2 = 8^8
repr[387420489] = sorteddict({(29, 3, 3):("[[[[[[[[[[]]]]]]]]]] [[[]]]", "9^^2")}); # 9^^2 = 9^9
def expr_to_repr(a,op,b):
rep_a = None
for d,r in repr[a].iteritems():
op_min, op_max = ((0,9),(1,9),(3,9))[op]
if (d[1]==-1 or d[1]>=op_min) and d[2]<=op_max:
rep_a = (d,r)
break
if not rep_a:
rep_a = ((a*2+2,-1,-1),("["*(a+1)+"]"*(a+1), str(a)));
rep_b = None
for d,r in repr[b].iteritems():
op_min, op_max = ((0,9),(1,9),(3,9))[op]
if (d[1]==-1 or d[1]>=op_min) and d[2]<=op_max:
rep_b = (d,r)
break
if not rep_b:
rep_b = ((b*2+2,-1,-1),("["*(b+1)+"]"*(b+1), str(b)));
r = rep_a[1][0] + " "*op + rep_b[1][0]
return (
(
len(r),
min(op, rep_a[0][1] if rep_a[0][1]!=-1 else op, rep_b[0][1] if rep_b[0][1]!=-1 else op),
max(op, rep_a[0][2], rep_b[0][2])
),
(
r,
expr_to_string(rep_a[1][1],op,rep_b[1][1])
)
);
def opsym(op):
return ("+","*","^","^^")[op]
def expr_to_string(a,op,b):
return str(a) + opsym(op) + str(b)
def calc(a,op,b):
if op == 0:
return min(a+b,MAX_INT)
elif op == 1:
return min(a*b,MAX_INT)
elif op == 2:
if (b*math.log10(a)>math.log10(MAX_INT)):
return MAX_INT
return min(a**b,MAX_INT)
else:
t = a
for h in range(b):
t = calc(a,op-1,t)
if t>=MAX_INT:
t = MAX_INT
break
return t
def populate_repr(a,op,b):
o = (a,op,b)
n = calc(*o)
if n == MAX_INT:
return n
if n not in repr:
repr[n] = sorteddict()
r = expr_to_repr(*o)
if conditional_replace_repr(n,r):
for i in range(1,11):
conditional_replace_repr(n+i,
(
(
r[0][0]+i*2,
-1,
-1
),
(
"["*i + r[1][0] + "]"*i,
"(" + r[1][1] + "+" + str(i) + ")"
)
)
)
return n
def conditional_replace_repr(n,new_rep):
if n not in repr:
repr[n] = sorteddict()
repr[n][new_rep[0]] = new_rep[1]
return True
found = None
repl = False
for d, r in repr[n].iteritems():
if d[1] == new_rep[0][1] and d[2] == new_rep[0][2]:
found = d
if d[0] > new_rep[0][0]:
repl = True
break
if (not found) or (found and repl):
repr[n][new_rep[0]] = new_rep[1]
if found:
del repr[n][found]
return True
return False
def vaguely_decent_repr(n):
if n <= TABLE_SIZE:
return repr[n].iteritems().next()[1][0]
if n in repr:
return repr[n].iteritems().next()[1][0]
else:
keys = sorted(repr.keys(),reverse=True)
best_rep = None
tested = 0
for i in keys:
if i>n:
continue
if tested > 10:
break
tested += 1
cand_rep = vaguely_decent_repr(n-i) + repr[i].iteritems().next()[1][0]
if (not best_rep) or len(cand_rep) < len(best_rep):
best_rep = cand_rep
return best_rep
keys = repr.keys()
for k in keys:
for d,r in repr[k].iteritems():
for i in range(1,11):
conditional_replace_repr(k+i,
(
(
d[0]+i*2,
-1,
-1
),
(
"["*i + r[0] + "]"*i,
"(" + r[1] + "+" + str(i) + ")"
)
)
)
# initialize the repr array with results of 1..256, 2+2 up to TABLE_SIZE^TABLE_SIZE
for row in range(2,TABLE_SIZE+1):
for col in range(2,row):
for op in range(1,3):
populate_repr(row,op,col)
if op > 1:
populate_repr(col,op,row)
for op in range(1,3):
populate_repr(row,op,row)
if row > 10:
for frac in range(1,10):
rep_a = repr[row-frac].iteritems().next()
conditional_replace_repr(row,
(
(
rep_a[0][0] + frac*2,
-1,
-1
),
(
"["*frac + rep_a[1][0] + "]"*frac,
"(" + rep_a[1][1] + "+" + str(frac) + ")"
)
)
)
for frac in range(10,row/2):
rep_a = repr[frac].iteritems().next()
rep_b = repr[row-frac].iteritems().next()
conditional_replace_repr(row,
(
(
rep_a[0][0]+rep_b[0][0],
min(rep_a[0][1],rep_b[0][1]),
max(rep_a[0][2],rep_b[0][2])
),
(
rep_a[1][0] + rep_b[1][0],
rep_a[1][1] + "+" + rep_b[1][1]
)
)
)
# for n,reps in repr.iteritems():
# for d,r in reps.iteritems():
for n in range(1,257):
print str(n)+"="+repr[n].iteritems().next()[1][0]
for n in (8191,13071,524287,2147483647,1449565302,1746268229,126528612,778085967,1553783038,997599288):
print str(n)+"="+vaguely_decent_repr(n)
Produzione:
1=[[]]
2=[[[]]]
3=[[[[]]]]
4=[[[[[]]]]]
5=[[[[[[]]]]]]
6=[[[[[[[]]]]]]]
7=[[[[[[[[]]]]]]]]
8=[[[]]] [[[[]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[[[[[[[[]]]] [[[[[]]]]]]]]]]
87=[[[[[[]]]] [[[]]]]] [[[[]]]]
88=[[[[[[[]]]] [[[]]]]] [[[[]]]]]
89=[[[[[[[[]]]] [[[]]]]] [[[[]]]]]]
90=[[[[[[[]]]] [[[]]]]]] [[[[]]]]
91=[[[[[[[[]]]] [[[]]]]]] [[[[]]]]]
92=[[[[[[[[[]]]] [[[]]]]]] [[[[]]]]]]
93=[[[[[[[[]]]] [[[]]]]]]] [[[[]]]]
94=[[[[[[[[[]]]] [[[]]]]]]] [[[[]]]]]
95=[[[[[[]]] [[[[]]]]]]] [[[[[[]]]]]]
96=[[[]]] [[[[[[]]]]]] [[[[]]]]
97=[[[[]]] [[[[[[]]]]]] [[[[]]]]]
98=[[[[[[[[]]]]]]]] [[[]]] [[[]]]
99=[[[[]]] [[[[[[]]]]]]] [[[[]]]]
100=[[[[[]]]] [[[]]]] [[[]]]
101=[[[[[[]]]] [[[]]]] [[[]]]]
102=[[[[[[[]]]] [[[]]]] [[[]]]]]
103=[[[[[[[[]]]] [[[]]]] [[[]]]]]]
104=[[[[[[[]]]]]] [[[]]]] [[[[[]]]]]
105=[[[[[[[[]]]]]] [[[]]]] [[[[[]]]]]]
106=[[[[[[[[[]]]]]] [[[]]]] [[[[[]]]]]]]
107=[[[[[[[[[[]]]]]] [[[]]]] [[[[[]]]]]]]]
108=[[[[]]]] [[[]]] [[[[[]]]]]
109=[[[[[]]]] [[[]]] [[[[[]]]]]]
110=[[[[[[]]]] [[[]]] [[[[[]]]]]]]
111=[[[[[[[[]]]]]]] [[[]]]] [[[[]]]]
112=[[[[[]]]] [[[]]]] [[[[[]]]]]
113=[[[[[[]]]] [[[]]]] [[[[[]]]]]]
114=[[[[[[[]]]] [[[]]]] [[[[[]]]]]]]
115=[[[[[[[[]]]] [[[]]]] [[[[[]]]]]]]]
116=[[[[[[]]]] [[[]]]]] [[[[[]]]]]
117=[[[[[[[]]]] [[[]]]]] [[[[[]]]]]]
118=[[[[[[[[]]]] [[[]]]]] [[[[[]]]]]]]
119=[[[[]]] [[[[]]]]] [[[[[[[[]]]]]]]]
120=[[[[[[[]]]] [[[]]]]]] [[[[[]]]]]
121=[[[[[[]]]] [[[]]]]] [[[]]]
122=[[[[[[[]]]] [[[]]]]] [[[]]]]
123=[[[[[[[[]]]] [[[]]]]] [[[]]]]]
124=[[[[[[[[[]]]] [[[]]]]] [[[]]]]]]
125=[[[[[[]]]]]] [[[[]]]]
126=[[[[[[[]]]]]] [[[[]]]]]
127=[[[[[[[[]]]]]] [[[[]]]]]]
128=[[[]]] [[[[[[[[]]]]]]]]
129=[[[[]]] [[[[[[[[]]]]]]]]]
130=[[[[[]]] [[[[[[[[]]]]]]]]]]
131=[[[[[[]]] [[[[[[[[]]]]]]]]]]]
132=[[[[[[[]]]]] [[[[]]]]]] [[[]]]
133=[[[[[[[[]]]]] [[[[]]]]]] [[[]]]]
134=[[[[[[[[]]]]] [[[[]]]]]]] [[[]]]
135=[[[[]]]] [[[]]] [[[[[[]]]]]]
136=[[[[[]]]] [[[]]] [[[[[[]]]]]]]
137=[[[[[[]]]] [[[]]] [[[[[[]]]]]]]]
138=[[[[[[[]]]] [[[]]] [[[[[[]]]]]]]]]
139=[[[[[[[[]]]] [[[]]] [[[[[[]]]]]]]]]]
140=[[[[[]]]] [[[]]]] [[[[[[]]]]]]
141=[[[[[[]]]] [[[]]]] [[[[[[]]]]]]]
142=[[[[[[[]]]] [[[]]]] [[[[[[]]]]]]]]
143=[[[[[[[[]]]] [[[]]]] [[[[[[]]]]]]]]]
144=[[[[[[[]]]] [[[]]]]]] [[[]]]
145=[[[[[[[[]]]] [[[]]]]]] [[[]]]]
146=[[[[[[[[[]]]] [[[]]]]]] [[[]]]]]
147=[[[[[[[[]]]]]]]] [[[]]] [[[[]]]]
148=[[[[[[[[[]]]]]]]] [[[]]] [[[[]]]]]
149=[[[[[[[[[]]]]]]] [[[]]]] [[[[[]]]]]]
150=[[[[[[[[[]]]]]]]] [[[]]]] [[[[]]]]
151=[[[[[[[]]]]]] [[[]]] [[[[[[[]]]]]]]]
152=[[[[[[[[[]]]]]]] [[[]]]]] [[[[[]]]]]
153=[[[[]]] [[[[]]]]] [[[[]]]] [[[]]]
154=[[[[[]]] [[[[]]]]] [[[[]]]] [[[]]]]
155=[[[[[[[[]]]] [[[]]]]]]] [[[[[[]]]]]]
156=[[[[[[[]]]]]] [[[]]]] [[[[[[[]]]]]]]
157=[[[[[[[[]]]]]] [[[]]]] [[[[[[[]]]]]]]]
158=[[[[[[[[]]]]]] [[[]]]] [[[[]]]]] [[[]]]
159=[[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[[]]]]
160=[[[]]] [[[[[[]]]]]] [[[[[[]]]]]]
161=[[[[]]] [[[[[[]]]]]] [[[[[[]]]]]]]
162=[[[[]]]] [[[[[]]]]] [[[]]]
163=[[[[[]]]] [[[[[]]]]] [[[]]]]
164=[[[[[]]]] [[[[[]]]]]] [[[]]]
165=[[[[[[]]]] [[[[[]]]]]] [[[]]]]
166=[[[[[[]]]] [[[[[]]]]]]] [[[]]]
167=[[[[[[[]]]] [[[[[]]]]]]] [[[]]]]
168=[[[[[[[]]]] [[[[[]]]]]]]] [[[]]]
169=[[[[[[]]]]] [[[[]]]]] [[[]]]
170=[[[[[[[]]]]] [[[[]]]]] [[[]]]]
171=[[[[[[[[]]]]] [[[[]]]]] [[[]]]]]
172=[[[[[[[[[]]]]] [[[[]]]]] [[[]]]]]]
173=[[[[[[[[[[]]]]] [[[[]]]]] [[[]]]]]]]
174=[[[[[[]]]] [[[]]]]] [[[[[[[]]]]]]]
175=[[[[[[]]]]]] [[[]]] [[[[[[[[]]]]]]]]
176=[[[]]] [[[[]]]] [[[[[[]]]] [[[]]]]]
177=[[[[[[[]]]] [[[]]]]] [[[]]]] [[[[]]]]
178=[[[[[[[[]]]] [[[]]]]] [[[]]]] [[[[]]]]]
179=[[[[[[[[[]]]] [[[]]]]] [[[]]]] [[[[]]]]]]
180=[[[[[[[]]]]]]] [[[]]] [[[[[[]]]]]]
181=[[[[[[[[]]]]]]] [[[]]] [[[[[[]]]]]]]
182=[[[[[[[[[]]]]]]] [[[]]] [[[[[[]]]]]]]]
183=[[[[[[[[]]]]]] [[[]]]] [[[[[[[[]]]]]]]]]
184=[[[[[]]]] [[[]]] [[[[[[]]]]]]] [[[[[]]]]]
185=[[[[[[[[]]]]]]] [[[]]]] [[[[[[]]]]]]
186=[[[[[[[[[]]]]]]] [[[]]]] [[[[[[]]]]]]]
187=[[[[]]] [[[[]]]]] [[[[[[]]]] [[[]]]]]
188=[[[[[]]] [[[[]]]]] [[[[[[]]]] [[[]]]]]]
189=[[[[]]]] [[[]]] [[[[[[[[]]]]]]]]
190=[[[[[]]]] [[[]]] [[[[[[[[]]]]]]]]]
191=[[[[[[]]]] [[[]]] [[[[[[[[]]]]]]]]]]
192=[[[[[]]]]] [[[[]]]] [[[[]]]]
193=[[[[[[]]]]] [[[[]]]] [[[[]]]]]
194=[[[[[[[]]]]] [[[[]]]] [[[[]]]]]]
195=[[[[[[]]]]] [[[[]]]]] [[[[]]]]
196=[[[[[[[]]]]] [[[[]]]]]] [[[]]]
197=[[[[[[[[]]]]] [[[[]]]]]] [[[]]]]
198=[[[[[[[]]]]] [[[[]]]]]] [[[[]]]]
199=[[[[[[[[]]]]] [[[[]]]]]] [[[[]]]]]
200=[[[[[]]]] [[[]]]] [[[]]] [[[]]]
201=[[[[[[]]]] [[[]]]] [[[]]] [[[]]]]
202=[[[[[[]]]] [[[]]]] [[[]]]] [[[]]]
203=[[[[[[[]]]] [[[]]]] [[[]]]] [[[]]]]
204=[[[[[[[[[]]]]] [[[[]]]]]]]] [[[[]]]]
205=[[[[[[[[[[]]]]] [[[[]]]]]]]] [[[[]]]]]
206=[[[[[[[[]]]] [[[]]]] [[[]]]]]] [[[]]]
207=[[[[[[[[[[]]]]] [[[[]]]]]]]]] [[[[]]]]
208=[[[[[[[]]]]]] [[[]]]] [[[]]] [[[[]]]]
209=[[[[]]] [[[[]]]] [[[[[[]]]]] [[[[]]]]]]
210=[[[[[[[]]]] [[[]]]]]] [[[[[[[[]]]]]]]]
211=[[[[[[[[]]]] [[[]]]]]] [[[[[[[[]]]]]]]]]
212=[[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[[[]]]]]
213=[[[[[[[[[[[[]]]]] [[[[]]]]]]]]]]] [[[[]]]]
214=[[[[[[[[[[[[[]]]]] [[[[]]]]]]]]]]] [[[[]]]]]
215=[[[[[[[[[]]]]]]]] [[[[[[[]]]]]]]] [[[[[[]]]]]]
216=[[[[[[[]]]]]]] [[[[]]]]
217=[[[[[[[[]]]]]]] [[[[]]]]]
218=[[[[[[[[[]]]]]]] [[[[]]]]]]
219=[[[[[[[[[[]]]]]]] [[[[]]]]]]]
220=[[[[[[[[[[[]]]]]]] [[[[]]]]]]]]
221=[[[[[[[[[[[[]]]]]]] [[[[]]]]]]]]]
222=[[[[[[[[[[[[[]]]]]]] [[[[]]]]]]]]]]
223=[[[[[[[[[[[[[[]]]]]]] [[[[]]]]]]]]]]]
224=[[[[[]]]] [[[]]]] [[[]]] [[[[]]]]
225=[[[[[[[[]]]]] [[[[]]]]]]] [[[]]]
226=[[[[[[[[[]]]]] [[[[]]]]]]] [[[]]]]
227=[[[[[[[[[[]]]]] [[[[]]]]]]] [[[]]]]]
228=[[[[[[[[[[[]]]]] [[[[]]]]]]] [[[]]]]]]
229=[[[[[[[[[[[[]]]]] [[[[]]]]]]] [[[]]]]]]]
230=[[[[[[[[[[[[[]]]]] [[[[]]]]]]] [[[]]]]]]]]
231=[[[[]]] [[[[[[]]]]]]] [[[[[[[[]]]]]]]]
232=[[[[[[]]]] [[[]]]]] [[[]]] [[[[]]]]
233=[[[[[[[]]]] [[[]]]]] [[[]]] [[[[]]]]]
234=[[[[[[[]]]]]] [[[]]]] [[[[]]]] [[[]]]
235=[[[[[[[[]]]]]] [[[]]]] [[[[]]]] [[[]]]]
236=[[[[[[[]]]] [[[]]]]] [[[]]]] [[[[[]]]]]
237=[[[[[[[[]]]]]] [[[]]]] [[[[]]]]] [[[[]]]]
238=[[[[[]]] [[[[[[]]]]]]]] [[[[[[[[]]]]]]]]
239=[[[[[[]]] [[[[[[]]]]]]]] [[[[[[[[]]]]]]]]]
240=[[[]]] [[[[]]]] [[[[[[]]]]]] [[[[]]]]
241=[[[[]]] [[[[]]]] [[[[[[]]]]]] [[[[]]]]]
242=[[[[[[]]]] [[[]]]]] [[[]]] [[[]]]
243=[[[[]]]] [[[[[[]]]]]]
244=[[[[[]]]] [[[[[[]]]]]]]
245=[[[[[[]]]] [[[[[[]]]]]]]]
246=[[[[[[[]]]] [[[[[[]]]]]]]]]
247=[[[[[[[[]]]] [[[[[[]]]]]]]]]]
248=[[[[[[[[[]]]] [[[[[[]]]]]]]]]]]
249=[[[[[[]]]] [[[[[]]]]]]] [[[[]]]]
250=[[[[[[]]]]]] [[[[]]]] [[[]]]
251=[[[[[[[]]]]]] [[[[]]]] [[[]]]]
252=[[[[[[[]]]]]] [[[[]]]]] [[[]]]
253=[[[[[[[[]]]]]] [[[[]]]]] [[[]]]]
254=[[[[[[[[]]]]]] [[[[]]]]]] [[[]]]
255=[[[[[[[[[]]]]]] [[[[]]]]]] [[[]]]]
256=[[[[[]]]]] [[[]]]
8191=[[[[[[[[]]]]]] [[[[]]]]] [[[[[[]]]]] [[[[]]]]]]
13071=[[[[[[[[[]]]] [[[]]]]] [[[]]] [[[[]]]] [[[]]] [[[[[]]]]]]]]
524287=[[[[]]]] [[[]]] [[[[[[[[]]]]]]]] [[[[[[]]]]] [[[[]]]]][[[[[[[[[[[]]]]]] [[[]]]] [[[[]]]]]] [[[[]]]]]]
2147483647=[[[[[[]]]]]] [[[[]]]] [[[[[]]]]] [[[[]]]][[[[]]] [[[[]]]]] [[[[[]]]]][[[[[[[[[[[]]]]]]] [[[[]]]]]]]] [[[[]]]][[[[[[[[[[[[[[[]]]]] [[[[]]]]]]]]]]] [[[[]]]]]] [[[[[]]]]]]
1449565302=[[[[[[[[[]]]] [[[]]]]]] [[[]]]]] [[[[[[[[]]]] [[[[[]]]]]]]]][[[[[]]] [[[[]]]]] [[[[]]]] [[[]]]] [[[[]]]][[[[[[[[[[[]]]]] [[[[]]]] [[[[]]]]]]] [[[[[]]]]]]]]
1746268229=[[[[[[[]]]]]]] [[[[]]]] [[[[]]] [[[[[[[[]]]]]]]]][[[[]]]] [[[]]] [[[[[[]]]]]][[[[[[[[[[]]]] [[[]]]] [[[]]]] [[[]]]]] [[[[[]]]]]]]
126528612=[[[[[[]]]] [[[[[[]]]]]]]] [[[[[]]]]][[[[[[[]]]]]]] [[[[[[[[]]]]]]]][[[[[[[[[]]]]]] [[[]]]] [[[[[]]]]]]] [[[[[]]]]]
778085967=[[[[[[[[[]]]] [[[[[]]]]]]]]]] [[[[[[]]]]]] [[[]]][[[[[[[]]]]] [[[[]]]]]] [[[[]]]][[[[[[[]]]] [[[[[]]]]]]] [[[]]]] [[[[[]]]]]
1553783038=[[[[[]]] [[[[[[[[]]]]]]]]]] [[[[[[[]]]] [[[]]]]]][[[[[]]] [[[[]]]]]] [[[[[]]]]][[[[[[[[[]]]] [[[]]]] [[[]]]]]] [[[]]]] [[[[]]]][[[[[[[[]]] [[[[[[]]]]]]]] [[[[[[[]]]]]]]]]]
997599288=[[[[[]]]] [[[]]] [[[[[[]]]]]]] [[[[[[[[]]]]] [[[[]]]]]]][[[[[[[[]]]]]] [[[[[]]]]]]] [[[[[[]]]]]][[[[[[[[[[]]]] [[[]]]]]]] [[[]]]] [[[[[[]]]]]]]
7944b per 1-256
1275b per i casi grandi