Submit Info #11794

Problem Lang User Status Time Memory
Montmort Number pypy3 toyuzuko AC 279 ms 110.13 MiB

ケース詳細
Name Status Time Memory
example_00 AC 32 ms 25.33 MiB
example_01 AC 32 ms 25.40 MiB
max_00 AC 279 ms 110.13 MiB
max_01 AC 273 ms 110.09 MiB
max_02 AC 275 ms 110.08 MiB
random_00 AC 141 ms 60.21 MiB
random_01 AC 160 ms 64.63 MiB
random_02 AC 194 ms 74.08 MiB
random_03 AC 165 ms 64.00 MiB
random_04 AC 251 ms 93.14 MiB

def monmort(n, mod): res = [0 for _ in range(n)] res[0] = 0 res[1] = 1 for i in range(2, n): res[i] = i * (res[i - 1] + res[i - 2]) res[i] %= mod return(res) N, M = map(int, input().split()) print(*monmort(N, M))