Skip to content

Commit 2003db0

Browse files
committed
add concave max plus convolution test
1 parent d0767d3 commit 2003db0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#define PROBLEM "https://judge.yosupo.jp/problem/min_plus_convolution_convex_arbitrary"
2+
3+
#include "../smawk.hpp"
4+
5+
#include <iostream>
6+
#include <vector>
7+
using namespace std;
8+
9+
int main() {
10+
cin.tie(nullptr);
11+
ios::sync_with_stdio(false);
12+
13+
int N, M;
14+
cin >> N >> M;
15+
vector<int> A(N), B(M);
16+
for (auto &a : A) cin >> a, a = -a;
17+
for (auto &b : B) cin >> b, b = -b;
18+
19+
auto ret = concave_max_plus_convolution<int, ((1 << 30) - 1) * 2>(B, A);
20+
21+
for (int i = 0; i < N + M - 1; ++i) cout << -ret[i] << " \n"[i + 1 == N + M - 1];
22+
}

0 commit comments

Comments
 (0)