結果

問題 No.781 円周上の格子点の数え上げ
ユーザー vwxyzvwxyz
提出日時 2024-04-06 05:35:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 726 ms / 2,000 ms
コード長 216 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 218,628 KB
最終ジャッジ日時 2024-04-06 05:35:33
合計ジャッジ時間 6,177 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,716 KB
testcase_01 AC 36 ms
53,716 KB
testcase_02 AC 35 ms
53,716 KB
testcase_03 AC 36 ms
53,716 KB
testcase_04 AC 36 ms
53,716 KB
testcase_05 AC 36 ms
53,716 KB
testcase_06 AC 44 ms
60,552 KB
testcase_07 AC 46 ms
61,056 KB
testcase_08 AC 677 ms
138,288 KB
testcase_09 AC 650 ms
138,288 KB
testcase_10 AC 44 ms
60,576 KB
testcase_11 AC 44 ms
61,064 KB
testcase_12 AC 691 ms
183,116 KB
testcase_13 AC 726 ms
218,628 KB
testcase_14 AC 67 ms
65,624 KB
testcase_15 AC 45 ms
60,432 KB
testcase_16 AC 44 ms
60,376 KB
testcase_17 AC 414 ms
155,008 KB
testcase_18 AC 396 ms
106,476 KB
testcase_19 AC 427 ms
107,860 KB
testcase_20 AC 412 ms
107,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X,Y=map(int,input().split())
Y+=1
sX=int(Y**.5)+1
sY=int(Y**.5)+1
cnt=[0]*Y
for x in range(-sX,sX+1):
    for y in range(-sY,sY+1):
        d=x*x+y*y
        if d<Y:
            cnt[d]+=1
ans=max(cnt[X:Y])
print(ans)
0