結果

問題 No.48 ロボットの操縦
ユーザー arasabakiarasabaki
提出日時 2016-03-09 00:59:40
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 636 bytes
コンパイル時間 1,689 ms
コンパイル使用メモリ 102,140 KB
実行使用メモリ 22,780 KB
最終ジャッジ日時 2023-08-14 00:23:42
合計ジャッジ時間 3,785 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
20,696 KB
testcase_01 AC 45 ms
20,752 KB
testcase_02 AC 46 ms
20,760 KB
testcase_03 AC 46 ms
20,704 KB
testcase_04 AC 46 ms
20,756 KB
testcase_05 AC 46 ms
18,660 KB
testcase_06 AC 46 ms
20,892 KB
testcase_07 AC 46 ms
22,776 KB
testcase_08 AC 48 ms
22,780 KB
testcase_09 AC 48 ms
22,764 KB
testcase_10 AC 48 ms
22,732 KB
testcase_11 AC 47 ms
22,712 KB
testcase_12 AC 46 ms
20,760 KB
testcase_13 AC 46 ms
20,760 KB
testcase_14 AC 47 ms
20,860 KB
testcase_15 AC 46 ms
22,684 KB
testcase_16 AC 47 ms
20,760 KB
testcase_17 AC 47 ms
22,780 KB
testcase_18 AC 47 ms
20,780 KB
testcase_19 AC 48 ms
20,892 KB
testcase_20 AC 47 ms
22,752 KB
testcase_21 AC 47 ms
20,704 KB
testcase_22 AC 46 ms
20,844 KB
testcase_23 AC 46 ms
18,640 KB
testcase_24 AC 46 ms
20,772 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

namespace TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var X = int.Parse(Console.ReadLine());
            var Y = int.Parse(Console.ReadLine());
            var L = int.Parse(Console.ReadLine());

            int count = X != 0 ? (Math.Abs(X) - 1) / L + 2 : 0;
            count += Y != 0 ? (Math.Abs(Y) - 1) / L + 1 : 0;

            if (Y < 0)
            {
                count++;
                if(X == 0)
                {
                    count++;
                }
            }
            Console.WriteLine(count);
        }
    }
}
0