Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1d4657f

Browse files
committed
remove one precalc dimension
1 parent2153a8e commit1d4657f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

‎verify/structures/bitpack/prod_mod_2.test.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ using cp_algo::structures::bitpack;
1212
constint maxn =1 <<12;
1313
bitpack<maxn> a[maxn], b[maxn], c[maxn];
1414
constint K =8;
15-
bitpack<maxn> precalc[maxn / K][1 << K];
15+
bitpack<maxn> precalc[1 << K];
1616

17-
voidprocess_precalc() {
18-
for(int i =0; i < maxn / K; i++) {
19-
for(int j =0; j < K; j++) {
20-
int step =1 << j;
21-
for(int k =0; k < step; k++) {
22-
precalc[i][k + step] = precalc[i][k] ^ b[K * i + j];
23-
}
17+
voidprocess_precalc(int i) {
18+
for(auto &it: precalc) {
19+
it = bitpack<maxn>();
20+
}
21+
for(int j =0; j < K; j++) {
22+
int step =1 << j;
23+
for(int k =0; k < step; k++) {
24+
precalc[k + step] = precalc[k] ^ b[K * i + j];
2425
}
2526
}
2627
}
@@ -39,12 +40,11 @@ void solve() {
3940
b[i] = row;
4041
}
4142
cp_algo::checkpoint("read");
42-
process_precalc();
43-
cp_algo::checkpoint("precalc");
4443
for(int j =0; j < m; j +=64) {
4544
for(int z =0; z <64 / K; z++) {
45+
process_precalc(j / K + z);
4646
for(int i =0; i < n; i++) {
47-
c[i] ^= precalc[j / K + z][uint8_t(a[i].word(j /64) >> K * z)];
47+
c[i] ^= precalc[uint8_t(a[i].word(j /64) >> K * z)];
4848
}
4949
}
5050
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp