結果
問題 |
No.800 四平方定理
|
ユーザー |
![]() |
提出日時 | 2019-03-17 22:26:21 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 394 bytes |
コンパイル時間 | 169 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 65,536 KB |
最終ジャッジ日時 | 2024-07-08 00:18:15 |
合計ジャッジ時間 | 3,200 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 30 |
ソースコード
count = 0 for x in range(1, N + 1): for y in range(x, N + 1): for z in range(y, N + 1): t = x * x + y * y + z * z - D if t < 0: continue if t > N * N: break w = int(t ** 0.5) if t == w * w: num = len(set([x, y, z])) - 1 count += [1, 3, 6][num] print(count)