結果

問題 No.48 ロボットの操縦
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2016-04-14 20:20:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 21 ms / 5,000 ms
コード長 450 bytes
コンパイル時間 4,068 ms
コンパイル使用メモリ 108,144 KB
実行使用メモリ 28,096 KB
最終ジャッジ日時 2024-05-01 13:52:01
合計ジャッジ時間 2,076 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
25,808 KB
testcase_01 AC 21 ms
23,852 KB
testcase_02 AC 20 ms
25,908 KB
testcase_03 AC 19 ms
23,800 KB
testcase_04 AC 20 ms
25,936 KB
testcase_05 AC 21 ms
25,932 KB
testcase_06 AC 19 ms
25,556 KB
testcase_07 AC 19 ms
26,040 KB
testcase_08 AC 19 ms
24,028 KB
testcase_09 AC 18 ms
25,916 KB
testcase_10 AC 19 ms
23,852 KB
testcase_11 AC 19 ms
23,764 KB
testcase_12 AC 19 ms
25,936 KB
testcase_13 AC 20 ms
25,920 KB
testcase_14 AC 20 ms
23,640 KB
testcase_15 AC 18 ms
21,936 KB
testcase_16 AC 20 ms
28,096 KB
testcase_17 AC 19 ms
23,896 KB
testcase_18 AC 20 ms
25,808 KB
testcase_19 AC 18 ms
21,940 KB
testcase_20 AC 19 ms
26,056 KB
testcase_21 AC 20 ms
25,656 KB
testcase_22 AC 19 ms
23,732 KB
testcase_23 AC 19 ms
23,768 KB
testcase_24 AC 21 ms
25,684 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 Program {
    public static void Main() {
        int x = int.Parse(Console.ReadLine());
        int y = int.Parse(Console.ReadLine());
        double limit = double.Parse(Console.ReadLine());
        int ans;
        if (y < 0) ans = 2;
        else if (x != 0) ans = 1;
        else ans = 0;
        ans += (int)(Math.Ceiling(Math.Abs(x)/limit) + Math.Ceiling(Math.Abs(y)/limit));
        Console.WriteLine(ans);
    }
}
0