結果

問題 No.131 マンハッタン距離
ユーザー No
提出日時 2015-06-15 01:26:50
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 22 ms / 5,000 ms
コード長 1,145 bytes
コンパイル時間 814 ms
コンパイル使用メモリ 112,740 KB
実行使用メモリ 26,208 KB
最終ジャッジ日時 2024-07-06 20:49:05
合計ジャッジ時間 2,151 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
}
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0