結果

問題 No.781 円周上の格子点の数え上げ
ユーザー rlangevinrlangevin
提出日時 2023-01-12 22:47:13
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 87,288 KB
実行使用メモリ 155,844 KB
最終ジャッジ日時 2023-08-25 03:11:24
合計ジャッジ時間 4,412 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
150,004 KB
testcase_01 AC 111 ms
150,068 KB
testcase_02 AC 112 ms
149,948 KB
testcase_03 AC 108 ms
149,692 KB
testcase_04 AC 112 ms
149,988 KB
testcase_05 AC 114 ms
149,836 KB
testcase_06 AC 120 ms
155,396 KB
testcase_07 AC 121 ms
155,076 KB
testcase_08 AC 161 ms
155,640 KB
testcase_09 AC 160 ms
155,660 KB
testcase_10 AC 118 ms
155,356 KB
testcase_11 AC 122 ms
155,308 KB
testcase_12 AC 320 ms
155,600 KB
testcase_13 AC 298 ms
155,628 KB
testcase_14 AC 125 ms
155,256 KB
testcase_15 AC 121 ms
155,364 KB
testcase_16 AC 118 ms
155,320 KB
testcase_17 AC 224 ms
155,844 KB
testcase_18 AC 145 ms
155,632 KB
testcase_19 AC 144 ms
155,392 KB
testcase_20 AC 141 ms
155,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

X, Y = map(int, input().split())
L = []
D = [0] * (10 ** 7 + 5)
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
# print("test", len(D))
# for k, v in D.items():
#     if X <= k <= Y:
#         ans = max(ans, v)
for i in range(X, Y + 1):
    ans = max(ans, D[i])    
print(ans * 4)
0