結果
| 問題 |
No.1653 Squarefree
|
| コンテスト | |
| ユーザー |
kasashimataiga
|
| 提出日時 | 2022-03-29 00:27:15 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 342 ms / 2,000 ms |
| コード長 | 405 bytes |
| コンパイル時間 | 178 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 234,496 KB |
| 最終ジャッジ日時 | 2024-11-07 15:46:34 |
| 合計ジャッジ時間 | 11,088 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
l,r=map(int,input().split())
dic=dict()
for i in range(l,r+1):
dic[i]=1
for p in range(2,10**6+5):
k=(l+p**2-1)//(p**2)
while k*(p**2)<=r:
dic[k*(p**2)]=0
k+=1
for k in range(1,10**6+5):
p=int((l//k)**0.5)
while k*(p**2)<l:p+=1
if p==1:p+=1
while k*(p**2)<=r:
dic[k*(p**2)]=0
p+=1
ans=0
for i in range(l,r+1):
ans+=dic[i]
print(ans)
kasashimataiga