結果

問題 No.2644 Iro Iro-Iro
ユーザー noya2noya2
提出日時 2024-02-19 21:01:16
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2,883 ms / 2,000 ms
コード長 760 bytes
コンパイル時間 5,571 ms
コンパイル使用メモリ 316,892 KB
実行使用メモリ 374,208 KB
最終ジャッジ日時 2024-02-19 21:03:03
合計ジャッジ時間 97,679 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,547 ms
374,208 KB
testcase_01 AC 2,544 ms
374,208 KB
testcase_02 AC 2,548 ms
374,208 KB
testcase_03 AC 2,547 ms
374,208 KB
testcase_04 AC 2,590 ms
374,208 KB
testcase_05 AC 2,883 ms
374,208 KB
testcase_06 AC 2,561 ms
374,208 KB
testcase_07 AC 2,566 ms
374,208 KB
testcase_08 AC 2,538 ms
374,208 KB
testcase_09 AC 2,522 ms
374,208 KB
testcase_10 AC 2,552 ms
374,208 KB
testcase_11 AC 2,524 ms
374,208 KB
testcase_12 AC 2,529 ms
374,208 KB
testcase_13 AC 2,637 ms
374,208 KB
testcase_14 AC 2,648 ms
374,208 KB
testcase_15 AC 2,657 ms
374,208 KB
testcase_16 AC 2,651 ms
374,208 KB
testcase_17 AC 2,661 ms
374,208 KB
testcase_18 AC 2,682 ms
374,208 KB
testcase_19 AC 2,707 ms
374,208 KB
testcase_20 AC 2,682 ms
374,208 KB
testcase_21 AC 2,646 ms
374,208 KB
testcase_22 AC 2,647 ms
374,208 KB
testcase_23 AC 2,659 ms
374,208 KB
testcase_24 AC 2,654 ms
374,208 KB
testcase_25 AC 2,691 ms
374,208 KB
testcase_26 AC 2,671 ms
374,208 KB
testcase_27 AC 2,717 ms
374,208 KB
testcase_28 AC 2,552 ms
374,208 KB
testcase_29 AC 2,678 ms
374,208 KB
testcase_30 AC 2,645 ms
374,208 KB
testcase_31 AC 2,641 ms
374,208 KB
testcase_32 AC 2,661 ms
374,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using mint = atcoder::static_modint<1107296257>;
// using mint = atcoder::modint998244353;

const int mx = 210;
const int tot = mx*mx*mx;

int colid(int a, int b, int c){
    return a + b*mx + c*mx*mx;
}

int main(){
    int n, m; cin >> n >> m;
    vector<mint> f(tot,0);
    for (int i = 0; i < n; i++){
        int a, b, c; cin >> a >> b >> c;
        f[colid(a,b,c)] = 1;
    }
    auto g = f;
    reverse(g.begin(),g.end());
    auto fg = atcoder::convolution(f,g);
    int ans = 0;
    for (int i = 0; i < m; i++){
        int x, y, z; cin >> x >> y >> z;
        int d = colid(x,y,z);
        int sum = fg[tot-1-d].val();
        ans = max(ans,n+n-sum);
    }
    cout << ans << endl;
}
0