結果
| 問題 | No.1490 スライムと爆弾 | 
| コンテスト | |
| ユーザー |  kwm_t | 
| 提出日時 | 2021-04-25 01:34:21 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,790 bytes | 
| コンパイル時間 | 1,551 ms | 
| コンパイル使用メモリ | 169,952 KB | 
| 実行使用メモリ | 67,712 KB | 
| 最終ジャッジ日時 | 2024-07-04 09:20:51 | 
| 合計ジャッジ時間 | 4,654 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 7 WA * 21 | 
ソースコード
#include "bits/stdc++.h"
//#include "atcoder/all"
using namespace std;
//using namespace atcoder;
//using mint = modint1000000007;
//const int mod = 1000000007;
//using mint = modint998244353;
//const int mod = 998244353;
//const int INF = 1e9;
//const long long LINF = 1e18;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i,l,r)for(int i=(l);i<(r);++i)
#define rrep(i, n) for (int i = (n-1); i >= 0; --i)
#define rrep2(i,l,r)for(int i=(r-1);i>=(l);--i)
#define all(x) (x).begin(),(x).end()
#define allR(x) (x).rbegin(),(x).rend()
#define endl "\n"
long long imos[2002][2002];
long long sum[2002][2002];
int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int h, w, n, m; cin >> h >> w >> n >> m;
	vector<int>t(n), u(n), l(n), r(n), a(n);
	rep(i, n) {
		cin >> t[i] >> u[i] >> l[i] >> r[i] >> a[i];
	}
	rep(i, m) {
		int x, y, b, c; cin >> x >> y >> b >> c;
		imos[max(1, x - b)][max(1, y - b)] += c;
		imos[min(h, x + b + 1)][min(w, y + b + 1)] += c;
		imos[max(1, x - b)][min(w, y + b + 1)] -= c;
		imos[min(h, x + b + 1)][max(1, y - b)] -= c;
	}
	rep2(i, 1, h + 1) {
		rep2(j, 1, w + 1) {
			imos[i][j + 1] += imos[i][j];
		}
	}
	rep2(i, 1, w + 1) {
		rep2(j, 1, h + 1) {
			imos[j + 1][i] += imos[j][i];
		}
	}
	rep2(i, 1, h + 1) {
		rep2(j, 1, w + 1) {
			sum[i][j] = sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1] + imos[i][j];
		}
	}
	if (false) {
		rep(i, h + 1) {
			rep(j, w + 1) {
				cout << imos[i][j] << " ";
			}
			cout << endl;
		}
		cout << endl;
		rep(i, h + 1) {
			rep(j, w + 1) {
				cout << sum[i][j] << " ";
			}
			cout << endl;
		}
	}
	int ans = 0;
	rep(i, n) {
		int att = sum[u[i]][r[i]] - sum[u[i]][l[i] - 1] - sum[t[i] - 1][r[i]] + sum[t[i] - 1][l[i] - 1];
		a[i] -= att;
		if (a[i] > 0) ans++;
	}
	cout << ans << endl;
	return 0;
}
            
            
            
        