結果

問題 No.91 赤、緑、青の石
ユーザー 抹茶アイス抹茶アイス
提出日時 2023-08-01 14:09:57
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 854 bytes
コンパイル時間 7,390 ms
コンパイル使用メモリ 168,368 KB
実行使用メモリ 209,308 KB
最終ジャッジ日時 2024-04-19 13:28:38
合計ジャッジ時間 14,954 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 216 ms
53,872 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 85 ms
40,700 KB
testcase_07 RE -
testcase_08 AC 56 ms
30,208 KB
testcase_09 WA -
testcase_10 AC 58 ms
29,952 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 266 ms
53,760 KB
testcase_14 AC 202 ms
53,760 KB
testcase_15 AC 286 ms
53,632 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 54 ms
29,952 KB
testcase_20 AC 59 ms
29,824 KB
testcase_21 AC 56 ms
29,824 KB
testcase_22 RE -
testcase_23 AC 59 ms
29,952 KB
testcase_24 AC 55 ms
30,316 KB
testcase_25 AC 400 ms
53,748 KB
testcase_26 WA -
testcase_27 AC 55 ms
29,952 KB
testcase_28 AC 57 ms
30,828 KB
testcase_29 AC 61 ms
32,364 KB
testcase_30 AC 296 ms
53,888 KB
testcase_31 AC 374 ms
209,308 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (91 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