結果

問題 No.781 円周上の格子点の数え上げ
ユーザー tails1434
提出日時 2020-01-14 21:38:27
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 404 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 81,536 KB
実行使用メモリ 279,572 KB
最終ジャッジ日時 2024-12-26 12:36:00
合計ジャッジ時間 27,116 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 TLE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

def main():
    X, Y = map(int, input().split())
    r = Y ** 0.5
    d = defaultdict(int)
    for i in range(int(-r),int(r)+1):
        for j in range(int(-r),int(r)+1):
            if i**2 + j**2 <= Y:
                d[i**2 + j**2] += 1

    ans = 0
    for i in range(X, Y + 1):
        ans = max(ans, d[i])

    print(ans)


if __name__ == "__main__":
    main()
0