結果

問題 No.800 四平方定理
ユーザー tikitaka1201tikitaka1201
提出日時 2020-09-16 20:20:02
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 360 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 406,448 KB
最終ジャッジ日時 2023-09-04 03:53:52
合計ジャッジ時間 24,646 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
83,536 KB
testcase_01 AC 127 ms
92,012 KB
testcase_02 AC 122 ms
87,092 KB
testcase_03 AC 122 ms
88,308 KB
testcase_04 AC 119 ms
85,500 KB
testcase_05 AC 122 ms
88,476 KB
testcase_06 AC 133 ms
95,508 KB
testcase_07 AC 125 ms
90,568 KB
testcase_08 AC 131 ms
95,600 KB
testcase_09 AC 130 ms
92,284 KB
testcase_10 AC 1,059 ms
260,648 KB
testcase_11 AC 1,069 ms
275,764 KB
testcase_12 AC 1,104 ms
267,084 KB
testcase_13 AC 1,058 ms
261,644 KB
testcase_14 AC 1,081 ms
276,688 KB
testcase_15 AC 1,111 ms
275,796 KB
testcase_16 AC 1,090 ms
276,884 KB
testcase_17 AC 1,131 ms
276,524 KB
testcase_18 AC 1,054 ms
276,452 KB
testcase_19 AC 1,131 ms
276,488 KB
testcase_20 AC 92 ms
71,920 KB
testcase_21 AC 94 ms
71,628 KB
testcase_22 AC 1,148 ms
276,756 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 93 ms
71,724 KB
testcase_27 AC 93 ms
71,948 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 AC 1,989 ms
404,380 KB
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
def MI():
    return map(int, input().split())

n,d=MI()
from collections import Counter

wz,xy=[],[]
for i in range(1,n+1):
    for j in range(1,n+1):
        wz.append(i**2-j**2+d)
wz=Counter(wz)
for i in range(1,n+1):
    for j in range(1,n+1):
        xy.append(i**2+j**2)

ans=0
for i in xy:
    ans+=wz[i]
print(ans)
0