結果

問題 No.48 ロボットの操縦
ユーザー chike_pluschike_plus
提出日時 2019-03-23 07:12:02
言語 F#
(F# 4.0)
結果
AC  
実行時間 63 ms / 5,000 ms
コード長 504 bytes
コンパイル時間 9,092 ms
コンパイル使用メモリ 189,780 KB
実行使用メモリ 30,744 KB
最終ジャッジ日時 2023-10-21 16:50:23
合計ジャッジ時間 11,892 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
30,744 KB
testcase_01 AC 63 ms
30,744 KB
testcase_02 AC 63 ms
30,744 KB
testcase_03 AC 62 ms
30,724 KB
testcase_04 AC 61 ms
30,744 KB
testcase_05 AC 61 ms
30,744 KB
testcase_06 AC 61 ms
30,724 KB
testcase_07 AC 61 ms
30,724 KB
testcase_08 AC 61 ms
30,724 KB
testcase_09 AC 61 ms
30,724 KB
testcase_10 AC 61 ms
30,716 KB
testcase_11 AC 61 ms
30,716 KB
testcase_12 AC 63 ms
30,716 KB
testcase_13 AC 62 ms
30,716 KB
testcase_14 AC 63 ms
30,720 KB
testcase_15 AC 63 ms
30,716 KB
testcase_16 AC 63 ms
30,716 KB
testcase_17 AC 61 ms
30,716 KB
testcase_18 AC 61 ms
30,716 KB
testcase_19 AC 63 ms
30,716 KB
testcase_20 AC 61 ms
30,736 KB
testcase_21 AC 61 ms
30,736 KB
testcase_22 AC 61 ms
30,744 KB
testcase_23 AC 62 ms
30,744 KB
testcase_24 AC 62 ms
30,744 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (395 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

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 ロボットの操縦``()

0