-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Oleksandr Kulkov
committed
Feb 10, 2024
1 parent
d939ef6
commit c5cc2ce
Showing
7 changed files
with
83 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[[languages.cpp.environments]] | ||
CXX = "g++" | ||
CXXFLAGS = ["-std=c++20", "-Wall", "-Wextra", "-O2"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,4 +200,4 @@ namespace algebra { | |
} | ||
}; | ||
} | ||
#endif // ALGEBRA_MATRIX_HPP | ||
#endif // ALGEBRA_MATRIX_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#define PROBLEM "https://judge.yosupo.jp/problem/convolution_mod_1000000007" | ||
#pragma GCC optimize("Ofast,unroll-loops") | ||
#pragma GCC target("avx2,tune=native") | ||
#include "cp-algo/algebra/polynomial.hpp" | ||
#include <bits/stdc++.h> | ||
|
||
using namespace std; | ||
using namespace algebra; | ||
|
||
const int mod = 1e9 + 7; | ||
typedef modular<mod> base; | ||
typedef poly<base> polyn; | ||
|
||
void solve() { | ||
int n, m; | ||
cin >> n >> m; | ||
vector<base> a(n), b(m); | ||
copy_n(istream_iterator<base>(cin), n, begin(a)); | ||
copy_n(istream_iterator<base>(cin), m, begin(b)); | ||
(polyn(a) * polyn(b)).print(n + m - 1); | ||
} | ||
|
||
signed main() { | ||
//freopen("input.txt", "r", stdin); | ||
ios::sync_with_stdio(0); | ||
cin.tie(0); | ||
int t; | ||
t = 1;// cin >> t; | ||
while(t--) { | ||
solve(); | ||
} | ||
} |
Oops, something went wrong.