結果

問題 No.48 ロボットの操縦
ユーザー lanegue
提出日時 2020-04-02 04:08:28
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 461 bytes
コンパイル時間 3,963 ms
コンパイル使用メモリ 108,484 KB
実行使用メモリ 25,924 KB
最終ジャッジ日時 2024-06-27 16:06:08
合計ジャッジ時間 2,330 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
public class Program
{
    static void Main()
    {
        int x = int.Parse(Console.ReadLine());
        int y = int.Parse(Console.ReadLine());
        int l = int.Parse(Console.ReadLine());
        int c = 0;
        if (y < 0)
        {
            c += 1;
            y = -y;
        }
        c += (y + l - 1) / l;
        if (x != 0)
        {
            c += 1 + (Math.Abs(x) + l - 1) / l;
        }
        Console.WriteLine(c);
    }
}
0