結果

問題 No.826 連絡網
ユーザー pluto77pluto77
提出日時 2019-11-09 09:07:26
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 806 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 1,964 ms
コンパイル使用メモリ 77,512 KB
実行使用メモリ 79,012 KB
最終ジャッジ日時 2023-10-13 06:56:23
合計ジャッジ時間 11,891 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
76,152 KB
testcase_01 AC 75 ms
76,368 KB
testcase_02 AC 81 ms
77,304 KB
testcase_03 AC 85 ms
78,416 KB
testcase_04 AC 83 ms
78,388 KB
testcase_05 AC 82 ms
78,432 KB
testcase_06 AC 81 ms
78,512 KB
testcase_07 AC 80 ms
78,772 KB
testcase_08 AC 80 ms
78,272 KB
testcase_09 AC 83 ms
78,776 KB
testcase_10 AC 78 ms
77,328 KB
testcase_11 AC 84 ms
78,460 KB
testcase_12 AC 537 ms
78,444 KB
testcase_13 AC 208 ms
78,756 KB
testcase_14 AC 387 ms
78,660 KB
testcase_15 AC 99 ms
78,304 KB
testcase_16 AC 254 ms
78,696 KB
testcase_17 AC 210 ms
78,552 KB
testcase_18 AC 175 ms
78,688 KB
testcase_19 AC 654 ms
78,608 KB
testcase_20 AC 639 ms
78,844 KB
testcase_21 AC 87 ms
79,012 KB
testcase_22 AC 212 ms
78,724 KB
testcase_23 AC 268 ms
78,892 KB
testcase_24 AC 140 ms
78,724 KB
testcase_25 AC 798 ms
78,760 KB
testcase_26 AC 157 ms
78,636 KB
testcase_27 AC 571 ms
78,476 KB
testcase_28 AC 419 ms
78,676 KB
testcase_29 AC 209 ms
78,560 KB
testcase_30 AC 806 ms
78,488 KB
testcase_31 AC 247 ms
78,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki826
import sys

n,p=map(int,raw_input().split())
if p==1:
 res=1
 sys.exit()
res=n-1
for i in range(n/2+1,n+1):
 f=True
 j=2
 while j*j<=i:
  if i%j==0:
   f=False
   break
  else:
   j+=1
 if f:
  res-=1
  if i==p:
   res=1
   break
print res
0