結果
問題 |
No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
|
ユーザー |
|
提出日時 | 2021-10-29 23:22:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 980 bytes |
コンパイル時間 | 1,682 ms |
コンパイル使用メモリ | 177,996 KB |
実行使用メモリ | 10,144 KB |
最終ジャッジ日時 | 2024-10-07 13:00:39 |
合計ジャッジ時間 | 6,596 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 TLE * 1 -- * 24 |
ソースコード
#include <bits/stdc++.h> #define rep(i, l, r) for (int i = (l); i < (r); i++) using namespace std; typedef long long ll; int main() { int N, M, ans = 0; cin >> N >> M; vector<int> P(N), a(N), b(N), c(M), d(M); rep(i, 0, N) cin >> P[i]; map<pair<int, int>, int> mp; rep(i, 0, N) { cin >> a[i] >> b[i]; mp[make_pair(a[i], b[i])] = P[i]; } rep(i, 0, M) cin >> c[i] >> d[i]; rep(i, 0, 4) { if (i % 2) { rep(j, 0, M) c[j] *= -1; } if (i == 2) { rep(j, 0, M) d[j] *= -1; } rep(j, 0, N) { rep(k, 0, M) { int dx = a[j] - c[k], dy = b[j] - d[k], s = 0; rep(l, 0, M) { if (mp.find(make_pair(c[l] + dx, d[l] + dy)) == mp.end()) continue; s += mp[make_pair(c[l] + dx, d[l] + dy)]; } ans = max(ans, s); } } } cout << ans << endl; }