Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#Python 3, (削除) 134 (削除ここまで)(削除) 120 (削除ここまで) 117

Python 3, (削除) 134 (削除ここまで)(削除) 120 (削除ここまで) 117

Input: two comma-separated arrays separated by comma.

Example:

(2,3,7,11),(4,2,3,2)
21439600
from functools import*
a=eval(input())
print(reduce(int.__mul__,(sum(x**j for j in range(y+1))for x,y in zip(*a)),1))

With NumPy can be reduced to 100 bytes:

import numpy
a=eval(input())
print(numpy.product([sum(x**j for j in range(y+1))for x,y in zip(*a)]))

#Python 3, (削除) 134 (削除ここまで)(削除) 120 (削除ここまで) 117

Input: two comma-separated arrays separated by comma.

Example:

(2,3,7,11),(4,2,3,2)
21439600
from functools import*
a=eval(input())
print(reduce(int.__mul__,(sum(x**j for j in range(y+1))for x,y in zip(*a)),1))

With NumPy can be reduced to 100 bytes:

import numpy
a=eval(input())
print(numpy.product([sum(x**j for j in range(y+1))for x,y in zip(*a)]))

Python 3, (削除) 134 (削除ここまで)(削除) 120 (削除ここまで) 117

Input: two comma-separated arrays separated by comma.

Example:

(2,3,7,11),(4,2,3,2)
21439600
from functools import*
a=eval(input())
print(reduce(int.__mul__,(sum(x**j for j in range(y+1))for x,y in zip(*a)),1))

With NumPy can be reduced to 100 bytes:

import numpy
a=eval(input())
print(numpy.product([sum(x**j for j in range(y+1))for x,y in zip(*a)]))
added 15 characters in body
Source Link
Trang Oul
  • 770
  • 5
  • 18

#Python 3, (削除) 134 (削除ここまで) 120(削除) 120 (削除ここまで) 117

Input: two comma-separated arrays separated by comma.

Example:

(2,3,7,11),(4,2,3,2)
21439600
from functools import*
a,b=evala=eval(input())
print(reduce(int.__mul__,(sum(x**j for j in range(y+1))for x,y in zip(a,b*a)),1))

With NumPy can be reduced to 104100 bytes:

import numpy
a,b=evala=eval(input())
print(numpy.product([sum(x**j for j in range(y+1))for x,y in zip(a,b*a)]))

#Python 3, (削除) 134 (削除ここまで) 120

Input: two comma-separated arrays separated by comma.

Example:

(2,3,7,11),(4,2,3,2)
21439600
from functools import*
a,b=eval(input())
print(reduce(int.__mul__,(sum(x**j for j in range(y+1))for x,y in zip(a,b)),1))

With NumPy can be reduced to 104 bytes:

import numpy
a,b=eval(input())
print(numpy.product([sum(x**j for j in range(y+1))for x,y in zip(a,b)]))

#Python 3, (削除) 134 (削除ここまで) (削除) 120 (削除ここまで) 117

Input: two comma-separated arrays separated by comma.

Example:

(2,3,7,11),(4,2,3,2)
21439600
from functools import*
a=eval(input())
print(reduce(int.__mul__,(sum(x**j for j in range(y+1))for x,y in zip(*a)),1))

With NumPy can be reduced to 100 bytes:

import numpy
a=eval(input())
print(numpy.product([sum(x**j for j in range(y+1))for x,y in zip(*a)]))
deleted 1 character in body
Source Link
Trang Oul
  • 770
  • 5
  • 18

#Python 3, (削除) 134 (削除ここまで) 120

Input: two comma-separated arrays separated by comma.

Example:

(2,3,7,11),(4,2,3,2)
21439600
from functools import*
a,b=eval(input())
print(reduce(int.__mul__,(sum(x**j for j in range(y+1))for x,y in zip(a,b)),1))

With NumPy can be reduced to 104 bytes:

import numpy
a,b=eval(input())
print(numpy.product([sum(x**j for j in range(y+1))for x,y in zip(a,b)]))

#Python 3, (削除) 134 (削除ここまで) 120

Input: two comma-separated arrays separated by comma.

Example:

(2,3,7,11),(4,2,3,2)
21439600
from functools import*
a,b=eval(input())
print(reduce(int.__mul__,(sum(x**j for j in range(y+1))for x,y in zip(a,b)),1))

With NumPy can be reduced to 104 bytes:

import numpy
a,b=eval(input())
print(numpy.product([sum(x**j for j in range(y+1))for x,y in zip(a,b)]))

#Python 3, (削除) 134 (削除ここまで) 120

Input: two comma-separated arrays separated by comma.

Example:

(2,3,7,11),(4,2,3,2)
21439600
from functools import*
a,b=eval(input())
print(reduce(int.__mul__,(sum(x**j for j in range(y+1))for x,y in zip(a,b)),1))

With NumPy can be reduced to 104 bytes:

import numpy
a,b=eval(input())
print(numpy.product([sum(x**j for j in range(y+1))for x,y in zip(a,b)]))
without 'operator'
Source Link
Trang Oul
  • 770
  • 5
  • 18
Loading
Source Link
Trang Oul
  • 770
  • 5
  • 18
Loading

AltStyle によって変換されたページ (->オリジナル) /