結果

問題 No.2644 Iro Iro-Iro
ユーザー shobonvipshobonvip
提出日時 2024-02-16 04:47:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 641 bytes
コンパイル時間 3,551 ms
コンパイル使用メモリ 224,400 KB
実行使用メモリ 12,820 KB
最終ジャッジ日時 2024-02-16 04:47:40
合計ジャッジ時間 12,759 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 3 ms
6,676 KB
testcase_03 AC 144 ms
6,676 KB
testcase_04 AC 232 ms
6,676 KB
testcase_05 AC 145 ms
6,676 KB
testcase_06 AC 15 ms
6,676 KB
testcase_07 AC 217 ms
6,676 KB
testcase_08 AC 70 ms
6,676 KB
testcase_09 AC 28 ms
6,676 KB
testcase_10 AC 30 ms
6,676 KB
testcase_11 AC 14 ms
6,676 KB
testcase_12 AC 23 ms
6,676 KB
testcase_13 AC 591 ms
6,676 KB
testcase_14 AC 790 ms
6,676 KB
testcase_15 AC 717 ms
6,676 KB
testcase_16 AC 731 ms
6,676 KB
testcase_17 AC 974 ms
6,676 KB
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx")
#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);
	for (int i=0; i<n; i++){
		cin >> a[i] >> b[i] >> c[i];
	}
	for (int i=0; i<m; i++){
		cin >> x[i] >> y[i] >> z[i];
	}
	B moto;
	for (int i=0; i<n; i++){
		moto[a[i] + b[i] * 101 + c[i] * 101 * 101] = 1;
	}
	int ans = 0;
	for (int i=0; i<m; i++){
		ans = max(ans, 2 * n - (int)(moto & (moto >> abs(x[i] + y[i] * 101 + z[i] * 101 * 101))).count());
	}
	cout << ans << '\n';
}
0