結果
問題 |
No.2644 Iro Iro-Iro
|
ユーザー |
![]() |
提出日時 | 2024-02-16 04:43:06 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 699 bytes |
コンパイル時間 | 2,624 ms |
コンパイル使用メモリ | 222,108 KB |
最終ジャッジ日時 | 2025-02-19 13:24:35 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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++){ 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'; }