結果

問題 No.2644 Iro Iro-Iro
ユーザー cho435cho435
提出日時 2024-02-13 16:49:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,060 bytes
コンパイル時間 6,829 ms
コンパイル使用メモリ 310,260 KB
実行使用メモリ 8,064 KB
最終ジャッジ日時 2024-02-13 17:38:30
合計ジャッジ時間 43,370 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 239 ms
6,676 KB
testcase_04 AC 399 ms
6,676 KB
testcase_05 AC 245 ms
6,676 KB
testcase_06 AC 22 ms
6,676 KB
testcase_07 AC 384 ms
6,676 KB
testcase_08 AC 114 ms
6,676 KB
testcase_09 AC 24 ms
6,676 KB
testcase_10 AC 50 ms
6,676 KB
testcase_11 AC 17 ms
6,676 KB
testcase_12 AC 38 ms
6,676 KB
testcase_13 AC 920 ms
6,676 KB
testcase_14 AC 1,251 ms
6,676 KB
testcase_15 AC 1,115 ms
6,676 KB
testcase_16 AC 1,189 ms
6,676 KB
testcase_17 AC 1,576 ms
6,784 KB
testcase_18 AC 1,953 ms
7,808 KB
testcase_19 AC 1,953 ms
7,808 KB
testcase_20 AC 1,954 ms
7,808 KB
testcase_21 AC 1,954 ms
7,808 KB
testcase_22 AC 1,954 ms
7,808 KB
testcase_23 AC 1,954 ms
7,424 KB
testcase_24 AC 1,953 ms
7,424 KB
testcase_25 AC 1,952 ms
7,552 KB
testcase_26 AC 1,954 ms
7,808 KB
testcase_27 AC 1,953 ms
7,424 KB
testcase_28 AC 2 ms
6,676 KB
testcase_29 AC 1,954 ms
8,064 KB
testcase_30 AC 1,954 ms
6,676 KB
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 timer(){
	static auto st = chrono::system_clock::now();
	auto en = chrono::system_clock::now();
	return chrono::duration_cast<chrono::milliseconds>(en - st).count();
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	timer();
	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,m){
		ans=max(ans,n*2-(int)(stl&(stl>>vp[m-1-i].second)).count());
		ans=max(ans,n*2-(int)(stl&(stl>>vp[i].second)).count());
		if(i%10==0&&timer()>1950) break;
	}
	cout<<ans<<"\n";
}
0