結果

問題 No.781 円周上の格子点の数え上げ
ユーザー yansi819
提出日時 2024-05-13 10:00:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 292 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 82,780 KB
実行使用メモリ 141,084 KB
最終ジャッジ日時 2024-12-20 09:23:19
合計ジャッジ時間 4,064 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

X, Y = map(int, input().split())
cnt = [0] * (10000001)
maxR = 0
while maxR * maxR <= Y:
    maxR += 1
maxR -= 1
for x in range(1, maxR + 1):
    for y in range(maxR + 1):
        if x * x + y * y <= Y:
            cnt[x * x + y * y] += 1

ans = 0
for i in range(X, Y + 1):
    if ans < cnt[i]:
        ans = cnt[i]
print(ans * 4)
0