結果
| 問題 |
No.800 四平方定理
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-08 13:27:44 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 268 bytes |
| コンパイル時間 | 87 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 16,000 KB |
| 最終ジャッジ日時 | 2024-07-01 22:51:40 |
| 合計ジャッジ時間 | 4,002 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | RE * 9 TLE * 1 -- * 20 |
ソースコード
import itertools
n, d = map(int, input().split())
count = 0
r = range(1, n + 1)
for x, y, z in itertools.product(r, r, r):
s = x*x + y*y + z*z - d
w = int(s ** 0.5 + 0.5)
if (w <= n and w*w == s):
# print(x,y,z,w)
count += 1
print(count)