結果
| 問題 |
No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-06 01:04:14 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 642 bytes |
| コンパイル時間 | 897 ms |
| コンパイル使用メモリ | 83,608 KB |
| 実行使用メモリ | 43,648 KB |
| 最終ジャッジ日時 | 2024-11-15 12:34:14 |
| 合計ジャッジ時間 | 50,658 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 TLE * 10 |
コンパイルメッセージ
main.cpp:10:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
10 | main()
| ^~~~
ソースコード
#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;
}