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

Commit7f06ef8

Browse files
authored
Update partition-array-for-maximum-xor-and-and.cpp
1 parent8f55fa2 commit7f06ef8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎C++/partition-array-for-maximum-xor-and-and.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ class Solution {
2121
xor_arr[mask] = xor_arr[mask ^ lb] ^ nums[i];
2222
}
2323
int64_t result =0;
24-
vector<int>base(l);
24+
vector<int>base(l);// to improve performance
2525
for (int mask =1; mask < (1 << n); ++mask) {
2626
constauto& total_and = and_arr[mask];
2727
constauto& total_xor = xor_arr[full_mask ^ mask];
28-
base.assign(l,0);// to improve performance
28+
base.assign(l,0);
2929
for (int remain = full_mask ^ mask; remain; remain &= remain -1) {
3030
constint i =__builtin_ctz(remain);
3131
int x = nums[i] & ~total_xor;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp