結果

問題 No.781 円周上の格子点の数え上げ
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-10 12:13:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 676 ms / 2,000 ms
コード長 225 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 11,744 KB
実行使用メモリ 347,564 KB
最終ジャッジ日時 2023-10-20 00:04:21
合計ジャッジ時間 17,837 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 657 ms
313,024 KB
testcase_01 AC 666 ms
313,220 KB
testcase_02 AC 660 ms
313,220 KB
testcase_03 AC 651 ms
313,220 KB
testcase_04 AC 657 ms
313,220 KB
testcase_05 AC 649 ms
313,220 KB
testcase_06 AC 654 ms
313,220 KB
testcase_07 AC 654 ms
313,220 KB
testcase_08 AC 658 ms
313,220 KB
testcase_09 AC 676 ms
313,220 KB
testcase_10 AC 659 ms
313,220 KB
testcase_11 AC 663 ms
313,220 KB
testcase_12 AC 650 ms
313,220 KB
testcase_13 AC 665 ms
313,220 KB
testcase_14 AC 663 ms
313,220 KB
testcase_15 AC 650 ms
313,220 KB
testcase_16 AC 650 ms
313,220 KB
testcase_17 AC 656 ms
313,220 KB
testcase_18 AC 651 ms
313,220 KB
testcase_19 AC 651 ms
313,220 KB
testcase_20 AC 654 ms
347,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
U = 10 ** 7

r = np.arange(int(U ** 0.5) + 1, dtype=np.int32)
r = r * r
d = np.add.outer(r[r > 0], r).flatten()
cnt = np.bincount(d)

X, Y = map(int, input().split())
ans = cnt[X:Y + 1].max()
print(4 * ans)
0