Skip to content

Commit 65b45ca

Browse files
committed
speedup
1 parent b27cc43 commit 65b45ca

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

library/math/matrix_related/xor_basis_unordered.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//! @time O(32) or O(64)
1313
//! @space O(32) or O(64)
1414
template<class T> struct basis {
15-
vector<T> b;
15+
basic_string<T> b;
1616
T shrink(T v) {
1717
for (T x : b) v = min(v, v ^ x);
1818
return v;

library/math/matrix_related/xor_basis_unordered_intersection.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
template<class T>
77
basis<T> intersection(const basis<T>& u,
88
const basis<T>& v) {
9-
vector<array<T, 2>> w(sz(u.b));
10-
rep(i, 0, sz(w)) w[i] = {u.b[i], u.b[i]};
9+
basic_string<array<T, 2>> w;
10+
for (T e : u.b) w.push_back({e, e});
1111
basis<T> res;
1212
for (T e : v.b) {
1313
T s = 0;

tests/library_checker_aizu_tests/strings/longest_common_substring.test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ int main() {
1212
pair<int, int> substr_s = {0, 0}, substr_t = {0, 0};
1313
for (int i = 0; i < sz(sf_a.lcp); i++) {
1414
if (both[sf_a.sa[i]] == '$' ||
15-
both[sf_a.sa[i + 1]] == '$')
15+
both[sf_a.sa[i + 1]] == '$')
1616
continue;
1717
bool before_in_s = (sf_a.sa[i] < sz(s));
1818
bool after_in_s = (sf_a.sa[i + 1] < sz(s));
1919
if (before_in_s ^ after_in_s) {
2020
if (sf_a.lcp[i] > substr_s.second - substr_s.first) {
2121
substr_s = {sf_a.sa[i], sf_a.sa[i] + sf_a.lcp[i]};
2222
substr_t = {
23-
sf_a.sa[i + 1], sf_a.sa[i + 1] + sf_a.lcp[i]};
23+
sf_a.sa[i + 1], sf_a.sa[i + 1] + sf_a.lcp[i]};
2424
if (after_in_s) swap(substr_s, substr_t);
2525
substr_t.first -= int(sz(s)) + 1;
2626
substr_t.second -= int(sz(s)) + 1;

0 commit comments

Comments
 (0)