結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 293 ms
34,856 KB
testcase_01 AC 299 ms
33,920 KB
testcase_02 AC 296 ms
34,728 KB
testcase_03 AC 327 ms
34,728 KB
testcase_04 AC 319 ms
34,464 KB
testcase_05 AC 315 ms
34,816 KB
testcase_06 AC 307 ms
33,932 KB
testcase_07 AC 300 ms
33,932 KB
testcase_08 AC 297 ms
34,844 KB
testcase_09 AC 300 ms
34,188 KB
testcase_10 AC 301 ms
34,824 KB
testcase_11 AC 295 ms
34,056 KB
testcase_12 AC 293 ms
33,772 KB
testcase_13 AC 293 ms
33,804 KB
testcase_14 AC 305 ms
33,924 KB
testcase_15 AC 299 ms
33,852 KB
testcase_16 AC 295 ms
34,732 KB
testcase_17 AC 296 ms
34,208 KB
testcase_18 AC 297 ms
34,188 KB
testcase_19 AC 297 ms
33,908 KB
testcase_20 AC 297 ms
33,804 KB
testcase_21 AC 329 ms
34,064 KB
testcase_22 AC 302 ms
34,348 KB
testcase_23 AC 307 ms
33,808 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (378 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