結果

問題 No.131 マンハッタン距離
ユーザー NoNo
提出日時 2015-06-15 01:26:50
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 1,145 bytes
コンパイル時間 2,426 ms
コンパイル使用メモリ 104,312 KB
実行使用メモリ 22,860 KB
最終ジャッジ日時 2023-09-21 02:05:10
合計ジャッジ時間 5,278 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
20,684 KB
testcase_01 AC 59 ms
20,772 KB
testcase_02 AC 58 ms
20,676 KB
testcase_03 AC 57 ms
20,792 KB
testcase_04 AC 58 ms
20,752 KB
testcase_05 AC 58 ms
20,708 KB
testcase_06 AC 57 ms
18,688 KB
testcase_07 AC 58 ms
20,744 KB
testcase_08 AC 58 ms
20,764 KB
testcase_09 AC 58 ms
20,764 KB
testcase_10 AC 58 ms
22,648 KB
testcase_11 AC 58 ms
22,672 KB
testcase_12 AC 58 ms
20,608 KB
testcase_13 AC 59 ms
20,840 KB
testcase_14 AC 59 ms
20,692 KB
testcase_15 AC 59 ms
20,700 KB
testcase_16 AC 58 ms
20,696 KB
testcase_17 AC 59 ms
20,680 KB
testcase_18 AC 57 ms
18,644 KB
testcase_19 AC 58 ms
22,860 KB
testcase_20 AC 58 ms
20,764 KB
testcase_21 AC 57 ms
18,764 KB
testcase_22 AC 58 ms
20,804 KB
testcase_23 AC 59 ms
22,732 KB
testcase_24 AC 58 ms
22,740 KB
testcase_25 AC 59 ms
20,684 KB
testcase_26 AC 58 ms
20,876 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;

namespace foryuki
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split();
            var x = int.Parse(str[0]);
            var y = int.Parse(str[1]);
            var d = int.Parse(str[2]);

            int ans = d + 1;
            if (d > x)ans = ans - (d - x);
            if (d > y)ans = ans - (d - y);
            if (ans < 0) ans = 0;
            Console.WriteLine(ans);
        }


        static int a(int i)
        {
            return -1;
        }




        //-------------------------------------------------------------

        static int[] ConvertStringArrayToIntArray(string[] array)
        {
            return Array.ConvertAll(array, str => int.Parse(str));
        }

        static List<int> ConvertStringArrayToIntList(string[] str)
        {
            var list = new List<int>();
            foreach (var c in str)
            {
                list.Add(int.Parse(c));
            }
            return list;
        }
    }
}
0