結果

問題 No.48 ロボットの操縦
ユーザー うわばみうわばみ
提出日時 2020-04-29 16:21:19
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 974 bytes
コンパイル時間 982 ms
コンパイル使用メモリ 65,344 KB
実行使用メモリ 24,740 KB
最終ジャッジ日時 2023-08-19 07:44:09
合計ジャッジ時間 5,374 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
20,708 KB
testcase_01 AC 51 ms
20,800 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 52 ms
20,656 KB
testcase_05 AC 50 ms
20,800 KB
testcase_06 AC 48 ms
18,748 KB
testcase_07 AC 51 ms
20,720 KB
testcase_08 WA -
testcase_09 AC 53 ms
20,744 KB
testcase_10 WA -
testcase_11 AC 51 ms
18,772 KB
testcase_12 AC 49 ms
20,612 KB
testcase_13 AC 51 ms
20,772 KB
testcase_14 AC 50 ms
20,748 KB
testcase_15 AC 50 ms
20,680 KB
testcase_16 AC 51 ms
20,776 KB
testcase_17 AC 50 ms
22,788 KB
testcase_18 WA -
testcase_19 AC 51 ms
24,740 KB
testcase_20 AC 49 ms
18,704 KB
testcase_21 AC 57 ms
20,708 KB
testcase_22 WA -
testcase_23 AC 58 ms
20,768 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;

class Program
{
    static void Main()
    {
        int X = int.Parse(Console.ReadLine());
        int Y = int.Parse(Console.ReadLine());
        int L = int.Parse(Console.ReadLine());
        int x = 0, y = 0, dir = 0, count = 0;
        if(0 < Y)
        {
            while(y < Y)
            {
                y += L;
                count++;
            }
        }
        if(X < 0)
        {
            count++;
            while(X < x)
            {
                x -= L;
                count++;
            }
        }
        else if(0 < X)
        {
            count++;
            while(x < X)
            {
                x += L;
                count++;
            }
        }
        else if(X == 0 && Y < 0)
        {
            count++;
        }
        if(Y < 0)
        {
            while(Y < y)
            {
                y -= L;
                count++;
            }
        }
        Console.WriteLine($"{count}");
    }
}
0