結果

問題 No.826 連絡網
ユーザー ttrttr
提出日時 2020-02-26 16:51:41
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 450 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 82,592 KB
実行使用メモリ 70,048 KB
最終ジャッジ日時 2024-04-21 16:29:35
合計ジャッジ時間 19,968 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,096 KB
testcase_01 AC 40 ms
52,224 KB
testcase_02 AC 46 ms
58,868 KB
testcase_03 AC 55 ms
60,288 KB
testcase_04 AC 56 ms
60,672 KB
testcase_05 AC 52 ms
60,288 KB
testcase_06 AC 53 ms
60,800 KB
testcase_07 AC 58 ms
60,416 KB
testcase_08 AC 52 ms
60,160 KB
testcase_09 AC 54 ms
60,288 KB
testcase_10 AC 49 ms
59,008 KB
testcase_11 AC 53 ms
60,288 KB
testcase_12 AC 1,498 ms
65,920 KB
testcase_13 AC 453 ms
62,208 KB
testcase_14 AC 1,015 ms
64,768 KB
testcase_15 AC 100 ms
60,800 KB
testcase_16 AC 605 ms
63,104 KB
testcase_17 AC 454 ms
62,336 KB
testcase_18 AC 337 ms
61,696 KB
testcase_19 AC 1,842 ms
66,560 KB
testcase_20 AC 1,795 ms
66,688 KB
testcase_21 AC 59 ms
60,672 KB
testcase_22 AC 461 ms
62,336 KB
testcase_23 AC 632 ms
63,232 KB
testcase_24 AC 234 ms
61,568 KB
testcase_25 TLE -
testcase_26 AC 286 ms
62,080 KB
testcase_27 AC 1,589 ms
66,432 KB
testcase_28 AC 1,111 ms
64,896 KB
testcase_29 AC 446 ms
62,592 KB
testcase_30 TLE -
testcase_31 AC 579 ms
62,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,P = map(int, input().split())

if P > 1:
    L = [0]*(N+1)
    n = 2
    num = P
    while n <= P**0.5:
        if P%n == 0:
            num = n
            break
        n += 1
    if num*2 <= N:
        ans = N//2-1
        for i in range(N//2+1, N+1):
            n = 2
            while n <= i**0.5:
                if i%n == 0:
                    ans += 1
                    break
                n += 1
    else:
        ans = 1

print(ans)
0