結果

問題 No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
ユーザー 沙耶花沙耶花
提出日時 2021-10-29 22:14:27
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 842 bytes
コンパイル時間 4,988 ms
コンパイル使用メモリ 267,816 KB
実行使用メモリ 47,700 KB
最終ジャッジ日時 2023-08-12 01:27:46
合計ジャッジ時間 31,546 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,388 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 4 ms
4,384 KB
testcase_05 AC 4 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 3 ms
4,380 KB
testcase_09 AC 2 ms
4,384 KB
testcase_10 AC 3 ms
4,380 KB
testcase_11 AC 5 ms
4,380 KB
testcase_12 AC 10 ms
4,384 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 549 ms
12,104 KB
testcase_15 AC 1,887 ms
26,688 KB
testcase_16 TLE -
testcase_17 AC 1,824 ms
25,908 KB
testcase_18 AC 1,290 ms
21,536 KB
testcase_19 AC 2,388 ms
31,292 KB
testcase_20 AC 712 ms
13,456 KB
testcase_21 AC 2,140 ms
29,804 KB
testcase_22 AC 1,010 ms
17,404 KB
testcase_23 AC 990 ms
17,836 KB
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 2 ms
4,384 KB
testcase_37 AC 1 ms
4,384 KB
testcase_38 AC 151 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf (long long)1000000000000000000
int n,m;
vector<long long> p;

long long get(vector<int> a,vector<int> b,vector<int> c,vector<int> d){
	map<pair<int,int>,long long> mp;
	rep(i,n){
		rep(j,m){
			mp[make_pair(c[j]-a[i],d[j]-b[i])] += p[i];
		}
	}
	long long ret = 0LL;
	for(auto a:mp)ret = max(ret,a.second);
	return ret;
}

int main(){
	
	cin>>n>>m;
	
	p.resize(n);
	rep(i,n)cin>>p[i];
	
	vector<int> a(n),b(n),c(m),d(m);
	rep(i,n)cin>>a[i]>>b[i];
	rep(i,m)cin>>c[i]>>d[i];
	
	long long ans = 0LL;
	
	rep(i,2){
		rep(j,2){
			ans = max(ans,get(a,b,c,d));
			rep(k,m)c[k] *= -1;
		}
		rep(k,m)d[k] *= -1;
	}
	cout<<ans<<endl;
	
	return 0;
	
}
0