結果

問題 No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
ユーザー kotatsugamekotatsugame
提出日時 2021-11-06 01:04:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2,317 ms / 3,000 ms
コード長 642 bytes
コンパイル時間 630 ms
コンパイル使用メモリ 83,328 KB
実行使用メモリ 43,520 KB
最終ジャッジ日時 2024-04-27 11:07:20
合計ジャッジ時間 32,957 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 3 ms
6,944 KB
testcase_05 AC 3 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 4 ms
6,940 KB
testcase_12 AC 9 ms
6,944 KB
testcase_13 AC 1 ms
6,944 KB
testcase_14 AC 239 ms
12,160 KB
testcase_15 AC 994 ms
26,880 KB
testcase_16 AC 1,595 ms
34,944 KB
testcase_17 AC 971 ms
26,112 KB
testcase_18 AC 699 ms
22,016 KB
testcase_19 AC 1,371 ms
31,616 KB
testcase_20 AC 303 ms
13,824 KB
testcase_21 AC 1,304 ms
30,080 KB
testcase_22 AC 482 ms
17,536 KB
testcase_23 AC 508 ms
18,176 KB
testcase_24 AC 2,239 ms
43,392 KB
testcase_25 AC 2,308 ms
43,520 KB
testcase_26 AC 2,229 ms
43,392 KB
testcase_27 AC 2,293 ms
43,392 KB
testcase_28 AC 2,241 ms
43,520 KB
testcase_29 AC 2,227 ms
43,520 KB
testcase_30 AC 2,226 ms
43,392 KB
testcase_31 AC 2,261 ms
43,392 KB
testcase_32 AC 2,317 ms
43,520 KB
testcase_33 AC 2,216 ms
43,520 KB
testcase_34 AC 2 ms
6,940 KB
testcase_35 AC 1 ms
6,944 KB
testcase_36 AC 2 ms
6,944 KB
testcase_37 AC 1 ms
6,940 KB
testcase_38 AC 124 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:10:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   10 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
int N,M;
int P[800];
int X[800],Y[800],A[800],B[800];
int ans;
main()
{
	cin>>N>>M;
	for(int i=0;i<N;i++)cin>>P[i];
	for(int i=0;i<N;i++)cin>>X[i]>>Y[i];
	for(int i=0;i<M;i++)cin>>A[i]>>B[i];
	map<pair<int,int>,int>mp;
	for(int x=0;x<2;x++)
	{
		for(int y=0;y<2;y++)
		{
			mp.clear();
			for(int i=0;i<N;i++)for(int j=0;j<M;j++)
			{
				mp[make_pair(X[i]-A[j],Y[i]-B[j])]+=P[i];
			}
			for(auto it=mp.begin();it!=mp.end();it++)ans=max(ans,it->second);
			for(int i=0;i<M;i++)B[i]=-B[i];
		}
		for(int i=0;i<M;i++)A[i]=-A[i];
	}
	cout<<ans<<endl;
}
0