結果

問題 No.48 ロボットの操縦
ユーザー mkanenobu
提出日時 2018-03-25 13:17:01
言語 Nim
(2.2.0)
結果
WA  
実行時間 -
コード長 522 bytes
コンパイル時間 3,197 ms
コンパイル使用メモリ 65,980 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-30 05:37:27
合計ジャッジ時間 4,204 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #

import sequtils, strutils, math

var
    x = readLine(stdin).parseInt
    y = readLine(stdin).parseInt
    l = readLine(stdin).parseInt

proc main():int =
    result += int(ceil(x.abs / l) + ceil(y.abs / l))
    if x == 0:
        return
    elif y == 0:
        return result + 1
    elif x > 0:
        if y > 0:
            return result + 1
        elif y < 0:
            return result + 2
    elif x < 0:
        if y > 0:
            return result + 1
        elif y < 0:
            return result + 2

echo main()
0