# grrr, 圧倒的にPythonに不利な設定ですね!def primegen(maximum): v = range(2, maximum) while v: p = v[0] v = filter(int(p).__rmod__, v) yield p
Re:キミならどう書く 2.0 - ROUND 1 -
# grrr, 圧倒的にPythonに不利な設定ですね!
def primegen(maximum):
v = range(2, maximum)
while v:
p = v[0]
v = filter(int(p).__rmod__, v)
yield p