結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー 👑 kakel-sankakel-san
提出日時 2023-02-24 21:29:31
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 861 bytes
コンパイル時間 1,970 ms
コンパイル使用メモリ 65,860 KB
実行使用メモリ 24,004 KB
最終ジャッジ日時 2023-10-11 05:50:56
合計ジャッジ時間 4,844 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
21,868 KB
testcase_01 AC 64 ms
21,712 KB
testcase_02 AC 63 ms
21,768 KB
testcase_03 AC 62 ms
21,728 KB
testcase_04 AC 64 ms
21,924 KB
testcase_05 AC 64 ms
21,856 KB
testcase_06 AC 63 ms
21,804 KB
testcase_07 AC 114 ms
21,756 KB
testcase_08 AC 113 ms
21,800 KB
testcase_09 AC 114 ms
21,888 KB
testcase_10 AC 66 ms
23,932 KB
testcase_11 AC 65 ms
24,000 KB
testcase_12 AC 114 ms
23,940 KB
testcase_13 AC 113 ms
19,752 KB
testcase_14 AC 114 ms
21,824 KB
testcase_15 AC 64 ms
23,740 KB
testcase_16 AC 64 ms
24,004 KB
testcase_17 AC 63 ms
21,812 KB
testcase_18 AC 63 ms
21,872 KB
testcase_19 AC 64 ms
21,900 KB
testcase_20 AC 65 ms
23,812 KB
testcase_21 AC 75 ms
21,760 KB
testcase_22 AC 64 ms
21,832 KB
testcase_23 AC 74 ms
21,804 KB
testcase_24 AC 66 ms
21,772 KB
testcase_25 AC 68 ms
21,912 KB
権限があれば一括ダウンロードができます

ソースコード

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 (h, w, k) = (c[0], c[1], c[2]);
        var map = NArr(k);
        var ans = 0L;
        var mod = 998_244_353;
        for (var i = 1; i <= h; ++i) for (var j = 1; j <= w; ++j)
        {
            foreach (var g in map)
            {
                if (g[0] + g[1] >= i + j && g[0] - g[1] >= i - j) ans = (ans + g[2]) % mod;
            }
        }
        WriteLine(ans);
    }
}
0