結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー 大谷祐翔
提出日時 2025-10-31 11:38:23
言語 C#
(.NET 8.0.404)
結果
WA  
実行時間 -
コード長 850 bytes
コンパイル時間 7,883 ms
コンパイル使用メモリ 171,824 KB
実行使用メモリ 188,936 KB
最終ジャッジ日時 2025-10-31 11:38:33
合計ジャッジ時間 10,445 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (111 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

class Program
{
    static void Main(string[] args)
    {
        string inputX = Console.ReadLine()!;
        string inputY = Console.ReadLine()!;
        string inputRange = Console.ReadLine()!;

        int x = int.Parse(inputX);
        int y = int.Parse(inputY);
        int range = int.Parse(inputRange);
        int count = 0;

        if (x <= -1)
        {
            x = Math.Abs(x);
        }
        if (y <= -1)
        {
            count++;
            y =  Math.Abs(y);
        }

        int xCount = x / range;
        if (xCount * range < x)
        {
            xCount++;
        }

        int yCount = y / range;
        if (yCount * range < y)
        {
            yCount++;
        }

        if(x != 0)
        {
            count++;
        }

        count += xCount + yCount;

        Console.WriteLine(count);

    }
}
0