結果
問題 |
No.2396 等差二項展開
|
ユーザー |
![]() |
提出日時 | 2023-07-28 22:02:07 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 299 bytes |
コンパイル時間 | 221 ms |
コンパイル使用メモリ | 82,300 KB |
実行使用メモリ | 76,428 KB |
最終ジャッジ日時 | 2024-10-06 18:50:58 |
合計ジャッジ時間 | 11,135 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 20 |
ソースコード
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])