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

Commit4a4d768

Browse files
committed
fix
1 parente376510 commit4a4d768

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎cp-algo/util/bit.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace cp_algo {
1313
return (1ULL << n) -1;
1414
}
1515
size_torder_of_bit(auto x,size_t k) {
16-
returnstd::popcount(x << ( -k %bit_width<decltype(x)>));
16+
returnk ?std::popcount(x << (bit_width<decltype(x)> - k)) :0;
1717
}
1818
[[gnu::target("bmi2")]]inlinesize_tkth_set_bit(uint64_t x,size_t k) {
1919
returnstd::countr_zero(_pdep_u64(1ULL << k, x));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp