結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
4,380 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': break
    result = 10 * result + k.ord - '0'.ord
proc printFloat(f:float) =
  if f < 1e-8: printf("0.0\n")
  else: printf("%.9f\n", f)

var x,y:float

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