結果
問題 | No.2644 Iro Iro-Iro |
ユーザー |
![]() |
提出日時 | 2024-02-13 04:10:07 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 280 ms / 2,000 ms |
コード長 | 694 bytes |
コンパイル時間 | 5,257 ms |
コンパイル使用メモリ | 317,520 KB |
実行使用メモリ | 32,008 KB |
最終ジャッジ日時 | 2024-09-28 18:32:50 |
合計ジャッジ時間 | 13,099 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include<bits/stdc++.h> #include<atcoder/all> using namespace std; using mint = atcoder::modint998244353; const int tot = 101*101*101; int colid(int a, int b, int c){ return a + b*101 + c*101*101; } int main(){ int n, m; cin >> n >> m; vector<mint> f(tot,0); for (int i = 0; i < n; i++){ int a, b, c; cin >> a >> b >> c; f[colid(a,b,c)] = 1; } auto g = f; reverse(g.begin(),g.end()); auto fg = atcoder::convolution(f,g); int ans = 0; for (int i = 0; i < m; i++){ int x, y, z; cin >> x >> y >> z; int d = colid(x,y,z); int sum = fg[tot-1+d].val(); ans = max(ans,n+n-sum); } cout << ans << endl; }