結果

問題 No.172 UFOを捕まえろ
ユーザー thglafls
提出日時 2023-04-30 12:16:20
言語 F#
(F# 4.0)
結果
AC  
実行時間 349 ms / 5,000 ms
コード長 357 bytes
コンパイル時間 16,167 ms
コンパイル使用メモリ 192,700 KB
実行使用メモリ 34,796 KB
最終ジャッジ日時 2024-11-19 04:00:58
合計ジャッジ時間 17,250 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (377 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

let calc x y r =
    let a = x + y
    let list = [ a .. (min (3 * (x + y + r) / 2) 342) ]

    (List.filter (fun i -> 2 * r * r - (x + y - i) * (x + y - i) < 0) list).[0]


let main =
    let input = stdin.ReadLine().Split() |> Array.map int
    let x = input.[0]
    let y = input.[1]
    let r = input.[2]

    printf "%d\n" (calc (abs (x)) (abs (y)) r)
0