結果

問題 No.781 円周上の格子点の数え上げ
ユーザー prd_xxxprd_xxx
提出日時 2019-01-11 22:25:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 403 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 82,412 KB
実行使用メモリ 73,956 KB
最終ジャッジ日時 2024-05-07 15:09:23
合計ジャッジ時間 6,129 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,176 KB
testcase_01 AC 35 ms
53,624 KB
testcase_02 AC 35 ms
52,868 KB
testcase_03 AC 34 ms
53,320 KB
testcase_04 AC 34 ms
53,204 KB
testcase_05 AC 34 ms
54,216 KB
testcase_06 AC 36 ms
52,936 KB
testcase_07 AC 36 ms
53,952 KB
testcase_08 AC 48 ms
61,248 KB
testcase_09 AC 43 ms
61,312 KB
testcase_10 AC 103 ms
68,356 KB
testcase_11 AC 139 ms
69,424 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 64 ms
64,032 KB
testcase_16 AC 36 ms
53,248 KB
testcase_17 WA -
testcase_18 AC 55 ms
65,336 KB
testcase_19 AC 48 ms
63,160 KB
testcase_20 AC 46 ms
64,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X,Y = map(int,input().split())
arr = []
a = 1
while a*a <= Y:
    arr.append(a*a)
    a += 1

def is_square(n):
    return n**0.5 == int(n**0.5)

def calc(n):
    ret = 0
    for a in arr:
        if n-a <= 0: break
        if is_square(n-a):
            ret += 1
    if is_square(n):
        ret += 1
    return ret * 4

ans = 0
for n in range(max(X,Y-5000),Y+1):
    ans = max(ans, calc(n))
print(ans)
0