結果

問題 No.105 arcの六角ボルト
ユーザー yukirinyukirin
提出日時 2016-03-03 00:03:32
言語 Go
(1.22.1)
結果
AC  
実行時間 30 ms / 5,000 ms
コード長 814 bytes
コンパイル時間 10,917 ms
コンパイル使用メモリ 211,768 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-01 07:06:36
合計ジャッジ時間 11,434 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func main() {
	sc.Split(bufio.ScanWords)
	t := nextInt()

	for i := 0; i < t; i++ {
		for j := 0; j < 6; j++ {
			x, y := nextFloat(), nextFloat()
			x, y = float64(int(x*1e12)), float64(int(y*1e12))
			x, y = x/1e12, y/1e12

			angleX := math.Acos(x) * 180 / math.Pi
			angleY := math.Asin(y) * 180 / math.Pi
			if angleX-angleY < 1 && angleX < 50 {
				if 1e-4 > angleX {
					fmt.Println(0)
					continue
				}
				fmt.Println(angleX)
			}
		}
	}
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextLine())
	return i
}

func nextFloat() float64 {
	f, _ := strconv.ParseFloat(nextLine(), 64)
	return f
}
0