結果

問題 No.91 赤、緑、青の石
ユーザー 抹茶アイス
提出日時 2023-08-01 14:09:57
言語 C#
(.NET 8.0.404)
結果
WA  
実行時間 -
コード長 854 bytes
コンパイル時間 11,734 ms
コンパイル使用メモリ 170,912 KB
実行使用メモリ 209,672 KB
最終ジャッジ日時 2024-10-11 05:51:56
合計ジャッジ時間 19,497 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1 RE * 1
other AC * 16 WA * 8 RE * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (122 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]).Where(x => x > 0).ToArray();
            while (s.All(x => x > 0))
            {
                Array.Sort(s);
                s[0]--;
                s[1] -= 3;
                sum++;
            }
            while (s[1] > 4)
            {
                s[1] -= 5;
                sum++;
            }
            return sum;
        }
    }
}
0