結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
chike_plus
|
| 提出日時 | 2019-03-23 07:12:02 |
| 言語 | F# (F# 4.0) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 5,000 ms |
| コード長 | 504 bytes |
| コンパイル時間 | 10,512 ms |
| コンパイル使用メモリ | 187,160 KB |
| 実行使用メモリ | 29,560 KB |
| 最終ジャッジ日時 | 2024-09-21 18:05:27 |
| 合計ジャッジ時間 | 13,051 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (239 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 ``No.48 ロボットの操縦``() =
let X = stdin.ReadLine() |> int
let Y = stdin.ReadLine() |> int
let L = stdin.ReadLine() |> int
let direction x y =
match x, y with
| _ , _ when y < 0 -> 2
| _ , _ when y >= 0 && x <> 0 -> 1
| 0 , _ -> 0
| _ , _ -> 1
let sum = direction X Y
let sum = sum + abs(X / L) + if (X % L = 0) then 0 else 1
let sum = sum + abs(Y / L) + if (Y % L = 0) then 0 else 1
stdout.WriteLine sum
``No.48 ロボットの操縦``()
chike_plus