結果

問題 No.172 UFOを捕まえろ
ユーザー thglaflsthglafls
提出日時 2023-04-30 12:16:20
言語 F#
(F# 4.0)
結果
AC  
実行時間 342 ms / 5,000 ms
コード長 357 bytes
コンパイル時間 14,684 ms
コンパイル使用メモリ 192,420 KB
実行使用メモリ 34,844 KB
最終ジャッジ日時 2024-04-29 20:45:15
合計ジャッジ時間 19,243 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 336 ms
34,712 KB
testcase_01 AC 337 ms
34,844 KB
testcase_02 AC 333 ms
34,280 KB
testcase_03 AC 341 ms
34,064 KB
testcase_04 AC 336 ms
34,708 KB
testcase_05 AC 338 ms
33,936 KB
testcase_06 AC 339 ms
34,584 KB
testcase_07 AC 335 ms
34,584 KB
testcase_08 AC 338 ms
34,500 KB
testcase_09 AC 338 ms
33,936 KB
testcase_10 AC 339 ms
34,580 KB
testcase_11 AC 335 ms
34,664 KB
testcase_12 AC 339 ms
34,064 KB
testcase_13 AC 338 ms
33,932 KB
testcase_14 AC 336 ms
34,196 KB
testcase_15 AC 332 ms
34,064 KB
testcase_16 AC 329 ms
34,604 KB
testcase_17 AC 342 ms
34,712 KB
testcase_18 AC 333 ms
34,840 KB
testcase_19 AC 328 ms
34,064 KB
testcase_20 AC 334 ms
34,060 KB
testcase_21 AC 330 ms
34,840 KB
testcase_22 AC 331 ms
34,280 KB
testcase_23 AC 333 ms
33,936 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (323 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