結果

問題 No.1653 Squarefree
ユーザー shobonvipshobonvip
提出日時 2022-03-30 17:31:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 82,316 KB
実行使用メモリ 95,660 KB
最終ジャッジ日時 2024-04-27 07:30:16
合計ジャッジ時間 4,926 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 72 ms
72,632 KB
testcase_02 AC 71 ms
73,280 KB
testcase_03 AC 72 ms
72,912 KB
testcase_04 AC 73 ms
73,024 KB
testcase_05 AC 72 ms
73,304 KB
testcase_06 AC 71 ms
72,788 KB
testcase_07 AC 71 ms
72,616 KB
testcase_08 AC 68 ms
72,860 KB
testcase_09 AC 69 ms
72,424 KB
testcase_10 AC 71 ms
72,228 KB
testcase_11 AC 87 ms
94,372 KB
testcase_12 AC 90 ms
93,956 KB
testcase_13 AC 87 ms
95,032 KB
testcase_14 AC 89 ms
93,748 KB
testcase_15 AC 89 ms
95,076 KB
testcase_16 AC 86 ms
94,248 KB
testcase_17 AC 89 ms
94,432 KB
testcase_18 AC 88 ms
94,000 KB
testcase_19 AC 90 ms
95,660 KB
testcase_20 AC 92 ms
95,452 KB
testcase_21 AC 94 ms
94,444 KB
testcase_22 AC 95 ms
94,692 KB
testcase_23 AC 92 ms
95,300 KB
testcase_24 WA -
testcase_25 AC 89 ms
94,200 KB
testcase_26 AC 87 ms
93,848 KB
testcase_27 AC 89 ms
94,156 KB
testcase_28 AC 86 ms
93,712 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 91 ms
94,264 KB
testcase_32 AC 91 ms
95,172 KB
testcase_33 WA -
testcase_34 AC 91 ms
94,892 KB
testcase_35 AC 90 ms
95,216 KB
testcase_36 AC 73 ms
72,552 KB
testcase_37 WA -
testcase_38 AC 73 ms
72,896 KB
testcase_39 AC 69 ms
72,748 KB
testcase_40 AC 69 ms
72,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

l,r = map(int,input().split())
v = [l+i for i in range(r-l+1)]
w = [0 for i in range(r-l+1)]
		
dp = [0 for i in range(10**6+1)]
for i in range(2, 10**6):
	if dp[i] == 0:
		for j in range((l+i**2-1)//(i**2), r//(i**2)+1):
			w[j*(i**2) - l] = 1
			#print(j*(i**2))
			#print(j*(i**2) - l)
		for j in range(i, 10**6+1, i):
			dp[j] = 1

print(r-l+1 - sum(w))
0