結果

問題 No.781 円周上の格子点の数え上げ
ユーザー rlangevinrlangevin
提出日時 2023-01-12 22:15:25
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 344 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 201,904 KB
最終ジャッジ日時 2023-08-25 02:45:41
合計ジャッジ時間 7,242 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
75,996 KB
testcase_01 AC 85 ms
71,668 KB
testcase_02 AC 88 ms
71,708 KB
testcase_03 AC 91 ms
71,876 KB
testcase_04 AC 86 ms
71,552 KB
testcase_05 AC 89 ms
71,744 KB
testcase_06 AC 97 ms
77,048 KB
testcase_07 AC 93 ms
77,080 KB
testcase_08 AC 126 ms
77,712 KB
testcase_09 AC 131 ms
77,820 KB
testcase_10 AC 99 ms
77,796 KB
testcase_11 AC 101 ms
78,528 KB
testcase_12 AC 1,759 ms
201,904 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

X, Y = map(int, input().split())
L = []
D = defaultdict(int)
i = 1
while i * i <= Y:
    L.append(i * i)
    D[i * i] += 1
    i += 1

for a in L:
    for b in L:
        if X <= a + b <= Y:
            D[a + b] += 1
        
ans = 0
for k, v in D.items():
    if X <= k <= Y:
        ans = max(ans, v)
print(ans * 4)
0