結果
| 問題 |
No.2226 Hello, Forgotten World!
|
| コンテスト | |
| ユーザー |
planes
|
| 提出日時 | 2023-02-24 22:16:14 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 662 bytes |
| コンパイル時間 | 1,582 ms |
| コンパイル使用メモリ | 171,896 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-13 05:37:45 |
| 合計ジャッジ時間 | 2,485 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
ll mod=998244353;
int main() {
ll H,W,K;cin>>H>>W>>K;
vector<vector<ll>> note(H,vector<ll> (W,0));
for(ll i=0;i<K;i++) {
ll x,y,v;cin>>x>>y>>v;
x--;y--;
note[x][y]+=v;
}
ll ans=0;
for(ll i=0;i<H;i++) {
for(ll j=0;j<W;j++) {
for(ll h=0;h<H;h++) {
for(ll k=0;k<W;k++) {
if(h+k>=i+j&&h-k>=i-j) {
ans+=note[h][k];
ans%=mod;
}
}
}
}
}
cout<<ans<<endl;
}
planes