結果

問題 No.48 ロボットの操縦
ユーザー takosamatakosama
提出日時 2017-12-17 21:24:08
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 793 bytes
コンパイル時間 801 ms
コンパイル使用メモリ 109,844 KB
実行使用メモリ 28,240 KB
最終ジャッジ日時 2024-05-09 10:50:22
合計ジャッジ時間 2,181 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
23,772 KB
testcase_01 AC 23 ms
23,904 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 23 ms
23,904 KB
testcase_05 AC 23 ms
25,940 KB
testcase_06 WA -
testcase_07 AC 23 ms
23,760 KB
testcase_08 WA -
testcase_09 AC 23 ms
23,644 KB
testcase_10 WA -
testcase_11 AC 23 ms
23,776 KB
testcase_12 AC 23 ms
23,728 KB
testcase_13 AC 23 ms
23,772 KB
testcase_14 AC 23 ms
24,024 KB
testcase_15 AC 24 ms
25,816 KB
testcase_16 AC 23 ms
23,908 KB
testcase_17 AC 24 ms
24,044 KB
testcase_18 WA -
testcase_19 AC 23 ms
23,900 KB
testcase_20 AC 23 ms
23,984 KB
testcase_21 AC 23 ms
25,808 KB
testcase_22 WA -
testcase_23 AC 23 ms
25,700 KB
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 = Math.Abs(int.Parse(Console.ReadLine()));
            int y = Math.Abs(int.Parse(Console.ReadLine()));
            int dist = int.Parse(Console.ReadLine());
            if (x == 0 || y == 0)
                count = 0;
            else
                count = 1;
            count += upper(1.0 * x / dist);
            count += upper(1.0 * 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