結果

問題 No.105 arcの六角ボルト
ユーザー aru aru
提出日時 2020-08-09 11:20:22
言語 Go
(1.23.4)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 1,469 bytes
コンパイル時間 10,101 ms
コンパイル使用メモリ 243,808 KB
実行使用メモリ 6,816 KB
最終ジャッジ日時 2024-10-04 06:08:35
合計ジャッジ時間 10,582 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

package main
import (
"bufio"
"fmt"
"math"
"os"
"sort"
"strconv"
)
func out(x ...interface{}) {
fmt.Println(x...)
}
var sc = bufio.NewScanner(os.Stdin)
func getInt() int {
sc.Scan()
i, e := strconv.Atoi(sc.Text())
if e != nil {
panic(e)
}
return i
}
func getInts(N int) []int {
ret := make([]int, N)
for i := 0; i < N; i++ {
ret[i] = getInt()
}
return ret
}
func getString() string {
sc.Scan()
return sc.Text()
}
// min, max, asub, abs
func max(a, b int) int {
if a > b {
return a
}
return b
}
func min(a, b int) int {
if a < b {
return a
}
return b
}
func asub(a, b int) int {
if a > b {
return a - b
}
return b - a
}
func abs(a int) int {
if a >= 0 {
return a
}
return -a
}
func lowerBound(a []int, x int) int {
idx := sort.Search(len(a), func(i int) bool {
return a[i] >= x
})
return idx
}
func upperBound(a []int, x int) int {
idx := sort.Search(len(a), func(i int) bool {
return a[i] > x
})
return idx
}
func getFloat() float64 {
sc.Scan()
ret, _ := strconv.ParseFloat(sc.Text(), 64)
return ret
}
func main() {
sc.Split(bufio.ScanWords)
T := getInt()
for i := 0; i < T; i++ {
ans := 1e10
for j := 0; j < 6; j++ {
x, y := getFloat(), getFloat()
// deg := 180 * math.Atan2(y, x) / math.Pi
// if deg >= 0 && deg <= 50 {
// out(deg)
th := math.Atan2(y, x)
if th < -1e-9 {
continue
}
ans = math.Min(ans, th)
}
out(ans * 180 / math.Pi)
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0