結果
問題 |
No.2979 直角三角形の個数
|
ユーザー |
![]() |
提出日時 | 2024-12-03 23:25:51 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 296 bytes |
コンパイル時間 | 601 ms |
コンパイル使用メモリ | 82,064 KB |
実行使用メモリ | 131,048 KB |
最終ジャッジ日時 | 2024-12-03 23:26:42 |
合計ジャッジ時間 | 49,712 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 TLE * 1 |
other | AC * 18 TLE * 8 |
ソースコード
import math n=int(input()) ans=0 for i in range(1,int(n**.5)+1): for j in range(1,i): if i**2+i*j>n: break if i**2-j**2<=2*i*j: break if math.gcd(i,j)!=1: continue if j&1 and i&1: ans+=n//(i**2+i*j) else: ans+=n//(2*(i**2+i*j)) print(ans)