結果

問題 No.2644 Iro Iro-Iro
ユーザー shobonvipshobonvip
提出日時 2024-02-16 05:41:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 814 bytes
コンパイル時間 4,678 ms
コンパイル使用メモリ 236,052 KB
実行使用メモリ 232,772 KB
最終ジャッジ日時 2024-02-16 05:42:32
合計ジャッジ時間 74,312 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,927 ms
229,652 KB
testcase_01 AC 1,897 ms
229,652 KB
testcase_02 AC 1,877 ms
229,656 KB
testcase_03 AC 1,966 ms
229,924 KB
testcase_04 AC 1,965 ms
229,968 KB
testcase_05 AC 1,909 ms
229,960 KB
testcase_06 AC 1,898 ms
229,728 KB
testcase_07 AC 1,916 ms
229,980 KB
testcase_08 AC 1,918 ms
229,852 KB
testcase_09 AC 1,891 ms
229,680 KB
testcase_10 AC 1,896 ms
229,688 KB
testcase_11 AC 1,934 ms
229,756 KB
testcase_12 AC 1,896 ms
229,676 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 AC 1,916 ms
229,652 KB
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 AC 1,999 ms
231,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/convolution>
#include<atcoder/modint>
typedef atcoder::static_modint<754974721> mint;

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];
	}
	
	vector<mint> f(201 * 201 * 201);
	vector<mint> g(201 * 201 * 201);
	for (int i=0; i<n; i++){
		f[a[i] + b[i] * 201 + c[i] * 201 * 201] += 1;
		g[100 - a[i] + (100 - b[i]) * 201 + (100 - c[i]) * 201 * 201] += 1;
	}
	vector<mint> h = atcoder::convolution<mint>(f, g);
	int ans = 0;
	for (int i=0; i<m; i++){
		int t = h[(x[i] + 100) + (y[i] + 100) * 201 + (z[i] + 100) * 201 * 201].val();
		ans = max(ans, 2 * n - t);
	}
	cout << ans << '\n';
}
0