結果

問題 No.131 マンハッタン距離
ユーザー mbanmban
提出日時 2017-01-12 14:39:33
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,489 bytes
コンパイル時間 2,134 ms
コンパイル使用メモリ 103,932 KB
実行使用メモリ 22,880 KB
最終ジャッジ日時 2023-08-23 08:45:15
合計ジャッジ時間 4,810 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
20,696 KB
testcase_01 WA -
testcase_02 AC 58 ms
22,736 KB
testcase_03 AC 59 ms
20,700 KB
testcase_04 AC 58 ms
20,668 KB
testcase_05 AC 57 ms
20,760 KB
testcase_06 AC 58 ms
20,752 KB
testcase_07 AC 57 ms
20,812 KB
testcase_08 AC 58 ms
22,748 KB
testcase_09 WA -
testcase_10 AC 57 ms
20,676 KB
testcase_11 AC 57 ms
20,800 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 57 ms
20,800 KB
testcase_15 AC 59 ms
18,820 KB
testcase_16 AC 57 ms
20,688 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 58 ms
22,788 KB
testcase_22 AC 58 ms
22,796 KB
testcase_23 AC 58 ms
20,668 KB
testcase_24 WA -
testcase_25 AC 58 ms
22,716 KB
testcase_26 AC 58 ms
20,664 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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;

class Program
{
    static private Magatro M = new Magatro();
    static private void Main(string[]args)
    {
        M.Scan();
        M.Solve();
    }
}

public class Scanner
{
    private string[] S;
    private int Index;
    private char Separator;

    public Scanner(char separator = ' ')
    {
        Index = 0;
        Separator = separator;
    }

    private string[] Line()
    {
        return Console.ReadLine().Split(Separator);
    }

    public string Next()
    {
        string result;
        if (S == null || Index >= S.Length)
        {
            S = Line();
            Index = 0;
        }
        result = S[Index];
        Index++;
        return result;
    }
    public int NextInt()
    {
        return int.Parse(Next());
    }
    public double NextDouble()
    {
        return double.Parse(Next());
    }
    public long NextLong()
    {
        return long.Parse(Next());
    }
}

public class Magatro
{
    private int x, y, d;
    public void Scan()
    {
        Scanner sc = new Scanner();
        x = sc.NextInt();
        y = sc.NextInt();
        d = sc.NextInt();
    }
    public void Solve()
    {
        int ans = d+1;
        ans -= d - x;
        ans -= d - y;
        if (ans < 0) ans = 0;
        Console.WriteLine(ans);
    }
}
0