結果
問題 |
No.2396 等差二項展開
|
ユーザー |
![]() |
提出日時 | 2023-07-28 22:01:38 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 298 bytes |
コンパイル時間 | 258 ms |
コンパイル使用メモリ | 81,960 KB |
実行使用メモリ | 76,820 KB |
最終ジャッジ日時 | 2024-10-06 18:49:49 |
合計ジャッジ時間 | 23,179 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 WA * 22 |
ソースコード
def f(a,b): c=[0]*L for i in range(L): for j in range(L): c[(i+j)%L]+=a[i]*b[j] c[(i+j)%L]%=mod return c N,M,L,K,mod=map(int,input().split()) ans=[0]*L ans[0]=1 tmp=[0]*L tmp[0]=1 tmp[1%L]=M for i in range(60): if (N>i)&1: ans=f(ans,tmp) tmp=f(tmp,tmp) print(ans[K])