結果
問題 | No.155 生放送とBGM |
ユーザー |
![]() |
提出日時 | 2021-09-24 21:21:01 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 761 bytes |
コンパイル時間 | 147 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 24,960 KB |
最終ジャッジ日時 | 2024-07-05 09:53:53 |
合計ジャッジ時間 | 14,590 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 14 |
ソースコード
import mathimport sysreadline=sys.stdin.readlineN,L=map(int,readline().split())L*=60S=[]for s in readline().split():mm,ss=map(int,s.split(":"))S.append(mm*60+ss)dp=[[0]*18001 for i in range(N+1)]dp[0][0]=1ans=0S_sum=sum(S)if L>=S_sum:ans=Nelse:for s in S:for i in range(N,0,-1):for j in range(18000,s-1,-1):dp[i][j]+=dp[i-1][j-s]for s in S:dp_=[[dp[i][j] for j in range(18001)] for i in range(N+1)]for i in range(1,N+1):for j in range(s,18001):dp_[i][j]-=dp_[i-1][j-s]for i in range(N):for j in range(L):ans+=math.factorial(i)*dp_[i][j]*math.factorial(N-i-1)ans/=math.factorial(N)print(ans)