結果

問題 No.826 連絡網
ユーザー O2MT
提出日時 2020-12-12 23:30:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 82,216 KB
実行使用メモリ 83,448 KB
最終ジャッジ日時 2024-09-19 22:33:34
合計ジャッジ時間 3,178 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

N,P = map(int,input().split())
l = [0]*(N+1)
for i in range(2,N+1):
    for j in range(i,N+1,i):
        l[j] += 1
count = N-1
for n in range(N//2+1,N+1):
    if l[n] == 1:
        count -= 1
if l[P] == 1 and P > N//2:
    print(1)
else:
    print(count)
0