Shortest Program to Sort a List of numbers into Odd and Even Category

ES6, (48 - 32) = 16 (1 - 32) = -31

Original version:

f=l=>(e=o=0)+l.map(x=>x%2?e+=x:o+=x)&&Math.hypot(e,o)

Entire function definition is 53 characters, body only is 48.

Updated version, taking full advantage of the problem definition and moving pretty much everything out of the body and into the signature:

f=(l,e=0,o=0,g=x=>x%2?e+=x:o+=x,c=l.map(g)&&Math.hypot(e,o))=>c

New function definition is now 63 "punches" total, but function BODY is now just ONE DAMN CHARACTER LONG. Plus it no longer corrupts the global namespace! :D

Usage:

>>> f([20, 9, 4, 5, 5, 5, 15, 17, 20, 9])
78.49203781276161

R, (24 − 32) = −8

f=function(x)
    sum(by(x,x%%2,sum)^2)^.5  

The function body consists of 24 characters.

Usage:

f(c(20, 9, 4, 5, 5, 5, 15, 17, 20, 9))
[1] 78.49204

J, 18 17 chars - 32 = ⁻15

[:+/&.:*:2&|+//.]

(As a "function body"; has to be parenthesized or bound to a name.)

Explanation

I tried making an exploded view of what each piece does, like Tobia does in APL answers.

               +//. ]    NB. sum up partitions
           2&|           NB.   given by equality on (x mod 2)
        *:               NB. square,
   +/                    NB. sum,
     &.:                 NB. then revert the squaring (square-root)
                         NB. (f&.:g in general acts like g⁻¹(f(g(x))))
[:                       NB. (syntax to indicate composition of +/&.:*: and (2&| +//. ]))

+/&.:*: could be replaced with |@j./ making use of O-I's complex magnitude trick to save yet another two characters.

Example

   f =: [:+/&.:*:2&|+//.]
   f 20 9 4 5 5 5 15 17 20 9
78.492