結果

問題 No.91 赤、緑、青の石
ユーザー 抹茶アイス抹茶アイス
提出日時 2023-08-01 12:01:03
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 948 bytes
コンパイル時間 6,412 ms
コンパイル使用メモリ 166,368 KB
実行使用メモリ 184,800 KB
最終ジャッジ日時 2024-04-19 11:36:55
合計ジャッジ時間 8,882 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
30,080 KB
testcase_01 AC 48 ms
30,208 KB
testcase_02 AC 49 ms
30,208 KB
testcase_03 AC 48 ms
30,208 KB
testcase_04 AC 47 ms
30,208 KB
testcase_05 AC 48 ms
30,208 KB
testcase_06 WA -
testcase_07 AC 45 ms
30,208 KB
testcase_08 AC 47 ms
29,824 KB
testcase_09 AC 48 ms
29,952 KB
testcase_10 AC 48 ms
30,208 KB
testcase_11 AC 49 ms
29,952 KB
testcase_12 AC 49 ms
30,052 KB
testcase_13 AC 51 ms
30,080 KB
testcase_14 AC 50 ms
30,052 KB
testcase_15 AC 47 ms
30,208 KB
testcase_16 AC 50 ms
30,336 KB
testcase_17 AC 49 ms
30,336 KB
testcase_18 AC 48 ms
30,052 KB
testcase_19 AC 47 ms
29,952 KB
testcase_20 AC 48 ms
30,200 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 48 ms
30,080 KB
testcase_24 AC 47 ms
29,952 KB
testcase_25 AC 47 ms
30,052 KB
testcase_26 AC 47 ms
30,036 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 47 ms
30,208 KB
testcase_31 AC 46 ms
184,800 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (82 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;

namespace yukicoder
{
    public class Program
    {
        public static void Main()
        {
            var s = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var sum = 0;
            sum = Make(s, sum);
            Console.WriteLine(sum);
        }
        public static int Make(int[] s,int sum)
        {
            Array.Sort(s);
            sum += s[0];
            s = s.Select(x => x - s[0]).ToArray();
            if (!s.All(x => x < 3))
            {
                var k = (s[2] - s[1]) / 2;
                if (k == 0)
                {
                    k = s[2] / 4;
                }
                if (k == 0)
                {
                    k = 1;
                }
                s = new int[3] { k, s[1], s[2] - k * 2 };
                sum = Make(s, sum);
            }
            return sum;
        }
    }
}
0