結果
問題 | No.1490 スライムと爆弾 |
ユーザー | chocorusk |
提出日時 | 2021-04-23 22:03:02 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,748 bytes |
コンパイル時間 | 3,320 ms |
コンパイル使用メモリ | 188,136 KB |
実行使用メモリ | 68,912 KB |
最終ジャッジ日時 | 2023-09-17 12:14:52 |
合計ジャッジ時間 | 8,202 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
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 | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
ソースコード
#include <cstdio> #include <cstring> #include <iostream> #include <string> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <complex> #include <unordered_map> #include <unordered_set> #include <random> #include <cassert> #include <fstream> #include <utility> #include <functional> #include <time.h> #include <stack> #include <array> #include <list> #include <atcoder/all> #define popcount __builtin_popcount using namespace std; using namespace atcoder; typedef long long ll; typedef pair<int, int> P; int h, w, n, m; ll s[2020][2020]; ll sum[2020][2020]; int t[100010], u[100010], l[100010], r[100010], a[100010]; int main() { cin>>h>>w>>n>>m; for(int i=0; i<n; i++){ cin>>t[i]>>u[i]>>l[i]>>r[i]>>a[i]; t[i]--; l[i]--; } for(int i=0; i<m; i++){ int x, y, b, c; cin>>x>>y>>b>>c; x--; y--; int l1=max(0, x-b), r1=min(h, x+b+1), l2=max(0, y-b), r2=min(w, y+b+1); cout<<l1<<" "<<r1<<" "<<l2<<" "<<r2<<endl; s[l1][l2]+=c; s[l1][r2]-=c; s[r1][l2]-=c; s[r1][r2]+=c; } //for(int i=0; i<h; i++) for(int j=0; j<w; j++) cout<<s[i][j]<<endl; for(int i=0; i<h; i++) for(int j=0; j<w; j++) s[i][j+1]+=s[i][j]; for(int j=0; j<w; j++) for(int i=0; i<h; i++) s[i+1][j]+=s[i][j]; for(int i=0; i<h; i++) for(int j=0; j<w; j++) sum[i+1][j+1]=sum[i+1][j]+sum[i][j+1]-sum[i][j]+s[i][j]; int ans=0; for(int i=0; i<n; i++){ //cout<<sum[u[i]][r[i]]-sum[u[i]][l[i]]-sum[t[i]][r[i]]+sum[t[i]][l[i]]<<endl; if(sum[u[i]][r[i]]-sum[u[i]][l[i]]-sum[t[i]][r[i]]+sum[t[i]][l[i]]<a[i]) ans++; } cout<<ans<<endl; return 0; }