結果

問題 No.410 出会い
ユーザー 💕💖💞💕💖💞
提出日時 2016-09-09 00:13:12
言語 Go
(1.22.1)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 744 bytes
コンパイル時間 12,537 ms
コンパイル使用メモリ 212,480 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-10 20:08:34
合計ジャッジ時間 13,602 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,384 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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
	  pair := []float64{}
		text := scanner.Text()
		if text == "" { break }
	  for i, x2 := range strings.Split(text, " ") {
			x3, e := strconv.ParseFloat(x2, 64)
			_ = e
			_ = i
			pair = append(pair, x3)
		}
		holder = append(holder, pair)
		if th == 2 { break }
	}
	x, y := math.Abs(holder[0][0] - holder[1][0]), math.Abs(holder[0][1] - holder[1][1])
	//distance := math.Sqrt( math.Pow((holder[0][0] - holder[1][0]),2) + math.Pow((holder[0][1] - holder[1][1]),2) )/2
	//fmt.Println(holder)
	fmt.Println( (x + y)/2 )
	//fmt.Println(distance)
}
0