結果

問題 No.781 円周上の格子点の数え上げ
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-10 12:04:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 339 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 81,796 KB
実行使用メモリ 153,764 KB
最終ジャッジ日時 2023-10-19 23:53:49
合計ジャッジ時間 7,092 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 260 ms
140,220 KB
testcase_01 AC 253 ms
140,220 KB
testcase_02 AC 256 ms
140,220 KB
testcase_03 AC 254 ms
140,220 KB
testcase_04 AC 256 ms
140,220 KB
testcase_05 AC 268 ms
140,220 KB
testcase_06 AC 254 ms
140,220 KB
testcase_07 AC 259 ms
140,220 KB
testcase_08 AC 259 ms
140,220 KB
testcase_09 AC 256 ms
140,220 KB
testcase_10 AC 264 ms
140,504 KB
testcase_11 AC 256 ms
140,516 KB
testcase_12 AC 306 ms
153,764 KB
testcase_13 AC 339 ms
153,764 KB
testcase_14 AC 254 ms
142,564 KB
testcase_15 AC 254 ms
140,232 KB
testcase_16 AC 251 ms
140,232 KB
testcase_17 AC 309 ms
153,764 KB
testcase_18 AC 260 ms
140,232 KB
testcase_19 AC 255 ms
140,232 KB
testcase_20 AC 256 ms
140,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

U = 10 ** 7

memo = []
r = 0
while r * r <= U:
    memo.append(r * r)
    r += 1

cnt = [0] * (U + 1)
for x in memo:
    for y in memo:
        if x + y > U:
            break
        if x and y:
            cnt[x + y] += 4
        else:
            cnt[x + y] += 2

X, Y = map(int, input().split())
ans = max(cnt[i] for i in range(X, Y + 1))
print(ans)
0