結果

問題 No.800 四平方定理
ユーザー ayaoniayaoni
提出日時 2020-11-27 03:20:54
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 336 bytes
コンパイル時間 1,065 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 312,552 KB
最終ジャッジ日時 2023-10-01 03:52:32
合計ジャッジ時間 27,843 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
81,652 KB
testcase_01 AC 126 ms
87,092 KB
testcase_02 AC 119 ms
83,172 KB
testcase_03 AC 121 ms
86,012 KB
testcase_04 AC 116 ms
83,060 KB
testcase_05 AC 118 ms
84,820 KB
testcase_06 AC 127 ms
88,952 KB
testcase_07 AC 120 ms
85,836 KB
testcase_08 AC 124 ms
89,112 KB
testcase_09 AC 125 ms
86,696 KB
testcase_10 AC 911 ms
262,780 KB
testcase_11 AC 994 ms
258,352 KB
testcase_12 AC 1,038 ms
258,124 KB
testcase_13 AC 957 ms
263,084 KB
testcase_14 AC 991 ms
258,412 KB
testcase_15 AC 1,024 ms
258,104 KB
testcase_16 AC 1,051 ms
258,396 KB
testcase_17 AC 998 ms
258,172 KB
testcase_18 AC 968 ms
258,408 KB
testcase_19 AC 971 ms
258,488 KB
testcase_20 AC 97 ms
71,828 KB
testcase_21 AC 93 ms
71,740 KB
testcase_22 AC 987 ms
258,352 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 97 ms
71,756 KB
testcase_27 AC 93 ms
71,752 KB
testcase_28 AC 1,933 ms
308,484 KB
testcase_29 TLE -
testcase_30 TLE -
testcase_31 AC 1,796 ms
299,632 KB
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict
def MI(): return map(int,sys.stdin.readline().rstrip().split())


N,D = MI()

count = defaultdict(int)
for i in range(1,N+1):
    for j in range(1,N+1):
        count[i**2+j**2] += 1

ans = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        ans += count[-i**2+j**2+D]

print(ans)
0