結果

問題 No.2226 Hello, Forgotten World!
ユーザー planesplanes
提出日時 2023-02-24 22:16:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 662 bytes
コンパイル時間 1,564 ms
コンパイル使用メモリ 168,384 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 06:23:59
合計ジャッジ時間 2,906 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

  #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;
}
0