結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 4 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 4 ms
5,376 KB
testcase_12 AC 8 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 250 ms
12,160 KB
testcase_15 AC 1,148 ms
27,008 KB
testcase_16 AC 1,734 ms
35,200 KB
testcase_17 AC 1,035 ms
26,240 KB
testcase_18 AC 829 ms
22,272 KB
testcase_19 AC 1,488 ms
31,872 KB
testcase_20 AC 311 ms
13,824 KB
testcase_21 AC 1,413 ms
30,336 KB
testcase_22 AC 561 ms
17,664 KB
testcase_23 AC 567 ms
18,432 KB
testcase_24 AC 2,454 ms
43,520 KB
testcase_25 AC 2,392 ms
43,648 KB
testcase_26 AC 2,421 ms
43,520 KB
testcase_27 AC 2,366 ms
43,648 KB
testcase_28 AC 2,345 ms
43,648 KB
testcase_29 AC 2,344 ms
43,648 KB
testcase_30 AC 2,458 ms
43,776 KB
testcase_31 AC 2,346 ms
43,648 KB
testcase_32 AC 2,351 ms
43,648 KB
testcase_33 AC 2,383 ms
43,776 KB
testcase_34 AC 2 ms
5,376 KB
testcase_35 AC 1 ms
5,376 KB
testcase_36 AC 1 ms
5,376 KB
testcase_37 AC 1 ms
5,376 KB
testcase_38 AC 122 ms
5,376 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(pair<pair<int,int>,int>p:mp)if(ans<p.second)ans=p.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