結果
問題 | No.2461 一点張り |
ユーザー |
![]() |
提出日時 | 2024-11-13 19:38:55 |
言語 | Go (1.22.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 522 bytes |
コンパイル時間 | 12,005 ms |
コンパイル使用メモリ | 224,384 KB |
実行使用メモリ | 12,964 KB |
最終ジャッジ日時 | 2024-11-13 19:39:13 |
合計ジャッジ時間 | 16,027 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 109 ms
8,260 KB |
testcase_01 | TLE | - |
testcase_02 | -- | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
ソースコード
package main import . "fmt" import . "math/big" func main() { var t int Scan(&t) for ;t>0;t-- { p,k:=new(Rat),0 Scan(p,&k) if k==1 { Println(1) continue } if p.IsInt() { if p.Sign()==0 { Println(k) } else { Println(1) } continue } r:=new(Rat).Sub(NewRat(1,1),p) g:=new(Rat).Set(r) s:=new(Rat).Set(p) for i:=2;i<k;i++ { z:=NewRat(int64(i),1) z.Mul(z,g).Mul(z,p) s.Add(s,z) g.Mul(g,r) } s.Add(s,g.Mul(g,NewRat(int64(k),1))) Println(s.FloatString(10)) } }