結果

問題 No.781 円周上の格子点の数え上げ
ユーザー stngstng
提出日時 2022-06-12 17:53:38
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 249 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 216,660 KB
最終ジャッジ日時 2023-10-24 11:51:16
合計ジャッジ時間 4,136 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,528 KB
testcase_01 AC 62 ms
53,744 KB
testcase_02 AC 39 ms
53,752 KB
testcase_03 AC 36 ms
53,752 KB
testcase_04 AC 36 ms
53,752 KB
testcase_05 AC 37 ms
53,752 KB
testcase_06 AC 42 ms
60,576 KB
testcase_07 AC 42 ms
61,080 KB
testcase_08 AC 221 ms
138,332 KB
testcase_09 AC 198 ms
138,332 KB
testcase_10 AC 43 ms
60,520 KB
testcase_11 AC 43 ms
61,164 KB
testcase_12 AC 244 ms
181,148 KB
testcase_13 AC 249 ms
216,660 KB
testcase_14 AC 48 ms
65,788 KB
testcase_15 AC 41 ms
60,292 KB
testcase_16 AC 40 ms
60,236 KB
testcase_17 AC 155 ms
153,036 KB
testcase_18 AC 128 ms
106,528 KB
testcase_19 AC 136 ms
107,912 KB
testcase_20 AC 134 ms
107,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x,y = map(int,input().split())

ans = 0
dp = [0]*(y+1)

Y = int(y**0.5+50)
for i in range(Y+1):
    tmp = i**2
    for j in range(1,Y+1):
        idx = tmp+j**2
        if idx > y:
            break
        dp[idx] += 1
#print(dp)
print(max(dp[x:y+1])*4)
0