結果
| 問題 | 
                            No.2644 Iro Iro-Iro
                             | 
                    
| コンテスト | |
| ユーザー | 
                             shobonvip
                         | 
                    
| 提出日時 | 2024-02-16 04:41:13 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 641 bytes | 
| コンパイル時間 | 2,419 ms | 
| コンパイル使用メモリ | 220,976 KB | 
| 最終ジャッジ日時 | 2025-02-19 13:24:12 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 14 TLE * 2 -- * 14 | 
ソースコード
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
typedef bitset<1030301> B;
int main(){
	int n, m; cin >> n >> m;
	vector<int> a(n), b(n), c(n);
	vector<int> x(m), y(m), z(m);
	B moto;
	for (int i=0; i<n; i++){
		cin >> a[i] >> b[i] >> c[i];
		moto[a[i] + b[i] * 101 + c[i] * 101 * 101] = 1;
	}
	int ans = 0;
	for (int i=0; i<m; i++){
		cin >> x[i] >> y[i] >> z[i];
		int t = x[i] + y[i] * 101 + z[i] * 101 * 101;
		if (t >= 0){
			ans = max(ans, (int)(moto | (moto << t)).count());
		}else{
			ans = max(ans, (int)(moto | (moto >> -t)).count());
		}
	}
	cout << ans << '\n';
}
            
            
            
        
            
shobonvip