結果
問題 | No.2225 Treasure Searching Rod (Easy) |
ユーザー |
|
提出日時 | 2023-02-24 21:29:31 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 88 ms / 2,000 ms |
コード長 | 861 bytes |
コンパイル時間 | 2,358 ms |
コンパイル使用メモリ | 112,524 KB |
実行使用メモリ | 27,216 KB |
最終ジャッジ日時 | 2024-09-13 05:05:48 |
合計ジャッジ時間 | 4,454 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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);}}