結果

問題 No.2644 Iro Iro-Iro
ユーザー てんぷらてんぷら
提出日時 2024-02-19 22:26:14
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 723 ms / 2,000 ms
コード長 956 bytes
コンパイル時間 4,373 ms
コンパイル使用メモリ 306,916 KB
実行使用メモリ 100,272 KB
最終ジャッジ日時 2024-02-19 22:26:46
合計ジャッジ時間 29,202 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 657 ms
100,268 KB
testcase_01 AC 642 ms
100,268 KB
testcase_02 AC 655 ms
100,268 KB
testcase_03 AC 638 ms
100,272 KB
testcase_04 AC 668 ms
100,272 KB
testcase_05 AC 643 ms
100,272 KB
testcase_06 AC 682 ms
100,272 KB
testcase_07 AC 658 ms
100,272 KB
testcase_08 AC 682 ms
100,272 KB
testcase_09 AC 664 ms
100,272 KB
testcase_10 AC 656 ms
100,272 KB
testcase_11 AC 662 ms
100,272 KB
testcase_12 AC 647 ms
100,272 KB
testcase_13 AC 701 ms
100,272 KB
testcase_14 AC 682 ms
100,272 KB
testcase_15 AC 707 ms
100,272 KB
testcase_16 AC 688 ms
100,272 KB
testcase_17 AC 706 ms
100,272 KB
testcase_18 AC 723 ms
100,272 KB
testcase_19 AC 682 ms
100,272 KB
testcase_20 AC 723 ms
100,272 KB
testcase_21 AC 678 ms
100,272 KB
testcase_22 AC 695 ms
100,272 KB
testcase_23 AC 678 ms
100,272 KB
testcase_24 AC 702 ms
100,272 KB
testcase_25 AC 691 ms
100,272 KB
testcase_26 AC 702 ms
100,272 KB
testcase_27 AC 688 ms
100,272 KB
testcase_28 AC 663 ms
100,268 KB
testcase_29 AC 709 ms
100,272 KB
testcase_30 AC 663 ms
100,272 KB
testcase_31 AC 696 ms
100,272 KB
testcase_32 AC 668 ms
100,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/all>
#include <bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
using namespace std;
using namespace atcoder;
using mint = modint998244353;
const int inf = 1000000007;
const ll longinf = 1ll << 60;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, m;
    cin >> n >> m;
    int b = 101;
    int all = b * b * b;
    vector<ll> a(all + 1), ra(all + 1);
    rep(i, n) {
        int x, y, z;
        cin >> x >> y >> z;
        int val = b * b * x + b * y + z;
        a[val]++;
        ra[all - val]++;
    }
    auto ret = convolution_ll(a, ra);
    int mi = n;
    rep(i, m) {
        int x, y, z;
        cin >> x >> y >> z;
        int val = b * b * x + b * y + z;
        mi = min(mi, (int)ret[all + val]);
    }
    cout << 2 * n - mi << endl;
    return 0;
}
0