結果

問題 No.800 四平方定理
ユーザー OKCH3COOHOKCH3COOH
提出日時 2019-11-13 21:20:28
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 299 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 81,784 KB
実行使用メモリ 302,988 KB
最終ジャッジ日時 2023-10-21 19:49:50
合計ジャッジ時間 34,275 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
70,192 KB
testcase_01 AC 77 ms
75,348 KB
testcase_02 AC 69 ms
71,628 KB
testcase_03 AC 70 ms
74,344 KB
testcase_04 AC 66 ms
71,628 KB
testcase_05 AC 71 ms
73,452 KB
testcase_06 AC 82 ms
77,752 KB
testcase_07 AC 70 ms
74,348 KB
testcase_08 AC 76 ms
77,752 KB
testcase_09 AC 73 ms
75,348 KB
testcase_10 AC 1,051 ms
258,108 KB
testcase_11 AC 1,098 ms
245,748 KB
testcase_12 AC 1,081 ms
259,080 KB
testcase_13 AC 1,015 ms
258,436 KB
testcase_14 AC 1,101 ms
245,752 KB
testcase_15 AC 1,126 ms
259,372 KB
testcase_16 AC 1,116 ms
246,040 KB
testcase_17 AC 1,168 ms
246,036 KB
testcase_18 AC 1,231 ms
246,032 KB
testcase_19 AC 1,117 ms
246,036 KB
testcase_20 AC 41 ms
53,444 KB
testcase_21 AC 42 ms
53,444 KB
testcase_22 AC 1,156 ms
246,032 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 41 ms
53,444 KB
testcase_27 AC 40 ms
53,444 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N, D = map(int, input().split())

V = defaultdict(int)
for y in range(1, N + 1):
    for z in range(1, N + 1):
        V[y**2 + z**2] += 1

ans = 0
for w in range(1, N + 1):
    for x in range(1, N + 1):
        E = w**2 + D - x**2
        ans += V[E]

print(ans)
0