結果

問題 No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
ユーザー 👑 tatyamtatyam
提出日時 2021-10-29 02:16:04
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,127 ms / 3,000 ms
コード長 878 bytes
コンパイル時間 5,360 ms
コンパイル使用メモリ 278,024 KB
実行使用メモリ 28,792 KB
最終ジャッジ日時 2024-04-27 01:58:23
合計ジャッジ時間 21,652 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 3 ms
6,944 KB
testcase_05 AC 3 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 3 ms
6,944 KB
testcase_12 AC 4 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 89 ms
8,960 KB
testcase_15 AC 475 ms
22,508 KB
testcase_16 AC 771 ms
24,560 KB
testcase_17 AC 464 ms
22,564 KB
testcase_18 AC 293 ms
15,148 KB
testcase_19 AC 669 ms
22,980 KB
testcase_20 AC 107 ms
9,728 KB
testcase_21 AC 620 ms
22,600 KB
testcase_22 AC 190 ms
13,024 KB
testcase_23 AC 180 ms
13,352 KB
testcase_24 AC 1,045 ms
28,792 KB
testcase_25 AC 1,034 ms
28,788 KB
testcase_26 AC 1,127 ms
28,788 KB
testcase_27 AC 1,118 ms
28,784 KB
testcase_28 AC 1,122 ms
28,792 KB
testcase_29 AC 1,094 ms
28,792 KB
testcase_30 AC 1,058 ms
28,788 KB
testcase_31 AC 1,123 ms
28,788 KB
testcase_32 AC 1,086 ms
28,788 KB
testcase_33 AC 1,065 ms
28,792 KB
testcase_34 AC 2 ms
6,940 KB
testcase_35 AC 2 ms
6,940 KB
testcase_36 AC 2 ms
6,940 KB
testcase_37 AC 2 ms
6,944 KB
testcase_38 AC 33 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#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;
    unordered_map<uint64_t, int> cnt;
    for(auto [s, t] : vector<pair<int, int>>{{1, 1}, {1, -1}, {-1, 1}, {-1, -1}}){
        cnt.clear();
        for(int i = 0; i < N; i++){
            auto [a, b] = A[i];
            for(auto [c, d] : B) cnt[uint64_t(c - s * a) << 32 ^ (d - t * b)] += P[i];
        }
        for(auto [key, val] : cnt) chmax(ans, val);
    }
    cout << ans << endl;
}
0