結果

問題 No.2644 Iro Iro-Iro
ユーザー shobonvipshobonvip
提出日時 2024-02-16 04:41:13
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 641 bytes
コンパイル時間 4,680 ms
コンパイル使用メモリ 223,096 KB
実行使用メモリ 13,480 KB
最終ジャッジ日時 2024-02-16 04:41:37
合計ジャッジ時間 21,444 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
13,480 KB
testcase_01 AC 3 ms
6,676 KB
testcase_02 AC 3 ms
6,676 KB
testcase_03 AC 398 ms
6,676 KB
testcase_04 AC 660 ms
6,676 KB
testcase_05 AC 436 ms
6,676 KB
testcase_06 AC 36 ms
6,676 KB
testcase_07 AC 619 ms
6,676 KB
testcase_08 AC 187 ms
6,676 KB
testcase_09 AC 40 ms
6,676 KB
testcase_10 AC 82 ms
6,676 KB
testcase_11 AC 30 ms
6,676 KB
testcase_12 AC 62 ms
6,676 KB
testcase_13 AC 1,581 ms
6,676 KB
testcase_14 TLE -
testcase_15 AC 1,960 ms
6,676 KB
testcase_16 TLE -
testcase_17 TLE -
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 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';
}
0