結果

問題 No.2644 Iro Iro-Iro
ユーザー kotatsugamekotatsugame
提出日時 2024-02-19 21:28:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 212 ms / 2,000 ms
コード長 619 bytes
コンパイル時間 1,890 ms
コンパイル使用メモリ 111,984 KB
実行使用メモリ 31,900 KB
最終ジャッジ日時 2024-02-19 21:28:49
合計ジャッジ時間 9,128 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
31,896 KB
testcase_01 AC 138 ms
31,896 KB
testcase_02 AC 153 ms
31,896 KB
testcase_03 AC 144 ms
31,900 KB
testcase_04 AC 144 ms
31,900 KB
testcase_05 AC 144 ms
31,900 KB
testcase_06 AC 141 ms
31,900 KB
testcase_07 AC 146 ms
31,900 KB
testcase_08 AC 148 ms
31,900 KB
testcase_09 AC 143 ms
31,900 KB
testcase_10 AC 162 ms
31,900 KB
testcase_11 AC 140 ms
31,900 KB
testcase_12 AC 140 ms
31,900 KB
testcase_13 AC 177 ms
31,900 KB
testcase_14 AC 179 ms
31,900 KB
testcase_15 AC 179 ms
31,900 KB
testcase_16 AC 175 ms
31,900 KB
testcase_17 AC 201 ms
31,900 KB
testcase_18 AC 179 ms
31,900 KB
testcase_19 AC 179 ms
31,900 KB
testcase_20 AC 182 ms
31,900 KB
testcase_21 AC 179 ms
31,900 KB
testcase_22 AC 205 ms
31,900 KB
testcase_23 AC 212 ms
31,900 KB
testcase_24 AC 181 ms
31,900 KB
testcase_25 AC 186 ms
31,900 KB
testcase_26 AC 186 ms
31,900 KB
testcase_27 AC 181 ms
31,900 KB
testcase_28 AC 140 ms
31,896 KB
testcase_29 AC 202 ms
31,900 KB
testcase_30 AC 181 ms
31,900 KB
testcase_31 AC 199 ms
31,900 KB
testcase_32 AC 174 ms
31,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<vector>
#include<cassert>
#include<atcoder/modint>
#include<atcoder/convolution>
using namespace std;
using mint=atcoder::modint998244353;
const int W=101;
const int L=W*W*W;
int N,M;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin>>N>>M;
	vector<mint>A(L);
	for(int i=0;i<N;i++)
	{
		int a,b,c;cin>>a>>b>>c;
		A[a*W*W+b*W+c]=1;
	}
	vector<mint>B=A;
	reverse(B.begin(),B.end());
	A=atcoder::convolution(A,B);
	int ans=N;
	for(int i=0;i<M;i++)
	{
		int x,y,z;cin>>x>>y>>z;
		x=x*W*W+y*W+z;
		ans=max(ans,2*N-(int)A[x+L-1].val());
	}
	cout<<ans<<endl;
}
0