結果

問題 No.2549 Paint Eggs
ユーザー 👑 kakel-sankakel-san
提出日時 2024-01-29 23:22:12
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 1,076 bytes
コンパイル時間 7,215 ms
コンパイル使用メモリ 157,048 KB
実行使用メモリ 214,008 KB
最終ジャッジ日時 2024-01-29 23:22:38
合計ジャッジ時間 17,538 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
32,804 KB
testcase_01 WA -
testcase_02 AC 78 ms
32,804 KB
testcase_03 AC 78 ms
32,804 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 79 ms
32,804 KB
testcase_07 AC 79 ms
32,804 KB
testcase_08 AC 79 ms
32,804 KB
testcase_09 WA -
testcase_10 AC 147 ms
60,464 KB
testcase_11 AC 135 ms
56,044 KB
testcase_12 AC 127 ms
53,412 KB
testcase_13 AC 138 ms
58,892 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 134 ms
57,304 KB
testcase_17 AC 120 ms
49,572 KB
testcase_18 WA -
testcase_19 AC 124 ms
52,644 KB
testcase_20 AC 155 ms
66,640 KB
testcase_21 AC 155 ms
66,640 KB
testcase_22 WA -
testcase_23 AC 158 ms
66,644 KB
testcase_24 AC 154 ms
66,636 KB
testcase_25 AC 155 ms
66,640 KB
testcase_26 AC 155 ms
66,760 KB
testcase_27 AC 155 ms
66,644 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 156 ms
66,636 KB
testcase_31 AC 157 ms
66,636 KB
testcase_32 AC 157 ms
66,636 KB
testcase_33 AC 154 ms
66,640 KB
testcase_34 WA -
testcase_35 AC 157 ms
66,636 KB
testcase_36 AC 157 ms
66,640 KB
testcase_37 AC 155 ms
66,636 KB
testcase_38 AC 156 ms
66,644 KB
testcase_39 AC 157 ms
66,640 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 172 ms
66,644 KB
testcase_44 AC 156 ms
214,008 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (121 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;
        var (n, m, k) = (c[0], c[1], c[2]);
        c = NList;
        for (var i = 0; i < c.Length; ++i) --c[i];
        var a = NList;
        var counts = new int[m];
        for (var i = 0; i < k; ++i) ++counts[c[i]];
        var mins = (int[]) counts.Clone();
        for (var i = k; i < n; ++i)
        {
            ++counts[c[i]];
            --counts[c[i - k]];
            mins[c[i - k]] = Math.Min(mins[c[i - k]], counts[c[i - k]]);
        }
        var ans = long.MaxValue;
        for (var i = 0; i < m; ++i) ans = Math.Min(ans, (long)a[i] * (k - counts[i]));
        WriteLine(ans);
    }
}
0