結果

問題 No.172 UFOを捕まえろ
ユーザー Toni TakekawaToni Takekawa
提出日時 2016-10-02 03:19:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 24 ms / 5,000 ms
コード長 1,083 bytes
コンパイル時間 866 ms
コンパイル使用メモリ 114,064 KB
実行使用メモリ 26,212 KB
最終ジャッジ日時 2024-05-01 09:29:01
合計ジャッジ時間 2,008 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
24,324 KB
testcase_01 AC 23 ms
24,328 KB
testcase_02 AC 23 ms
24,244 KB
testcase_03 AC 23 ms
23,944 KB
testcase_04 AC 24 ms
24,192 KB
testcase_05 AC 23 ms
24,200 KB
testcase_06 AC 24 ms
24,420 KB
testcase_07 AC 23 ms
23,948 KB
testcase_08 AC 24 ms
23,912 KB
testcase_09 AC 23 ms
26,212 KB
testcase_10 AC 22 ms
24,428 KB
testcase_11 AC 23 ms
26,212 KB
testcase_12 AC 23 ms
26,084 KB
testcase_13 AC 22 ms
24,212 KB
testcase_14 AC 22 ms
26,208 KB
testcase_15 AC 22 ms
24,076 KB
testcase_16 AC 22 ms
24,076 KB
testcase_17 AC 22 ms
26,208 KB
testcase_18 AC 23 ms
24,368 KB
testcase_19 AC 22 ms
24,192 KB
testcase_20 AC 23 ms
24,500 KB
testcase_21 AC 23 ms
21,808 KB
testcase_22 AC 23 ms
26,116 KB
testcase_23 AC 23 ms
24,292 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