結果
問題 |
No.3151 natural math of inscribed circle
|
ユーザー |
![]() |
提出日時 | 2025-06-09 02:19:04 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 477 bytes |
コンパイル時間 | 17,573 ms |
コンパイル使用メモリ | 235,852 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-06-20 03:05:00 |
合計ジャッジ時間 | 18,870 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 41 |
ソースコード
package main import . "fmt" import . "math/big" func main() { a,b,c:=new(Int),new(Int),new(Int) Scan(a,b,c) d := NewInt(1e12) a.Mul(a,d) b.Mul(b,d) c.Mul(c,d) t := new(Int).Add(a, b) t.Add(t, c) r := new(Int).Sub(t, new(Int).Mul(a, NewInt(2))) r.Mul(r, new(Int).Sub(t, new(Int).Mul(b, NewInt(2)))) r.Mul(r, new(Int).Sub(t, new(Int).Mul(c, NewInt(2)))) r.Div(r, new(Int).Mul(t, NewInt(4))) r.Sqrt(r) ans := new(Rat).SetFrac(r, d).FloatString(20) Println(ans) }