Submit | All submissions | Best solutions | Back to list |
EQUASOLV - Solving linear equations |
Solve a system of N (1<N<7) linear equations of the form a1*x1+a2*x2+...+aN*xN=c. ai and c are real numbers. A unique solution is assured.
Input
First line with number N, then N lines with a1, a2,...aN, c separated by space.
Output
The results for x1, x2,...xN one in each line. The floats should have a precision of 5 digits after the decimal-point.
Example
Input: 2 1 2 3 2 3 4 Output: -1.00000 2.00000
Added by: | HWK |
Date: | 2011-02-28 |
Time limit: | 3.636s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: SCM qobi |
hide comments
|
|||||
2011-10-03 12:29:25 Jander
138 now :-) I'll let you off my hint allegation then if the Ruby one is different ;-) It certainly motivated me. Dropping 40 bytes since last night is quite an improvement. |
|||||
2011-10-03 12:27:06 HWK
I didn't take hints from your solution. The Ruby one is completely different to your one. But seems you need more motivation: 139 bytes - incredible. |
|||||
2011-10-03 11:36:53 Jander
Oi! Stop taking hints from my Perl to improve your Ruby ;-) |
|||||
2011-10-03 07:17:42 HWK
@Jander: Awesome job! Congratulations! |
|||||
2011-10-02 21:09:48 Jander
@HWK: Thanks - I took a gamble anyway that they were !=0. I'm sure I can squeeze it some more, but that can wait until tomorrow :-) |
|||||
2011-10-02 16:09:50 HWK
@Jander: Xi are real numbers with |Xi|<10 and all !=0. Last edit: 2011-10-02 16:16:25 |
|||||
2011-09-30 18:05:11 Jander
What's the range for Xn ? Also are all Ai qualified, ie no Xn=0 ? Last edit: 2011-09-30 18:26:11 |
|||||
2011-03-21 11:52:43 HWK
No, my Python-solution takes 283 bytes. :-( I wrote it with Ruby. Probably a Ruby-expert could still save a lot of bytes. |
|||||
2011-03-20 23:02:15 Hallvard Norheim Bø
HWK: 190 bytes in which language? Python? :-) |