結果

問題 No.48 ロボットの操縦
ユーザー kuuso1kuuso1
提出日時 2016-08-18 19:14:36
言語 F#
(F# 4.0)
結果
AC  
実行時間 338 ms / 5,000 ms
コード長 579 bytes
コンパイル時間 14,558 ms
コンパイル使用メモリ 188,492 KB
実行使用メモリ 34,608 KB
最終ジャッジ日時 2024-05-01 14:00:38
合計ジャッジ時間 23,926 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 336 ms
33,808 KB
testcase_01 AC 334 ms
34,080 KB
testcase_02 AC 336 ms
34,228 KB
testcase_03 AC 332 ms
33,804 KB
testcase_04 AC 330 ms
33,932 KB
testcase_05 AC 333 ms
34,592 KB
testcase_06 AC 332 ms
34,608 KB
testcase_07 AC 333 ms
34,336 KB
testcase_08 AC 335 ms
34,596 KB
testcase_09 AC 338 ms
34,204 KB
testcase_10 AC 331 ms
34,088 KB
testcase_11 AC 332 ms
34,472 KB
testcase_12 AC 332 ms
33,544 KB
testcase_13 AC 327 ms
34,088 KB
testcase_14 AC 331 ms
34,208 KB
testcase_15 AC 331 ms
33,924 KB
testcase_16 AC 331 ms
34,064 KB
testcase_17 AC 332 ms
33,680 KB
testcase_18 AC 333 ms
34,352 KB
testcase_19 AC 329 ms
33,676 KB
testcase_20 AC 335 ms
34,356 KB
testcase_21 AC 334 ms
33,804 KB
testcase_22 AC 334 ms
34,288 KB
testcase_23 AC 332 ms
34,360 KB
testcase_24 AC 330 ms
34,236 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (287 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 #

open System
type Sol() =
    member this.Solve() = 
        let X = stdin.ReadLine() |> int
        let Y = stdin.ReadLine() |> int
        let L = stdin.ReadLine() |> int
        
        let mutable ans = 0
        ans <- if (Y >= 0) && (X = 0) then 0
               elif (Y >= 0) then 1
               else 2
        
        let aX = abs X
        let aY = abs Y
        
        ans <- ans + aX / L + (if (aX % L) = 0 then 0 else 1)
        ans <- ans + aY / L + (if (aY % L) = 0 then 0 else 1)
        
        printfn "%d" ans
        
let mySol = new Sol()
mySol.Solve()
0