結果

問題 No.172 UFOを捕まえろ
ユーザー yoza
提出日時 2015-03-26 23:57:27
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 299 bytes
コンパイル時間 4,316 ms
コンパイル使用メモリ 65,536 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-29 01:10:39
合計ジャッジ時間 5,130 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 28) Warning: imported and not used: 'algorithm' [UnusedImport]

ソースコード

diff #

import strutils, sequtils, algorithm, math

var
  xyr = readLine(stdin).split().map(parseFloat)
  maxLen = 0.0

for i in [1.0, -1.0]:
  for j in [1.0, -1.0]:
    maxLen = max(maxLen, abs(xyr[0] + i * xyr[2] * sqrt(2.0) / 2.0) + abs(xyr[1] + j * xyr[2] * sqrt(2.0) / 2.0))

echo(maxLen.ceil().toInt)
0