結果

問題 No.48 ロボットの操縦
ユーザー takosamatakosama
提出日時 2017-12-17 21:37:21
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 788 bytes
コンパイル時間 2,106 ms
コンパイル使用メモリ 103,160 KB
実行使用メモリ 22,900 KB
最終ジャッジ日時 2023-08-22 04:54:22
合計ジャッジ時間 4,696 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,744 KB
testcase_01 AC 56 ms
18,772 KB
testcase_02 AC 55 ms
20,764 KB
testcase_03 AC 58 ms
22,856 KB
testcase_04 AC 56 ms
20,804 KB
testcase_05 AC 56 ms
22,880 KB
testcase_06 AC 57 ms
20,924 KB
testcase_07 AC 56 ms
20,792 KB
testcase_08 AC 56 ms
22,804 KB
testcase_09 AC 57 ms
20,732 KB
testcase_10 AC 56 ms
20,916 KB
testcase_11 AC 56 ms
20,828 KB
testcase_12 AC 57 ms
20,760 KB
testcase_13 AC 56 ms
20,752 KB
testcase_14 AC 56 ms
18,788 KB
testcase_15 AC 56 ms
20,744 KB
testcase_16 AC 56 ms
18,708 KB
testcase_17 AC 57 ms
20,768 KB
testcase_18 AC 56 ms
20,804 KB
testcase_19 AC 55 ms
18,804 KB
testcase_20 AC 56 ms
20,756 KB
testcase_21 AC 56 ms
20,820 KB
testcase_22 AC 56 ms
22,900 KB
testcase_23 AC 56 ms
22,816 KB
testcase_24 AC 56 ms
20,816 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.IO;
using System.Linq;

namespace yukicore
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            int count = 0;
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());

             if (y < 0) count = 2;

else            if (x != 0) count=1;
           

            int dist = int.Parse(Console.ReadLine());
           
            count += upper(1.0 * Math.Abs(x) / dist);
            count += upper(1.0 * Math.Abs(y) / dist);
            Console.WriteLine(count);
        }

        static int upper(double n)
        {
            if (n % 1 == 0)
                return(int) n;
            else
                return(int) Math.Floor(n) + 1;
        }
    }
}
0