結果

問題 No.91 赤、緑、青の石
ユーザー 👑 kakel-sankakel-san
提出日時 2023-10-21 23:37:39
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 699 bytes
コンパイル時間 15,622 ms
コンパイル使用メモリ 158,856 KB
実行使用メモリ 177,128 KB
最終ジャッジ日時 2023-10-21 23:38:00
合計ジャッジ時間 20,906 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 82 ms
32,600 KB
testcase_08 AC 82 ms
32,596 KB
testcase_09 AC 82 ms
32,596 KB
testcase_10 AC 81 ms
32,580 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 82 ms
32,596 KB
testcase_17 AC 82 ms
32,596 KB
testcase_18 AC 88 ms
32,592 KB
testcase_19 AC 82 ms
32,596 KB
testcase_20 AC 82 ms
32,596 KB
testcase_21 AC 82 ms
32,596 KB
testcase_22 AC 82 ms
32,592 KB
testcase_23 AC 84 ms
32,596 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 81 ms
32,580 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 82 ms
32,580 KB
testcase_31 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (101 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        while (true)
        {
            Array.Sort(c);
            if (c[2] - c[0] < 3) break;
            var mv = (c[2] - c[0]) / 3;
            c[2] -= mv * 2;
            c[0] += mv;
        }
        WriteLine(c.Min());
    }
}
0