結果

問題 No.172 UFOを捕まえろ
ユーザー Toni TakekawaToni Takekawa
提出日時 2016-10-02 03:19:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 1,083 bytes
コンパイル時間 2,129 ms
コンパイル使用メモリ 106,108 KB
実行使用メモリ 23,036 KB
最終ジャッジ日時 2023-08-13 16:43:31
合計ジャッジ時間 4,591 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
20,984 KB
testcase_01 AC 58 ms
20,888 KB
testcase_02 AC 57 ms
20,992 KB
testcase_03 AC 57 ms
18,880 KB
testcase_04 AC 57 ms
22,928 KB
testcase_05 AC 58 ms
20,788 KB
testcase_06 AC 58 ms
20,780 KB
testcase_07 AC 58 ms
20,896 KB
testcase_08 AC 58 ms
22,776 KB
testcase_09 AC 58 ms
20,996 KB
testcase_10 AC 58 ms
22,836 KB
testcase_11 AC 58 ms
22,800 KB
testcase_12 AC 58 ms
20,832 KB
testcase_13 AC 58 ms
20,940 KB
testcase_14 AC 57 ms
18,736 KB
testcase_15 AC 58 ms
20,940 KB
testcase_16 AC 57 ms
22,836 KB
testcase_17 AC 58 ms
20,844 KB
testcase_18 AC 58 ms
23,036 KB
testcase_19 AC 58 ms
20,788 KB
testcase_20 AC 58 ms
22,928 KB
testcase_21 AC 57 ms
22,880 KB
testcase_22 AC 59 ms
22,816 KB
testcase_23 AC 57 ms
20,788 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;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static void Main(string[] args)
    {
        //var data = "-50 -40 30";
        var data = Console.ReadLine();
        var expect = 133;

        Action<string> nullFunc = (msg) => { };
        Action<string> outDebug = Console.WriteLine;
        //Action<string> output = outDebug;
        Action<string> output = nullFunc;

        var tbl = new Dictionary<bool, string>
        {
            { true,  "〇" },
            { false, "×" }
        };

        //var ret = tbl[expect == Solve(data)];
        //outDebug(ret);

        Console.WriteLine(Solve(data));

        //Console.ReadLine();
    }

    static int Solve(string data)
    {
        var e = data.Split(' ');
        var x = Math.Abs(int.Parse(e[0]));
        var y = Math.Abs(int.Parse(e[1]));
        var r = int.Parse(e[2]);

        // UFOの最も遠いマンハッタン距離は?

        var s = x + y + (int)Math.Ceiling(Math.Sqrt(2)*r);

        return s;
    }
}
0