Skip to main content
added 903 characters in body
Source Link

Python 3Python 3, 238 bytes, 227 bytes, 224 bytes, 216 bytes

from functools import*
from itertools import*
r=range;n=len;s=sum
f=lambda l:s(reduce(lambda p,m:p*m,[l[a][b]for a,b in zip(r(n(l)),j)])*(-1)**s(s(y<j[x]for y in j[x:])for x in r(n(l)))for j in permutations(r(n(l))))
from functools import*
from itertools import*
r=range;n=len;s=sum
f=lambda l:s(reduce(lambda p,m:p*m,[l[a][b]for a,b in zip(r(n(l)),j)])*(-1)**s(s(y<j[x]for y in j[x:])for x in r(n(l)))for j in permutations(r(n(l))))

Try it online!Try it online!

My solution uses the definition of a determinant for calculations. Unfortunately, the complexity of this algorithm is n! and I can not show the passage of the last test, but in theory this is possible.

Python 3, 238 bytes, 227 bytes, 224 bytes, 216 bytes

from functools import*
from itertools import*
r=range;n=len;s=sum
f=lambda l:s(reduce(lambda p,m:p*m,[l[a][b]for a,b in zip(r(n(l)),j)])*(-1)**s(s(y<j[x]for y in j[x:])for x in r(n(l)))for j in permutations(r(n(l))))

Try it online!

My solution uses the definition of a determinant for calculations. Unfortunately, the complexity of this algorithm is n! and I can not show the passage of the last test, but in theory this is possible.

Python 3, 238 bytes, 227 bytes, 224 bytes, 216 bytes

from functools import*
from itertools import*
r=range;n=len;s=sum
f=lambda l:s(reduce(lambda p,m:p*m,[l[a][b]for a,b in zip(r(n(l)),j)])*(-1)**s(s(y<j[x]for y in j[x:])for x in r(n(l)))for j in permutations(r(n(l))))

Try it online!

My solution uses the definition of a determinant for calculations. Unfortunately, the complexity of this algorithm is n! and I can not show the passage of the last test, but in theory this is possible.

added 19 characters in body
Source Link

Python 3, 238 bytes, 227 bytes, 224 bytes, 224216 bytes

from functools import*
from itertools import*
r=range;n=len;s=sum
f=lambda l:sums(reduce(lambda p,m:p*m,[l[a][b]for a,b in zip(ranger(lenn(l)),j)])*(-1)**(sum(**s(sums(y<j[x]for y in j[x:])for x in ranger(lenn(l)))))for j in permutations(ranger(lenn(l))))

Try it online!

My solution uses the definition of a determinant for calculations. Unfortunately, the complexity of this algorithm is n! and I can not show the passage of the last test, but in theory this is possible.

Python 3, 238 bytes, 227 bytes, 224 bytes

from functools import*
from itertools import*
f=lambda l:sum(reduce(lambda p,m:p*m,[l[a][b]for a,b in zip(range(len(l)),j)])*(-1)**(sum((sum(y<j[x]for y in j[x:])for x in range(len(l)))))for j in permutations(range(len(l))))

Try it online!

My solution uses the definition of a determinant for calculations. Unfortunately, the complexity of this algorithm is n! and I can not show the passage of the last test, but in theory this is possible.

Python 3, 238 bytes, 227 bytes, 224 bytes, 216 bytes

from functools import*
from itertools import*
r=range;n=len;s=sum
f=lambda l:s(reduce(lambda p,m:p*m,[l[a][b]for a,b in zip(r(n(l)),j)])*(-1)**s(s(y<j[x]for y in j[x:])for x in r(n(l)))for j in permutations(r(n(l))))

Try it online!

My solution uses the definition of a determinant for calculations. Unfortunately, the complexity of this algorithm is n! and I can not show the passage of the last test, but in theory this is possible.

added 268 characters in body
Source Link

Python 3, 238 bytes, 227 bytes, 238224 bytes

from operator import*
from functools import*
from itertools import*
f=lambda l:sum(reduce(mul,[l[a][b]lambda forp,m:p*m,[l[a][b]for a,b in zip(range(len(l)),j)])*(-1)**(sum((sum(y<j[x]for y in j[x:]) for x in range(len(l))))) for j in permutations(range(len(l))))

Try it online!

My solution uses the definition of a determinant for calculations. Unfortunately, the complexity of this algorithm is n! and I can not show the passage of the last test, but in theory this is possible.

Python 3, 238 bytes

from operator import*
from functools import*
from itertools import*
f=lambda l:sum(reduce(mul,[l[a][b] for a,b in zip(range(len(l)),j)])*(-1)**(sum((sum(y<j[x]for y in j[x:]) for x in range(len(l))))) for j in permutations(range(len(l))))

Try it online!

My solution uses the definition of a determinant for calculations. Unfortunately, the complexity of this algorithm is n! and I can not show the passage of the last test, but in theory this is possible.

Python 3, 238 bytes, 227 bytes, 224 bytes

from functools import*
from itertools import*
f=lambda l:sum(reduce(lambda p,m:p*m,[l[a][b]for a,b in zip(range(len(l)),j)])*(-1)**(sum((sum(y<j[x]for y in j[x:])for x in range(len(l)))))for j in permutations(range(len(l))))

Try it online!

My solution uses the definition of a determinant for calculations. Unfortunately, the complexity of this algorithm is n! and I can not show the passage of the last test, but in theory this is possible.

added 268 characters in body
Source Link
Loading
Source Link
Loading