Skip to content

Commit

Permalink
apply clang-format-19
Browse files Browse the repository at this point in the history
  • Loading branch information
hitonanode committed Sep 22, 2024
1 parent 3c2cde8 commit 2287709
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
4 changes: 1 addition & 3 deletions convolution/fft_double.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
#include <utility>
#include <vector>

// CUT begin
// Convolution by FFT (Fast Fourier Transform)
// Algorithm based on http://kirika-comp.hatenablog.com/entry/2018/03/12/210446
// Verified: ATC001C (168 ms) https://atcoder.jp/contests/atc001/submissions/9243440
using cmplx = std::complex<double>;
void fft(int N, std::vector<cmplx> &a, double dir) {
int i = 0;
for (int j = 1; j < N - 1; j++) {
for (int k = N >> 1; k > (i ^= k); k >>= 1)
;
for (int k = N >> 1; k > (i ^= k); k >>= 1) {}
if (j < i) std::swap(a[i], a[j]);
}

Expand Down
7 changes: 2 additions & 5 deletions convolution/hadamard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <cassert>
#include <vector>

// CUT begin
// Fast Walsh-Hadamard transform and its abstraction
// Tutorials: <https://codeforces.com/blog/entry/71899>
// <https://csacademy.com/blog/fast-fourier-transform-and-variations-of-it>
Expand Down Expand Up @@ -50,13 +49,11 @@ template <typename T> std::vector<T> xorconv(std::vector<T> x, std::vector<T> y)
// bitwise AND conolution
// ret[i] = \sum_{(j & k) == i} x[j] * y[k]
template <typename T> std::vector<T> andconv(std::vector<T> x, std::vector<T> y) {
return bitwise_conv(
x, y, [](T &lo, T &hi) { lo += hi; }, [](T &lo, T &hi) { lo -= hi; });
return bitwise_conv(x, y, [](T &lo, T &hi) { lo += hi; }, [](T &lo, T &hi) { lo -= hi; });
}

// bitwise OR convolution
// ret[i] = \sum_{(j | k) == i} x[j] * y[k]
template <typename T> std::vector<T> orconv(std::vector<T> x, std::vector<T> y) {
return bitwise_conv(
x, y, [](T &lo, T &hi) { hi += lo; }, [](T &lo, T &hi) { hi -= lo; });
return bitwise_conv(x, y, [](T &lo, T &hi) { hi += lo; }, [](T &lo, T &hi) { hi -= lo; });
}
2 changes: 1 addition & 1 deletion flow/networksimplex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ template <typename Capacity = long long, typename Weight = long long> struct mcf
int E;
std::vector<std::vector<int>> in_eids, out_eids;
std::vector<std::pair<int, int>> arcs;
Digraph(int V = 0) : V(V), E(0), in_eids(V), out_eids(V){};
Digraph(int V = 0) : V(V), E(0), in_eids(V), out_eids(V) {};
int add_edge(int s, int t) {
assert(0 <= s and s < V);
assert(0 <= t and t < V);
Expand Down
5 changes: 2 additions & 3 deletions multithread/multithread_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using namespace std;
using pint = pair<int, int>;
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define IFOR(i, begin, end) for (int i = (end) - 1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;
Expand All @@ -21,8 +21,7 @@ vector<string> ret;
mutex mtx;
vector<int> done;

void solve(int tc) { /* tc個目のテストケースを処理する関数 */
}
void solve(int tc) { /* tc個目のテストケースを処理する関数 */ }

void run() {
/* 未完了で最も番号が若いテストケースを処理 */
Expand Down
2 changes: 1 addition & 1 deletion string/palindromic_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace palindromic_tree {

template <class Key> class Node {
int suffix_link_; // このノードからのsuffix link (suffix の最長回文)
int length_; // このノードが表す回文の長さ。 -1 となる場合もあるので注意
int length_; // このノードが表す回文の長さ。 -1 となる場合もあるので注意
std::map<Key, int> children;

public:
Expand Down

0 comments on commit 2287709

Please sign in to comment.