結果

問題 No.2644 Iro Iro-Iro
ユーザー noya2noya2
提出日時 2024-02-19 20:31:43
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 308 ms / 2,000 ms
コード長 694 bytes
コンパイル時間 6,550 ms
コンパイル使用メモリ 316,880 KB
実行使用メモリ 32,004 KB
最終ジャッジ日時 2024-02-19 20:32:01
合計ジャッジ時間 17,262 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
32,004 KB
testcase_01 AC 157 ms
32,004 KB
testcase_02 AC 158 ms
32,004 KB
testcase_03 AC 172 ms
32,004 KB
testcase_04 AC 174 ms
32,004 KB
testcase_05 AC 177 ms
32,004 KB
testcase_06 AC 165 ms
32,004 KB
testcase_07 AC 172 ms
32,004 KB
testcase_08 AC 170 ms
32,004 KB
testcase_09 AC 160 ms
32,004 KB
testcase_10 AC 161 ms
32,004 KB
testcase_11 AC 162 ms
32,004 KB
testcase_12 AC 164 ms
32,004 KB
testcase_13 AC 273 ms
32,004 KB
testcase_14 AC 283 ms
32,004 KB
testcase_15 AC 273 ms
32,004 KB
testcase_16 AC 287 ms
32,004 KB
testcase_17 AC 285 ms
32,004 KB
testcase_18 AC 275 ms
32,004 KB
testcase_19 AC 272 ms
32,004 KB
testcase_20 AC 272 ms
32,004 KB
testcase_21 AC 281 ms
32,004 KB
testcase_22 AC 269 ms
32,004 KB
testcase_23 AC 276 ms
32,004 KB
testcase_24 AC 274 ms
32,004 KB
testcase_25 AC 298 ms
32,004 KB
testcase_26 AC 288 ms
32,004 KB
testcase_27 AC 274 ms
32,004 KB
testcase_28 AC 152 ms
32,004 KB
testcase_29 AC 308 ms
32,004 KB
testcase_30 AC 242 ms
32,004 KB
testcase_31 AC 239 ms
32,004 KB
testcase_32 AC 259 ms
32,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

const int tot = 101*101*101;

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

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