You are viewing a single comment's thread. Return to all comments →
Best I can come up with at 3 am. (Python3)
from functools import reduce MOD = 1_000_000_007 def _value_of_S_reduce(x:int,y:int)->int: return (x+y+x*y) % MOD def value_of_S(l:list)->int: return reduce(_value_of_S_reduce,l) if __name__=='__main__': _ = input() print(value_of_S(list(map(int,input().split()))))
Seems like cookies are disabled on this browser, please enable them to open this website
Tell the Average
You are viewing a single comment's thread. Return to all comments →
Best I can come up with at 3 am.
(Python3)