結果

問題 No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
ユーザー 👑 tatyamtatyam
提出日時 2021-10-16 19:30:52
言語 C++23(draft)
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 1,834 ms / 3,000 ms
コード長 843 bytes
コンパイル時間 3,809 ms
コンパイル使用メモリ 285,056 KB
実行使用メモリ 33,268 KB
最終ジャッジ日時 2024-04-16 13:49:22
合計ジャッジ時間 30,852 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 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 3 ms
5,376 KB
testcase_05 AC 4 ms
5,376 KB
testcase_06 AC 3 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 6 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 170 ms
9,784 KB
testcase_15 AC 1,039 ms
24,568 KB
testcase_16 AC 1,388 ms
28,928 KB
testcase_17 AC 1,019 ms
24,476 KB
testcase_18 AC 618 ms
16,612 KB
testcase_19 AC 1,252 ms
27,012 KB
testcase_20 AC 224 ms
10,688 KB
testcase_21 AC 1,213 ms
25,852 KB
testcase_22 AC 438 ms
14,900 KB
testcase_23 AC 483 ms
15,836 KB
testcase_24 AC 1,780 ms
30,812 KB
testcase_25 AC 1,834 ms
33,016 KB
testcase_26 AC 1,802 ms
31,864 KB
testcase_27 AC 1,797 ms
31,852 KB
testcase_28 AC 1,817 ms
31,864 KB
testcase_29 AC 1,814 ms
31,980 KB
testcase_30 AC 1,805 ms
33,016 KB
testcase_31 AC 1,792 ms
33,268 KB
testcase_32 AC 1,801 ms
31,476 KB
testcase_33 AC 1,769 ms
31,852 KB
testcase_34 AC 2 ms
5,376 KB
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 2 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 33 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
void chmax(int& a, int b){ if(a < b) a = b; }

int main(){
    int N, M;
    cin >> N >> M;
    vector<int> P(N);
    for(int& p : P) cin >> p;
    int ans = 0;
    vector<pair<int, int>> A(N), B(M);
    for(auto& [a, b] : A) cin >> a >> b;
    for(auto& [c, d] : B) cin >> c >> d;
    for(int i = 0; i < 2; i++){
        for(auto& [a, b] : A) a = -a;
        for(int i = 0; i < 2; i++){
            for(auto& [a, b] : A) b = -b;
            unordered_map<i64, int> cnt;
            for(int i = 0; i < N; i++){
                auto [a, b] = A[i];
                for(auto [c, d] : B){
                    cnt[i64(a - c) << 32 ^ (b - d)] += P[i];
                }
            }
            for(auto [key, val] : cnt) chmax(ans, val);
        }
    }
    cout << ans << endl;
}
0