結果
問題 | No.1653 Squarefree |
ユーザー |
![]() |
提出日時 | 2021-08-20 23:02:15 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 247 ms / 2,000 ms |
コード長 | 409 bytes |
コンパイル時間 | 197 ms |
コンパイル使用メモリ | 82,536 KB |
実行使用メモリ | 141,180 KB |
最終ジャッジ日時 | 2024-10-14 08:33:48 |
合計ジャッジ時間 | 8,872 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
S=set()L,R=map(int,input().split())M=10**6for i in range(2,M+1):s=i**2l=s+(s*((L-1)//s))for j in range(l,R+1,s):S.add(j)for a in range(1,M+1):l,r=((L-1)//a)+1,R//aif l>r:continue#l~rにある平方数s=int(l**0.5)-2while True:if s<=1:s=2if l<=s**2<=r:S.add((s**2)*a)s+=1elif s**2<l:s+=1else:breakprint(R-L+1-len(S))