結果
問題 | No.2461 一点張り |
ユーザー |
![]() |
提出日時 | 2024-11-13 19:49:03 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 383 bytes |
コンパイル時間 | 11,808 ms |
コンパイル使用メモリ | 239,828 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-13 19:49:16 |
合計ジャッジ時間 | 12,718 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 7 |
ソースコード
package main import . "fmt" func main() { var t int Scan(&t) for ;t>0;t-- { p,k:=0.0,0 Scan(&p,&k) if k==1 { Println(1) continue } if p==0 { Println(k) continue } else if p==1 { Println(1) continue } r:=1-p g:=r s:=p for i:=2;i<k;i++ { z:=float64(i)*g*p s+=z g*=r } s+=float64(k)*g Printf("%.10f\n",s) } }