Skip to content

Commit 98014b0

Browse files
committed
format
1 parent 00332a7 commit 98014b0

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

library/data_structures/uncommon/hilbert_mos.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! @space O(1)
1111
ll hilbert(int x, int y) {
1212
ll d = 0, mx = 1;
13-
while(mx <= max(x, y)) mx *= 4;
13+
while (mx <= max(x, y)) mx *= 4;
1414
for (int s = mx / 2; s; s /= 2) {
1515
bool rx = x & s, ry = y & s;
1616
d = d * 4 | (ry * 3 ^ rx);

tests/library_checker_aizu_tests/handmade_tests/hilbert_mos.test.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,23 @@ void test(int i, int j) {
1212
for (int k = 0; k < 4; k++) {
1313
int to_i = i + di[k];
1414
int to_j = j + dj[k];
15-
if(to_i >= 0 && to_j >= 0) {
15+
if (to_i >= 0 && to_j >= 0) {
1616
cnt_prev += (res - 1 == hilbert(to_i, to_j));
1717
cnt_next += (res + 1 == hilbert(to_i, to_j));
1818
}
1919
}
20-
if(i==0 && j==0) assert(res == 0);
20+
if (i == 0 && j == 0) assert(res == 0);
2121
else assert(cnt_prev == 1);
2222
assert(cnt_next == 1);
2323
}
24-
2524
int main() {
2625
cin.tie(0)->sync_with_stdio(0);
27-
for (int i = 0; i < 3000; i++) {
28-
for (int j = 0; j < 3000; j++) {
29-
test(i,j);
30-
}
31-
}
26+
for (int i = 0; i < 3000; i++)
27+
for (int j = 0; j < 3000; j++) test(i, j);
3228
for (int iter = 50000; iter--;) {
3329
int i = rnd(0, 1'000'000'000);
3430
int j = rnd(0, 1'000'000'000);
35-
test(i,j);
31+
test(i, j);
3632
}
3733
cout << "Hello World\n";
3834
}

0 commit comments

Comments
 (0)