File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ import cmath
2+
3+ coeffs = [
4+ [832 , - 112 , 1 ],
5+ [888 , - 119 , 1 ],
6+ [721 , - 110 , 1 ],
7+ [294 , - 101 , 1 ],
8+ [736 , - 100 , 1 ],
9+ [812 , - 123 , 1 ],
10+ [637 , - 98 , 1 ],
11+ [147 , - 52 , 1 ],
12+ [644 , - 99 , 1 ],
13+ [882 , - 107 , 1 ],
14+ [534 , - 95 , 1 ],
15+ [115 , - 116 , 1 ],
16+ [47 , - 48 , 1 ],
17+ [774 , - 95 , 1 ],
18+ [303 , - 104 , 1 ],
19+ [138 , - 49 , 1 ],
20+ [300 , - 103 , 1 ],
21+ [855 , - 104 , 1 ],
22+ [94 , - 95 , 1 ],
23+ [336 , - 115 , 1 ],
24+ [288 , - 99 , 1 ],
25+ [495 , - 104 , 1 ],
26+ [47 , - 48 , 1 ],
27+ [351 , - 48 , 1 ],
28+ [107 , - 108 , 1 ],
29+ [364 , - 95 , 1 ],
30+ [392 , - 57 , 1 ],
31+ [320 , - 48 , 1 ],
32+ [336 , - 55 , 1 ],
33+ [552 , - 98 , 1 ],
34+ [360 , - 49 , 1 ],
35+ [220 , - 49 , 1 ],
36+ [388 , - 101 , 1 ],
37+ [329 , - 54 , 1 ],
38+ [366 , - 125 , 1 ],
39+ ]
40+
41+ sols = []
42+
43+ for cs in coeffs :
44+ d = (cs [1 ]** 2 ) - (4 * cs [0 ]* cs [2 ])
45+ sol1 = (- cs [1 ] - cmath .sqrt (d ))/ (2 * cs [0 ])
46+ sol2 = (- cs [1 ] + cmath .sqrt (d ))/ (2 * cs [0 ])
47+ sols .append ([sol1 , sol2 , sol1 + sol2 ])
48+
49+ print (sols )
50+
51+ sums = [sol [2 ] for sol in sols ]
52+
53+ print (sums )
54+
55+ # chars = ''.join([chr(sum) for sum in sums])
You can’t perform that action at this time.
0 commit comments