結果

問題 No.48 ロボットの操縦
ユーザー YoiTakaYoiTaka
提出日時 2017-02-23 08:45:23
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 55 ms / 5,000 ms
コード長 1,166 bytes
コンパイル時間 1,877 ms
コンパイル使用メモリ 101,952 KB
実行使用メモリ 22,820 KB
最終ジャッジ日時 2023-08-30 21:14:31
合計ジャッジ時間 4,293 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
22,792 KB
testcase_01 AC 54 ms
22,712 KB
testcase_02 AC 54 ms
20,664 KB
testcase_03 AC 53 ms
20,656 KB
testcase_04 AC 54 ms
20,668 KB
testcase_05 AC 54 ms
22,696 KB
testcase_06 AC 54 ms
22,708 KB
testcase_07 AC 54 ms
22,820 KB
testcase_08 AC 54 ms
22,700 KB
testcase_09 AC 54 ms
20,808 KB
testcase_10 AC 54 ms
20,660 KB
testcase_11 AC 54 ms
20,748 KB
testcase_12 AC 54 ms
18,572 KB
testcase_13 AC 54 ms
20,608 KB
testcase_14 AC 54 ms
20,672 KB
testcase_15 AC 54 ms
18,628 KB
testcase_16 AC 53 ms
20,768 KB
testcase_17 AC 53 ms
20,812 KB
testcase_18 AC 54 ms
20,676 KB
testcase_19 AC 54 ms
20,844 KB
testcase_20 AC 55 ms
20,768 KB
testcase_21 AC 53 ms
20,744 KB
testcase_22 AC 54 ms
22,700 KB
testcase_23 AC 53 ms
20,656 KB
testcase_24 AC 53 ms
20,592 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 Hello
{
    public static void Main()
    {
        //var sr = new System.IO.StreamReader("test.txt");
        //System.Console.SetIn(sr);

        string line = System.Console.ReadLine().Trim();
        int X = int.Parse(line);
        X = Math.Abs(X);
        line = System.Console.ReadLine().Trim();
        int Y = int.Parse(line);
        line = System.Console.ReadLine().Trim();
        int L = int.Parse(line);

        int count = 0;


        if (Y >= 0)
        {
            count += (int)(Math.Ceiling((double)Y / (double)L));

            if (X != 0)
            {
                count += (int)(Math.Ceiling((double)X / (double)L)) + 1;

                System.Console.WriteLine(count);
                return;
            }
            else
            {
                System.Console.WriteLine(count);
                return;
            }
        }
        else
        {
            Y = Math.Abs(Y);
            count += (int)(Math.Ceiling((double)X / (double)L) + 1);
            count += (int)(Math.Ceiling((double)Y / (double)L) + 1);
            System.Console.WriteLine(count);
            return;
        }
    }
}
0