結果

問題 No.781 円周上の格子点の数え上げ
ユーザー 👑 KazunKazun
提出日時 2020-10-27 04:21:19
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 353 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 1,497 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 232,464 KB
最終ジャッジ日時 2023-09-29 03:09:46
合計ジャッジ時間 5,492 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,228 KB
testcase_01 AC 73 ms
71,356 KB
testcase_02 AC 72 ms
71,292 KB
testcase_03 AC 71 ms
71,264 KB
testcase_04 AC 72 ms
71,280 KB
testcase_05 AC 71 ms
71,220 KB
testcase_06 AC 79 ms
76,072 KB
testcase_07 AC 81 ms
76,776 KB
testcase_08 AC 310 ms
153,936 KB
testcase_09 AC 340 ms
154,004 KB
testcase_10 AC 127 ms
76,164 KB
testcase_11 AC 78 ms
76,768 KB
testcase_12 AC 337 ms
197,020 KB
testcase_13 AC 353 ms
232,464 KB
testcase_14 AC 88 ms
81,312 KB
testcase_15 AC 76 ms
75,952 KB
testcase_16 AC 77 ms
75,904 KB
testcase_17 AC 233 ms
168,904 KB
testcase_18 AC 212 ms
122,300 KB
testcase_19 AC 217 ms
123,816 KB
testcase_20 AC 214 ms
123,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X,Y=map(int,input().split())

T=10**7
C=[0]*(Y+1)

x=0
while x*x<=Y:
    y=0
    while x*x+y*y<=Y:
        if x==y==0:
            C[0]+=1
        elif x==0 or y==0:
            C[x*x+y*y]+=2
        else:
            C[x*x+y*y]+=4
        y+=1
    x+=1

print(max(C[X:]))
0