結果
問題 |
No.2644 Iro Iro-Iro
|
ユーザー |
![]() |
提出日時 | 2024-02-16 04:44:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 614 bytes |
コンパイル時間 | 2,655 ms |
コンパイル使用メモリ | 219,228 KB |
最終ジャッジ日時 | 2025-02-19 13:25:00 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 TLE * 2 -- * 14 |
ソースコード
#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); 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]; } B moto; for (int i=0; i<n; i++){ moto[a[i] + b[i] * 101 + c[i] * 101 * 101] = 1; } int ans = 0; for (int i=0; i<m; i++){ ans = max(ans, 2 * n -(int)(moto & (moto >> abs(x[i] + y[i] * 101 + z[i] * 101 * 101))).count()); } cout << ans << '\n'; }