結果

問題 No.48 ロボットの操縦
ユーザー kuuso1kuuso1
提出日時 2016-08-18 19:14:36
言語 F#
(F# 4.0)
結果
AC  
実行時間 82 ms / 5,000 ms
コード長 579 bytes
コンパイル時間 5,367 ms
コンパイル使用メモリ 171,224 KB
実行使用メモリ 24,868 KB
最終ジャッジ日時 2023-08-14 00:45:49
合計ジャッジ時間 8,582 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
24,816 KB
testcase_01 AC 81 ms
22,764 KB
testcase_02 AC 81 ms
22,736 KB
testcase_03 AC 80 ms
22,796 KB
testcase_04 AC 81 ms
22,708 KB
testcase_05 AC 81 ms
22,852 KB
testcase_06 AC 81 ms
24,756 KB
testcase_07 AC 81 ms
24,844 KB
testcase_08 AC 81 ms
24,868 KB
testcase_09 AC 80 ms
22,840 KB
testcase_10 AC 81 ms
22,788 KB
testcase_11 AC 81 ms
22,784 KB
testcase_12 AC 80 ms
22,792 KB
testcase_13 AC 82 ms
22,732 KB
testcase_14 AC 80 ms
24,740 KB
testcase_15 AC 80 ms
22,836 KB
testcase_16 AC 81 ms
22,776 KB
testcase_17 AC 82 ms
24,808 KB
testcase_18 AC 80 ms
22,832 KB
testcase_19 AC 81 ms
22,844 KB
testcase_20 AC 82 ms
22,688 KB
testcase_21 AC 81 ms
20,660 KB
testcase_22 AC 81 ms
22,836 KB
testcase_23 AC 82 ms
22,788 KB
testcase_24 AC 82 ms
24,836 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

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