結果
問題 | No.2225 Treasure Searching Rod (Easy) |
ユーザー |
|
提出日時 | 2024-03-19 11:52:57 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 16 ms / 2,000 ms |
コード長 | 604 bytes |
コンパイル時間 | 4,397 ms |
コンパイル使用メモリ | 250,456 KB |
最終ジャッジ日時 | 2025-02-20 07:27:55 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
#include <bits/stdc++.h>#include <atcoder/all>using namespace std;using namespace atcoder;using ll = long long;using mint = modint998244353;int H, W, K;ll A[2525][3];int main() {cin >> H >> W >> K;for (int i = 1; i <= K; i++) {cin >> A[i][0] >> A[i][1] >> A[i][2];}mint ans = 0;for (int i = 1; i <= H; i++) {for (int j = 1; j <= W; j++) {for (int k = 1; k <= K; k++) {ll x = A[k][0], y = A[k][1], v = A[k][2];if ((x + y >= i + j) and (x - y >= i - j)) {ans += v;}}}}cout << ans.val() << endl;return 0;}