結果
| 問題 | No.1593 Perfect Distance |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-07 01:35:32 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 55 ms / 2,000 ms |
| コード長 | 184 bytes |
| 記録 | |
| コンパイル時間 | 271 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 59,904 KB |
| 最終ジャッジ日時 | 2024-11-24 04:59:29 |
| 合計ジャッジ時間 | 2,066 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
import math
N = int(input())
N2 = N*N
cnt = 0
for x in range(1, N+1):
y2 = N2-x*x
if y2<=0:
break
y = int(math.sqrt(y2))
if y*y==y2:
cnt += 1
print(cnt)