結果

問題 No.91 赤、緑、青の石
コンテスト
ユーザー 抹茶アイス
提出日時 2023-08-01 14:09:57
言語 C#
(.NET 10.0.201)
コンパイル:
dotnet_c
実行:
/usr/bin/dotnet_wrap
結果
WA  
実行時間 -
コード長 854 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,020 ms
コンパイル使用メモリ 176,184 KB
実行使用メモリ 194,804 KB
最終ジャッジ日時 2026-04-27 12:27:25
合計ジャッジ時間 15,718 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1 RE * 1
other AC * 16 WA * 9 RE * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (92 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

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