ABC186 C - Unlucky 7 から学んだ
2130 ワード
とりあえず、8 進数への変換は基本文字列。
10 進数も文字列へ統一した方が楽そうだ。
こんな記述でも通った。
Unlucky.py
N = int(input())
lis = []
for n in range(1,N+1):#O(10^5)
if "7" in str(n) or "7" in oct(n):#worst O(12)
lis.append(str(n))
print(N-len(set(lis)))
#total O(12*10^5)
Author And Source
この問題について(ABC186 C - Unlucky 7 から学んだ), 我々は、より多くの情報をここで見つけました https://qiita.com/AKpirion/items/a69fc9d4ff3aba07280b著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .