結果
| 問題 |
No.2225 Treasure Searching Rod (Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-02-24 22:08:10 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 14 ms / 2,000 ms |
| コード長 | 842 bytes |
| コンパイル時間 | 2,531 ms |
| コンパイル使用メモリ | 160,808 KB |
| 最終ジャッジ日時 | 2025-02-10 21:12:34 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstring>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)
const ll mod = 998244353;
int main(){
int h,w,k;
cin >> h >> w >> k;
vector<vector<ll>> val(h,vector<ll>(w));
rep(i,k){
int a,b;
ll x;
cin >> a >> b >> x;
val[a-1][b-1] = x;
}
ll ans = 0;
for (int i = 0; i < h;i++){
for (int j = 0; j < w;j++){
for (int x = 0; x < h;x++){
for (int y = 0; y < w;y++){
if (x+y >= i+j && x-y >= i-j){
ans += val[x][y];
ans%=mod;
}
}
}
}
}
cout << ans << endl;
return 0;
}