Submit Info #2258

Problem Lang User Status Time Memory
Montmort Number pypy3 onakasuitacity AC 267 ms 75.71 MiB

ケース詳細
Name Status Time Memory
example_00 AC 31 ms 25.38 MiB
example_01 AC 32 ms 25.38 MiB
max_00 AC 267 ms 75.66 MiB
max_01 AC 266 ms 75.60 MiB
max_02 AC 257 ms 75.71 MiB
random_00 AC 136 ms 47.45 MiB
random_01 AC 146 ms 50.95 MiB
random_02 AC 175 ms 56.30 MiB
random_03 AC 140 ms 49.06 MiB
random_04 AC 223 ms 66.34 MiB

import sys sys.setrecursionlimit(2147483647) INF=float("inf") MOD=10**9+7 # 998244353 input=lambda:sys.stdin.readline().rstrip() def resolve(): n,m=map(int,input().split()) dp=[None]*n dp[0]=0 dp[1]=1 for i in range(2,n): dp[i]=i*(dp[i-1]+dp[i-2]) dp[i]%=m print(*dp) resolve()