結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 5 ms
5,376 KB
testcase_05 AC 5 ms
5,376 KB
testcase_06 AC 2 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 8 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 741 ms
20,352 KB
testcase_15 AC 2,313 ms
41,728 KB
testcase_16 TLE -
testcase_17 AC 2,190 ms
40,960 KB
testcase_18 AC 1,713 ms
35,328 KB
testcase_19 AC 2,831 ms
47,232 KB
testcase_20 AC 839 ms
23,040 KB
testcase_21 AC 2,673 ms
45,184 KB
testcase_22 AC 1,255 ms
28,928 KB
testcase_23 AC 1,327 ms
30,208 KB
testcase_24 TLE -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
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<int, map<int, int>> mp;
      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];
          }
          mp[x][y] += P[l];
        }
      }
      for (auto x : mp){
        for (auto y : x.second){
          ans = max(ans, y.second);
        }
      }
    }
  }
  cout << ans << endl;
}
0