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