結果

問題 No.105 arcの六角ボルト
ユーザー むらためむらため
提出日時 2019-01-27 09:39:33
言語 Nim
(2.0.2)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 718 bytes
コンパイル時間 3,535 ms
コンパイル使用メモリ 74,168 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-14 03:05:03
合計ジャッジ時間 4,215 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import sequtils,algorithm,math,strutils
template times*(n:int,body) = (for _ in 0..<n: body)
template `max=`*(x,y) = x = max(x,y)
template `min=`*(x,y) = x = min(x,y)

proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc scan(): int =
  while true:
    let k = getchar_unlocked()
    if k < '0': break
    result = 10 * result + k.ord - '0'.ord
proc printFloat(f:float) =
  if f < 1e-8: echo 0.0
  else: echo f
scan().times:
  discard stdin.readLine()
  let XY = newSeqWith(6,stdin.readLine().split().map(parseFloat))
  let T = XY.mapIt(arctan2(it[0],it[1]) / PI * 180.0).sorted(cmp)
  if T[0] < -150.0:  printFloat( -T[0] - 150.0)
  else: printFloat((210.0-T[^1]) mod 59.9999999999)
0