結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,420 KB
testcase_01 AC 2 ms
5,532 KB
testcase_02 AC 2 ms
5,856 KB
testcase_03 AC 2 ms
5,656 KB
testcase_04 WA -
testcase_05 AC 2 ms
5,836 KB
testcase_06 AC 2 ms
5,568 KB
testcase_07 AC 2 ms
5,692 KB
testcase_08 AC 3 ms
5,800 KB
testcase_09 WA -
testcase_10 AC 2 ms
5,496 KB
testcase_11 AC 2 ms
5,540 KB
testcase_12 AC 3 ms
5,560 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 WA -
testcase_24 AC 2 ms
5,436 KB
testcase_25 AC 181 ms
36,872 KB
testcase_26 WA -
testcase_27 AC 179 ms
36,940 KB
testcase_28 AC 113 ms
36,100 KB
testcase_29 AC 115 ms
36,208 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[2001][2001];
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)rx=H;
		if(ry>W)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