結果
問題 |
No.172 UFOを捕まえろ
|
ユーザー |
|
提出日時 | 2023-04-30 12:15:19 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 349 ms / 5,000 ms |
コード長 | 354 bytes |
コンパイル時間 | 11,161 ms |
コンパイル使用メモリ | 191,796 KB |
実行使用メモリ | 34,708 KB |
最終ジャッジ日時 | 2024-11-19 03:59:59 |
合計ジャッジ時間 | 17,887 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (249 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/
ソースコード
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)