結果

問題 No.1490 スライムと爆弾
ユーザー kotatsugamekotatsugame
提出日時 2021-04-24 04:17:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 765 bytes
コンパイル時間 505 ms
コンパイル使用メモリ 65,780 KB
実行使用メモリ 37,084 KB
最終ジャッジ日時 2023-09-17 13:24:42
合計ジャッジ時間 4,147 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,432 KB
testcase_01 AC 2 ms
5,424 KB
testcase_02 AC 2 ms
5,896 KB
testcase_03 AC 2 ms
5,664 KB
testcase_04 WA -
testcase_05 AC 2 ms
5,824 KB
testcase_06 AC 2 ms
5,612 KB
testcase_07 AC 3 ms
5,656 KB
testcase_08 AC 2 ms
5,820 KB
testcase_09 WA -
testcase_10 AC 2 ms
5,536 KB
testcase_11 AC 2 ms
5,500 KB
testcase_12 AC 2 ms
5,700 KB
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 AC 2 ms
5,428 KB
testcase_24 AC 2 ms
5,528 KB
testcase_25 AC 178 ms
36,948 KB
testcase_26 WA -
testcase_27 AC 176 ms
36,932 KB
testcase_28 AC 114 ms
36,408 KB
testcase_29 AC 116 ms
36,184 KB
testcase_30 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int H,W,N,M;
int T[1<<17],U[1<<17],L[1<<17],R[1<<17],A[1<<17];
long S[2002][2002];
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;
		int lx=x-b,rx=x+b+1,ly=y-b,ry=y+b+1;
		if(lx<0)lx=0;
		if(ly<0)ly=0;
		if(rx>H+1)rx=H;
		if(ry>W+1)ry=W;
		S[lx][ly]+=c;
		S[lx][ry]-=c;
		S[rx][ly]-=c;
		S[rx][ry]+=c;
	}
	for(int _=0;_<2;_++)
	{
		for(int i=0;i<=H;i++)for(int j=0;j<=W;j++)
		{
			if(i)S[i][j]+=S[i-1][j];
			if(j)S[i][j]+=S[i][j-1];
			if(i&&j)S[i][j]-=S[i-1][j-1];
		}
	}
	int cnt=0;
	for(int i=0;i<N;i++)
	{
		if(S[U[i]][R[i]]-S[U[i]][L[i]]-S[T[i]][R[i]]+S[T[i]][L[i]]<A[i])cnt++;
	}
	cout<<cnt<<endl;
}
0