結果

問題 No.1726 [Cherry 3rd Tune B] ジャマイカビアポン
ユーザー 👑 tatyamtatyam
提出日時 2021-10-29 02:44:14
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 809 bytes
コンパイル時間 5,092 ms
コンパイル使用メモリ 332,624 KB
実行使用メモリ 45,788 KB
最終ジャッジ日時 2024-04-16 13:51:08
合計ジャッジ時間 9,984 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,624 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 20 ms
5,376 KB
testcase_05 AC 24 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 6 ms
5,376 KB
testcase_11 AC 22 ms
5,376 KB
testcase_12 AC 112 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 97 ms
27,860 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
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 #

#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
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;
    __gnu_pbds::gp_hash_table<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