結果

問題 No.1653 Squarefree
ユーザー mkawa2mkawa2
提出日時 2023-02-19 12:53:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,064 bytes
コンパイル時間 896 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 250,504 KB
最終ジャッジ日時 2023-09-27 19:37:16
合計ジャッジ時間 34,582 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 243 ms
242,104 KB
testcase_02 AC 250 ms
241,960 KB
testcase_03 AC 268 ms
242,360 KB
testcase_04 AC 246 ms
242,108 KB
testcase_05 AC 239 ms
241,892 KB
testcase_06 AC 239 ms
241,904 KB
testcase_07 AC 240 ms
241,712 KB
testcase_08 AC 247 ms
242,180 KB
testcase_09 AC 248 ms
241,652 KB
testcase_10 AC 245 ms
241,924 KB
testcase_11 AC 737 ms
250,096 KB
testcase_12 AC 708 ms
249,836 KB
testcase_13 AC 1,045 ms
250,268 KB
testcase_14 AC 1,049 ms
250,140 KB
testcase_15 AC 1,253 ms
250,000 KB
testcase_16 AC 1,067 ms
250,032 KB
testcase_17 AC 1,046 ms
249,836 KB
testcase_18 AC 1,009 ms
250,456 KB
testcase_19 AC 1,112 ms
249,936 KB
testcase_20 AC 1,055 ms
250,328 KB
testcase_21 AC 1,046 ms
250,024 KB
testcase_22 AC 1,039 ms
250,236 KB
testcase_23 AC 1,048 ms
250,200 KB
testcase_24 WA -
testcase_25 AC 1,053 ms
250,288 KB
testcase_26 AC 1,012 ms
250,504 KB
testcase_27 AC 1,121 ms
250,120 KB
testcase_28 AC 1,046 ms
250,148 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 991 ms
250,232 KB
testcase_32 AC 1,021 ms
250,188 KB
testcase_33 WA -
testcase_34 AC 1,008 ms
250,100 KB
testcase_35 AC 1,032 ms
250,488 KB
testcase_36 AC 252 ms
242,724 KB
testcase_37 WA -
testcase_38 AC 246 ms
242,132 KB
testcase_39 AC 252 ms
242,608 KB
testcase_40 AC 249 ms
241,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

# dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# inf = (1 << 31)-1
# md = 10**9+7
md = 998244353

mx = 1000001
sq = set()
for a in range(2, mx): sq.add(a**2)

l, r = LI()
r += 1
# a^2*b
dp = [0]*(r-l)

for a in sq:
    if a > r: continue
    s = (l+a-1)//a*a
    for i in range(s, r, a):
        dp[i-l] = 1

for a in range(2, mx):
    s = (l+a-1)//a*a
    for i in range(s, r, a):
        if i//a in sq: dp[i-l] = 1

print(r-l-sum(dp))
0