結果

問題 No.781 円周上の格子点の数え上げ
ユーザー titiatitia
提出日時 2019-01-11 22:07:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 539 ms
コンパイル使用メモリ 10,772 KB
実行使用メモリ 164,752 KB
最終ジャッジ日時 2023-08-20 06:44:47
合計ジャッジ時間 43,020 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,776 ms
86,436 KB
testcase_01 WA -
testcase_02 AC 1,761 ms
86,604 KB
testcase_03 AC 1,969 ms
86,540 KB
testcase_04 AC 1,742 ms
86,536 KB
testcase_05 AC 1,939 ms
86,516 KB
testcase_06 AC 1,730 ms
86,452 KB
testcase_07 TLE -
testcase_08 AC 1,758 ms
86,492 KB
testcase_09 AC 1,784 ms
86,436 KB
testcase_10 AC 1,761 ms
86,668 KB
testcase_11 AC 1,749 ms
86,704 KB
testcase_12 AC 1,871 ms
129,084 KB
testcase_13 TLE -
testcase_14 AC 1,823 ms
87,248 KB
testcase_15 AC 1,974 ms
86,440 KB
testcase_16 AC 1,785 ms
86,520 KB
testcase_17 TLE -
testcase_18 AC 1,920 ms
86,468 KB
testcase_19 AC 1,775 ms
86,500 KB
testcase_20 AC 1,807 ms
86,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

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

u=int(math.sqrt(10**7)+1)

LIST=[0]*(10**7+1)

DOUBLIST=[]
for i in range(u):
    DOUBLIST.append(i**2)

L=len(DOUBLIST)

for d in DOUBLIST:
    LIST[d]+=4

for i in range(1,L-1):
    for j in range(i+1,L):
        if DOUBLIST[i]+DOUBLIST[j]<=10**7:
            LIST[DOUBLIST[i]+DOUBLIST[j]]+=8
        else:
            break

print(max(LIST[X:Y+1]))
0