結果

問題 No.172 UFOを捕まえろ
ユーザー yuki2006yuki2006
提出日時 2018-01-22 14:12:04
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 639 bytes
コンパイル時間 2,115 ms
コンパイル使用メモリ 99,256 KB
実行使用メモリ 22,944 KB
最終ジャッジ日時 2023-08-26 20:52:34
合計ジャッジ時間 4,818 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
20,892 KB
testcase_01 AC 59 ms
20,892 KB
testcase_02 AC 59 ms
20,876 KB
testcase_03 AC 59 ms
20,916 KB
testcase_04 AC 60 ms
20,928 KB
testcase_05 AC 58 ms
20,936 KB
testcase_06 AC 60 ms
22,756 KB
testcase_07 AC 59 ms
22,816 KB
testcase_08 AC 59 ms
18,868 KB
testcase_09 AC 60 ms
20,888 KB
testcase_10 AC 59 ms
20,756 KB
testcase_11 AC 59 ms
18,780 KB
testcase_12 AC 59 ms
22,928 KB
testcase_13 AC 58 ms
20,748 KB
testcase_14 AC 60 ms
22,804 KB
testcase_15 AC 59 ms
20,756 KB
testcase_16 AC 59 ms
22,944 KB
testcase_17 AC 59 ms
20,888 KB
testcase_18 AC 59 ms
20,908 KB
testcase_19 AC 59 ms
18,768 KB
testcase_20 AC 59 ms
20,720 KB
testcase_21 AC 59 ms
20,736 KB
testcase_22 AC 59 ms
20,840 KB
testcase_23 AC 58 ms
20,716 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.Collections.Generic;

namespace lecture
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string[] A = Console.ReadLine().Split();
            int x = int.Parse(A[0]);
            int y = int.Parse(A[1]);
            int r = int.Parse(A[2]);

            // 絶対値
            x = Math.Abs(x);
            y = Math.Abs(y);

            // Ceilingは小数を返すので整数に変換する場合は
            // キャストを行う
            int ans = (int)Math.Ceiling(x + y + r * Math.Sqrt(2));

            Console.WriteLine(ans);

        }

    }
}
0