結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー 大谷祐翔
提出日時 2025-10-31 11:48:29
言語 C#
(.NET 10.0.201)
コンパイル:
dotnet_c
実行:
/usr/bin/dotnet_wrap
結果
WA  
実行時間 -
コード長 927 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,819 ms
コンパイル使用メモリ 169,068 KB
実行使用メモリ 190,928 KB
最終ジャッジ日時 2026-07-16 01:30:37
合計ジャッジ時間 7,168 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (82 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

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);
            if (x != 0)
            {
                count++;
            }
        }

        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