結果

問題 No.172 UFOを捕まえろ
ユーザー toshiro_yanagi
提出日時 2018-06-10 12:05:34
言語 Nim
(2.2.0)
結果
WA  
実行時間 -
コード長 312 bytes
コンパイル時間 3,513 ms
コンパイル使用メモリ 66,288 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-30 13:14:10
合計ジャッジ時間 4,338 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils, math

let
  t = stdin.readLine.split.map parseInt
  (x, y, r) = (t[0], t[1], t[2])

  r0 = (x ^ 2 + y ^ 2).float.sqrt
  dis = r0 + r.float


if r0 != 0.0:
  let ang = arccos(x.float / r0)
  echo (dis * (ang.sin.abs + ang.cos.abs)).ceil.int
else:
  echo (r.float * (2.0).sqrt).ceil.int
0