結果

問題 No.105 arcの六角ボルト
ユーザー むらためむらため
提出日時 2019-01-29 03:15:28
言語 Nim
(2.0.2)
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 874 bytes
コンパイル時間 2,499 ms
コンパイル使用メモリ 66,068 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-14 03:10:28
合計ジャッジ時間 2,998 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
/home/judge/data/code/Main.nim(1, 17) Warning: imported and not used: 'algorithm' [UnusedImport]
/home/judge/data/code/Main.nim(1, 32) Warning: imported and not used: 'strutils' [UnusedImport]

ソースコード

diff #

import sequtils,algorithm,math,strutils
template times*(n:int,body) = (for _ in 0..<n: body)
template `min=`*(x,y) = x = min(x,y)
proc scanf(formatstr: cstring){.header: "<stdio.h>", varargs.}
proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc printf(formatstr: cstring){.header: "<stdio.h>", varargs.}
proc scan(): int =
  while true:
    let k = getchar_unlocked()
    if k < '0': return
    result = 10 * result + k.ord - '0'.ord
proc printFloat(f:float) =
  if f < 1e-8: printf("0.0\n")
  else: printf("%f\n", f)


scan().times:
  discard getchar_unlocked()
  var x,y:float
  var xMin = 500.0
  var yMin : float
  for i in 0..<6:
    scanf("%lf %lf\n",addr x,addr y)
    if x < xMin :
      xMin = x
      yMin = y
  const toRad = 1.0 / PI * 180.0
  let tMin = -(arctan2(xMin,yMin) * toRad + 30.0) mod 59.9999999999
  printFloat(tMin)
0