結果
問題 |
No.419 直角三角形
|
ユーザー |
![]() |
提出日時 | 2016-09-09 23:48:53 |
言語 | Go (1.23.4) |
結果 |
WA
|
実行時間 | - |
コード長 | 507 bytes |
コンパイル時間 | 16,833 ms |
コンパイル使用メモリ | 228,652 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-16 18:46:40 |
合計ジャッジ時間 | 13,144 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 3 |
ソースコード
package main import ( "bufio" "fmt" "os" "strconv" "strings" "math" ) func main() { scanner := bufio.NewScanner(os.Stdin) holder := []float64{} th := 0 for scanner.Scan() { th += 1 text := scanner.Text() for _, x2 := range strings.Split(text, " ") { x3, e := strconv.ParseFloat(x2, 64) _ = e holder = append(holder, x3) } if th == 1 { break } } a, b := holder[0], holder[1] fmt.Printf("%10.20f", math.Pow(math.Abs(math.Pow(a, 2) - math.Pow(b, 2)), 0.5) ) fmt.Println() }