結果

問題 No.800 四平方定理
ユーザー i_takui_taku
提出日時 2023-09-29 10:17:07
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 343 bytes
コンパイル時間 1,094 ms
コンパイル使用メモリ 86,764 KB
実行使用メモリ 419,084 KB
最終ジャッジ日時 2023-09-29 10:17:50
合計ジャッジ時間 39,743 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
83,164 KB
testcase_01 AC 133 ms
91,796 KB
testcase_02 AC 121 ms
86,660 KB
testcase_03 AC 123 ms
88,244 KB
testcase_04 AC 123 ms
85,556 KB
testcase_05 AC 134 ms
88,224 KB
testcase_06 AC 134 ms
95,396 KB
testcase_07 AC 131 ms
90,028 KB
testcase_08 AC 132 ms
95,476 KB
testcase_09 AC 133 ms
92,188 KB
testcase_10 AC 1,191 ms
257,516 KB
testcase_11 AC 1,220 ms
265,688 KB
testcase_12 AC 1,288 ms
260,620 KB
testcase_13 AC 1,245 ms
258,836 KB
testcase_14 AC 1,290 ms
265,640 KB
testcase_15 AC 1,248 ms
265,624 KB
testcase_16 AC 1,248 ms
265,756 KB
testcase_17 AC 1,269 ms
265,864 KB
testcase_18 AC 1,254 ms
265,780 KB
testcase_19 AC 1,292 ms
265,704 KB
testcase_20 AC 91 ms
71,436 KB
testcase_21 AC 93 ms
71,556 KB
testcase_22 AC 1,257 ms
265,652 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 97 ms
71,532 KB
testcase_27 AC 92 ms
71,372 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

N, D = map(int, input().split())
xpy = []
for x in range(1, N + 1):
    for y in range(1, N + 1):
        xpy.append(x**2 + y**2)
wmz = []
for w in range(1, N + 1):
    for z in range(1, N + 1):
        wmz.append(w**2 - z**2)
cnt = Counter(wmz)

ans = 0
for xy in xpy:
    ans += cnt.get(xy - D, 0)
print(ans)
0