結果

問題 No.965 門松列が嫌い
ユーザー mobchanmobchan
提出日時 2023-04-27 00:37:45
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 66 ms / 1,000 ms
コード長 741 bytes
コンパイル時間 9,209 ms
コンパイル使用メモリ 167,404 KB
実行使用メモリ 185,288 KB
最終ジャッジ日時 2024-04-28 01:02:20
合計ジャッジ時間 10,566 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
31,100 KB
testcase_01 AC 62 ms
31,092 KB
testcase_02 AC 64 ms
31,092 KB
testcase_03 AC 64 ms
30,940 KB
testcase_04 AC 62 ms
31,092 KB
testcase_05 AC 66 ms
30,976 KB
testcase_06 AC 63 ms
31,104 KB
testcase_07 AC 65 ms
31,092 KB
testcase_08 AC 63 ms
31,104 KB
testcase_09 AC 62 ms
185,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (92 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var A = input[0];
        var B = input[1];
        var C = input[2];
        var ans = 0;

        var list = new List<int>(input);
        if (list.Distinct().Count() == 3)
            if (!((list.Max() == A && list.Min() == C) || (list.Max() == C && list.Min() == A)))
            {
                var temp = list.OrderByDescending(x => x).ToList();
                var p = temp[0] - temp[1];
                var q = temp[1] - temp[2];
                ans = p < q ? p : q;
            }
        Console.WriteLine(ans);
    }
}
0