結果

問題 No.781 円周上の格子点の数え上げ
ユーザー tails1434tails1434
提出日時 2020-01-14 21:38:27
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 404 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 293,840 KB
最終ジャッジ日時 2023-08-27 04:30:43
合計ジャッジ時間 4,979 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
75,836 KB
testcase_01 AC 95 ms
72,064 KB
testcase_02 AC 97 ms
72,100 KB
testcase_03 AC 96 ms
72,124 KB
testcase_04 AC 96 ms
72,128 KB
testcase_05 AC 95 ms
72,084 KB
testcase_06 AC 115 ms
79,040 KB
testcase_07 AC 126 ms
80,804 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

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