Created
July 7, 2021 12:22
-
-
Save recuraki/15aa7fe990a616cee528435389448ddf to your computer and use it in GitHub Desktop.
負荷をかけます
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from multiprocessing import Pool | |
multi = 10 | |
N = 10**4 | |
mod = 10**9 + 7 | |
def f(x): | |
data = [x] * N | |
for i in range(N): | |
for j in range(N): | |
for k in range(N): | |
data[i] += data[j] + data[k] | |
data[i] %= mod | |
return sum(data) % mod | |
if __name__ == '__main__': | |
with Pool(multi) as p: | |
print(p.map(f, list(range(multi)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment