結果

問題 No.2644 Iro Iro-Iro
ユーザー RubikunRubikun
提出日時 2024-02-19 21:54:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 842 ms / 2,000 ms
コード長 1,046 bytes
コンパイル時間 4,840 ms
コンパイル使用メモリ 271,796 KB
実行使用メモリ 197,124 KB
最終ジャッジ日時 2024-02-19 21:54:54
合計ジャッジ時間 35,269 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 786 ms
197,120 KB
testcase_01 AC 772 ms
197,120 KB
testcase_02 AC 757 ms
197,120 KB
testcase_03 AC 748 ms
197,124 KB
testcase_04 AC 801 ms
197,124 KB
testcase_05 AC 754 ms
197,124 KB
testcase_06 AC 773 ms
197,124 KB
testcase_07 AC 750 ms
197,124 KB
testcase_08 AC 758 ms
197,124 KB
testcase_09 AC 743 ms
197,124 KB
testcase_10 AC 740 ms
197,124 KB
testcase_11 AC 759 ms
197,124 KB
testcase_12 AC 742 ms
197,124 KB
testcase_13 AC 796 ms
197,124 KB
testcase_14 AC 826 ms
197,124 KB
testcase_15 AC 802 ms
197,124 KB
testcase_16 AC 813 ms
197,124 KB
testcase_17 AC 825 ms
197,124 KB
testcase_18 AC 791 ms
197,124 KB
testcase_19 AC 823 ms
197,124 KB
testcase_20 AC 793 ms
197,124 KB
testcase_21 AC 807 ms
197,124 KB
testcase_22 AC 807 ms
197,124 KB
testcase_23 AC 815 ms
197,124 KB
testcase_24 AC 808 ms
197,124 KB
testcase_25 AC 808 ms
197,124 KB
testcase_26 AC 816 ms
197,124 KB
testcase_27 AC 842 ms
197,124 KB
testcase_28 AC 756 ms
197,120 KB
testcase_29 AC 807 ms
197,124 KB
testcase_30 AC 814 ms
197,124 KB
testcase_31 AC 814 ms
197,124 KB
testcase_32 AC 804 ms
197,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=1<<30;


int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    const int K=202;
    
    ll N,M;cin>>N>>M;
    vector<ll> A(K*K*K/2),B=A;
    
    for(int i=0;i<N;i++){
        ll a,b,c;cin>>a>>b>>c;
        A[a*K*K+b*K+c]=1;
        B[si(A)-1-(a*K*K+b*K+c)]=1;
    }
    auto C=atcoder::convolution(A,B);
    
    ll mi=INF;
    
    for(int i=0;i<M;i++){
        ll a,b,c;cin>>a>>b>>c;
        chmin(mi,C[si(A)-1+(a*K*K+b*K+c)]);
        //cout<<C[si(A)-1+(a*K*K+b*K+c)]<<endl;
    }
    
    cout<<N+N-mi<<endl;
}

0