結果

問題 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,926 ms
コンパイル使用メモリ 269,720 KB
実行使用メモリ 48,768 KB
最終ジャッジ日時 2024-04-29 16:16:26
合計ジャッジ時間 27,379 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,752 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 4 ms
5,376 KB
testcase_05 AC 5 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 3 ms
5,376 KB
testcase_11 AC 4 ms
5,376 KB
testcase_12 AC 9 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 424 ms
12,160 KB
testcase_15 AC 1,650 ms
26,624 KB
testcase_16 AC 2,659 ms
34,944 KB
testcase_17 AC 1,550 ms
25,856 KB
testcase_18 AC 1,119 ms
21,760 KB
testcase_19 AC 2,091 ms
31,488 KB
testcase_20 AC 508 ms
13,568 KB
testcase_21 AC 1,851 ms
29,952 KB
testcase_22 AC 807 ms
17,408 KB
testcase_23 AC 848 ms
18,048 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 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
権限があれば一括ダウンロードができます

ソースコード

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