結果

問題 No.2644 Iro Iro-Iro
ユーザー noya2noya2
提出日時 2024-02-13 04:10:07
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 308 ms / 2,000 ms
コード長 694 bytes
コンパイル時間 5,475 ms
コンパイル使用メモリ 316,880 KB
実行使用メモリ 31,876 KB
最終ジャッジ日時 2024-02-13 17:36:45
合計ジャッジ時間 15,255 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
31,876 KB
testcase_01 AC 159 ms
31,876 KB
testcase_02 AC 158 ms
31,876 KB
testcase_03 AC 170 ms
31,876 KB
testcase_04 AC 180 ms
31,876 KB
testcase_05 AC 171 ms
31,876 KB
testcase_06 AC 162 ms
31,876 KB
testcase_07 AC 174 ms
31,876 KB
testcase_08 AC 166 ms
31,876 KB
testcase_09 AC 159 ms
31,876 KB
testcase_10 AC 161 ms
31,876 KB
testcase_11 AC 170 ms
31,876 KB
testcase_12 AC 173 ms
31,876 KB
testcase_13 AC 277 ms
31,876 KB
testcase_14 AC 280 ms
31,876 KB
testcase_15 AC 281 ms
31,876 KB
testcase_16 AC 304 ms
31,876 KB
testcase_17 AC 284 ms
31,876 KB
testcase_18 AC 278 ms
31,876 KB
testcase_19 AC 278 ms
31,876 KB
testcase_20 AC 302 ms
31,876 KB
testcase_21 AC 276 ms
31,876 KB
testcase_22 AC 275 ms
31,876 KB
testcase_23 AC 286 ms
31,876 KB
testcase_24 AC 308 ms
31,876 KB
testcase_25 AC 291 ms
31,876 KB
testcase_26 AC 299 ms
31,876 KB
testcase_27 AC 285 ms
31,876 KB
testcase_28 AC 181 ms
31,876 KB
testcase_29 AC 305 ms
31,876 KB
testcase_30 AC 249 ms
31,876 KB
testcase_31 AC 249 ms
31,876 KB
testcase_32 AC 265 ms
31,876 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