結果

問題 No.2644 Iro Iro-Iro
ユーザー cho435cho435
提出日時 2024-02-13 02:57:52
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 794 bytes
コンパイル時間 7,123 ms
コンパイル使用メモリ 307,688 KB
実行使用メモリ 7,936 KB
最終ジャッジ日時 2024-02-13 17:55:53
合計ジャッジ時間 28,750 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,676 KB
testcase_01 AC 3 ms
6,676 KB
testcase_02 AC 3 ms
6,676 KB
testcase_03 AC 120 ms
6,676 KB
testcase_04 AC 198 ms
6,676 KB
testcase_05 AC 122 ms
6,676 KB
testcase_06 AC 13 ms
6,676 KB
testcase_07 AC 187 ms
6,676 KB
testcase_08 AC 59 ms
6,676 KB
testcase_09 AC 14 ms
6,676 KB
testcase_10 AC 26 ms
6,676 KB
testcase_11 AC 11 ms
6,676 KB
testcase_12 AC 21 ms
6,676 KB
testcase_13 AC 459 ms
6,676 KB
testcase_14 AC 626 ms
6,676 KB
testcase_15 AC 562 ms
6,676 KB
testcase_16 AC 591 ms
6,676 KB
testcase_17 AC 776 ms
6,676 KB
testcase_18 AC 1,170 ms
7,680 KB
testcase_19 AC 1,173 ms
7,680 KB
testcase_20 AC 1,172 ms
7,680 KB
testcase_21 AC 1,171 ms
7,680 KB
testcase_22 AC 1,169 ms
7,680 KB
testcase_23 AC 1,157 ms
7,296 KB
testcase_24 AC 1,163 ms
7,296 KB
testcase_25 AC 1,170 ms
7,424 KB
testcase_26 AC 1,171 ms
7,680 KB
testcase_27 AC 1,139 ms
7,296 KB
testcase_28 AC 2 ms
6,676 KB
testcase_29 AC 1,165 ms
7,936 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n,m;
	cin>>n>>m;
	vector<int> a(n),b(n),c(n);
	vector<int> x(m),y(m),z(m);
	rep(i,n) cin>>a[i]>>b[i]>>c[i];
	rep(i,m) cin>>x[i]>>y[i]>>z[i];
	bitset<1030301> stl;
	rep(i,n){
		stl[a[i]+101*b[i]+101*101*c[i]]=1;
	}
	vector<pair<int,int>> vp(m);
	rep(i,m){
		vp[i].first=x[i]*x[i]+y[i]*y[i]+z[i]*z[i];
		vp[i].second=abs(x[i]+101*y[i]+101*101*z[i]);
	}
	sort(vp.begin(),vp.end());
	int ans=n;
	rep(i,min(m,40000)){
		ans=max(ans,n*2-(int)(stl&(stl>>vp[m-1-i].second)).count());
	}
	cout<<ans<<"\n";
}
0