結果

問題 No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
ユーザー SSRSSSRS
提出日時 2021-10-29 21:51:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 937 bytes
コンパイル時間 1,790 ms
コンパイル使用メモリ 172,476 KB
実行使用メモリ 48,896 KB
最終ジャッジ日時 2024-04-16 14:39:36
合計ジャッジ時間 39,591 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,624 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 4 ms
5,376 KB
testcase_05 AC 4 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 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 8 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 423 ms
12,288 KB
testcase_15 AC 1,828 ms
26,624 KB
testcase_16 AC 2,650 ms
34,816 KB
testcase_17 AC 1,659 ms
25,856 KB
testcase_18 AC 1,258 ms
22,016 KB
testcase_19 AC 2,226 ms
32,000 KB
testcase_20 AC 506 ms
13,568 KB
testcase_21 AC 2,015 ms
30,208 KB
testcase_22 AC 861 ms
17,536 KB
testcase_23 AC 931 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 <bits/stdc++.h>
using namespace std;
int main(){
  int N, M;
  cin >> N >> M;
  vector<int> P(N);
  for (int i = 0; i < N; i++){
    cin >> P[i];
  }
  vector<int> a(N), b(N);
  for (int i = 0; i < N; i++){
    cin >> a[i] >> b[i];
  }
  vector<int> c(M), d(M);
  for (int i = 0; i < M; i++){
    cin >> c[i] >> d[i];
  }
  int ans = 0;
  for (int i = 0; i < 2; i++){
    for (int j = 0; j < 2; j++){
      map<pair<int, int>, int> mp2;
      for (int k = 0; k < M; k++){
        for (int l = 0; l < N; l++){
          int x;
          if (i == 0){
            x = a[l] - c[k];
          } else {
            x = a[l] + c[k];
          }
          int y;
          if (j == 0){
            y = b[l] - d[k];
          } else {
            y  = b[l] + d[k];
          }
          mp2[make_pair(x, y)] += P[l];
        }
      }
      for (auto p : mp2){
        ans = max(ans, p.second);
      }
    }
  }
  cout << ans << endl;
}
0