結果

問題 No.48 ロボットの操縦
ユーザー merumeru_333333merumeru_333333
提出日時 2020-01-04 15:40:20
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 677 bytes
コンパイル時間 4,830 ms
コンパイル使用メモリ 104,736 KB
実行使用メモリ 24,748 KB
最終ジャッジ日時 2023-08-14 20:12:35
合計ジャッジ時間 7,574 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
22,800 KB
testcase_01 AC 58 ms
22,740 KB
testcase_02 AC 57 ms
20,684 KB
testcase_03 AC 57 ms
20,684 KB
testcase_04 AC 57 ms
20,820 KB
testcase_05 AC 57 ms
20,760 KB
testcase_06 AC 56 ms
20,684 KB
testcase_07 AC 57 ms
20,808 KB
testcase_08 AC 57 ms
20,792 KB
testcase_09 AC 57 ms
22,744 KB
testcase_10 AC 57 ms
20,688 KB
testcase_11 AC 56 ms
20,804 KB
testcase_12 AC 58 ms
20,760 KB
testcase_13 AC 58 ms
22,724 KB
testcase_14 AC 58 ms
24,748 KB
testcase_15 AC 58 ms
20,676 KB
testcase_16 AC 56 ms
20,668 KB
testcase_17 AC 58 ms
20,716 KB
testcase_18 AC 57 ms
20,700 KB
testcase_19 AC 59 ms
22,812 KB
testcase_20 AC 57 ms
20,744 KB
testcase_21 AC 56 ms
20,668 KB
testcase_22 AC 57 ms
18,648 KB
testcase_23 AC 56 ms
20,860 KB
testcase_24 AC 57 ms
20,596 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class test2
{
    static void Main()
    {
        double x = double.Parse(Console.ReadLine());
        double y = double.Parse(Console.ReadLine());
        double l = double.Parse(Console.ReadLine());
        int movecnt = 0;
        double a, b, c;

        a = Math.Abs(x) / l;
        b = Math.Abs(y) / l;
        c= Math.Ceiling(a)+Math.Ceiling(b);
        movecnt = (int)c;

        if (x != 0)
        {
            movecnt = movecnt + 1;
        }
        else if (x == 0 && y < 0)
        {
            movecnt = movecnt + 1;
        }
        if (y < 0)
        {
            movecnt = movecnt + 1;
        }
        Console.WriteLine(movecnt);
    }
}
0