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

Commit543da9a

Browse files
authored
Update number-of-integers-with-popcount-depth-equal-to-k-ii.py
1 parente3e6921 commit543da9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎Python/number-of-integers-with-popcount-depth-equal-to-k-ii.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def popcount(x):
77
returnbin(x).count('1')
88

99

10-
defceil_log2_x(x):
10+
defceil_log2(x):
1111
return (x-1).bit_length()
1212

1313

@@ -37,7 +37,7 @@ def query(self, i):
3737
D[i]=D[popcount(i)]+1
3838
MAX_K=0
3939
whileMAX_N!=1:# O(log*(MAX_N)) times
40-
MAX_N=ceil_log2_x(MAX_N)
40+
MAX_N=ceil_log2(MAX_N)
4141
MAX_K+=1
4242
classSolution(object):
4343
defpopcountDepth(self,nums,queries):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp