結果

問題 No.60 魔法少女
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2019-09-09 20:30:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,130 bytes
コンパイル時間 1,473 ms
コンパイル使用メモリ 170,052 KB
実行使用メモリ 20,920 KB
最終ジャッジ日時 2023-09-10 23:55:58
合計ジャッジ時間 4,934 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
20,660 KB
testcase_01 AC 30 ms
20,852 KB
testcase_02 AC 29 ms
20,712 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = (int)(n); i >= 0; i--)
#define FOR(i,n,m) for(int i = (int)(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = MOD - 1;
const ll LLINF = 4e18;

int main() {
    int n, k; cin >> n >> k;
    vector<vector<ll>> grid(1502, vector<ll>(1502,0));
    REP(i, n) {
        int x, y, hp; cin >> x >> y >> hp;
        grid[x + 500][y + 500] += hp;
    }
    REP(i, k) {
        int ax, ay, w, h, d; cin >> ax >> ay >> w >> h >> d;
        grid[ax + 500][ay + 500] -= d;
        grid[ax + w + 501][ay + h + 501] -= d;
        grid[ax + w + 501][ay + 500] -= d;
        grid[ax + 500][ay + h + 501] -= d;
    }
    REP(i, 1502) {
        FOR(j, 1, 1502) {
            grid[i][j] += grid[i][j - 1];
        }
    }
    REP(i, 1502) {
        FOR(j, 1, 1502) {
            grid[j][i] += grid[j - 1][i];
        }
    }
    cout << max(0LL,grid[1501][1501]) << endl;
    getchar(); getchar();
}
0