結果
| 問題 | No.1593 Perfect Distance | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-07-09 21:28:26 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 78 ms / 2,000 ms | 
| コード長 | 365 bytes | 
| コンパイル時間 | 100 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-07-01 15:12:44 | 
| 合計ジャッジ時間 | 1,635 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 17 | 
ソースコード
import sys
import math
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
MOD = 10 ** 9 + 7
def solve():
    n = int(input())
    nn = n * n
    res = 0
    for x in range(1, n):
        xx = x * x
        y = math.sqrt(nn - xx)
        if y.is_integer():
            res += 1
    print(res)
if __name__ == '__main__':
    solve()
            
            
            
        