Submit Info #6268

Problem Lang User Status Time Memory
Montmort Number python3 Samothrake AC 615 ms 59.83 MiB

ケース詳細
Name Status Time Memory
example_00 AC 16 ms 3.96 MiB
example_01 AC 14 ms 3.87 MiB
max_00 AC 615 ms 59.45 MiB
max_01 AC 592 ms 59.55 MiB
max_02 AC 581 ms 59.83 MiB
random_00 AC 251 ms 25.64 MiB
random_01 AC 282 ms 29.61 MiB
random_02 AC 361 ms 36.25 MiB
random_03 AC 265 ms 28.02 MiB
random_04 AC 471 ms 48.68 MiB

N,mod = map(int, open(0).read().split()) mont = [0]*(N+1) mont[2] = 1 for n in range(3,N+1): mont[n] = (n-1)*(mont[n-1] + mont[n-2]) % mod print(*mont[1:])