Submit Info #15497

Problem Lang User Status Time Memory
Montmort Number cpp14 Tweetuzki AC 96 ms 13.80 MiB

ケース詳細
Name Status Time Memory
example_00 AC 1 ms 0.72 MiB
example_01 AC 0 ms 0.68 MiB
max_00 AC 96 ms 13.32 MiB
max_01 AC 92 ms 13.55 MiB
max_02 AC 88 ms 13.80 MiB
random_00 AC 36 ms 5.55 MiB
random_01 AC 45 ms 6.34 MiB
random_02 AC 52 ms 8.17 MiB
random_03 AC 39 ms 6.17 MiB
random_04 AC 72 ms 11.05 MiB

#include <cstdio> const int MaxN = 1000000; int N, Mod; int F[MaxN + 5]; void solve() { F[0] = 0, F[1] = 1; for (int i = 2; i <= N; ++i) F[i] = 1LL * (F[i - 1] + F[i - 2]) * i % Mod; for (int i = 0; i < N; ++i) printf("%d%c", F[i], " \n"[i == N - 1]); } int main() { scanf("%d %d", &N, &Mod); solve(); return 0; }