結果
| 問題 |
No.1143 面積Nの三角形
|
| コンテスト | |
| ユーザー |
hotman78
|
| 提出日時 | 2020-07-31 18:30:50 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 355 ms / 800 ms |
| コード長 | 605 bytes |
| コンパイル時間 | 186 ms |
| コンパイル使用メモリ | 82,144 KB |
| 実行使用メモリ | 76,964 KB |
| 最終ジャッジ日時 | 2024-07-06 14:33:09 |
| 合計ジャッジ時間 | 3,736 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
import math
n=int(input())
v=[]
for i in range(1,n+1):
if (n*n)%i==0:
v.append(i)
ans=0
for d in v:
for e in v:
if e<d:
continue
if (n*n)%(d*e):
continue
b=d+e
c=n*n/d/e
k=b*b+c*4
if k<0:
continue
tmp=max(0,math.sqrt(k)-100)
sqk=-1
for i in range(200):
if (tmp+i)*(tmp+i)==k:
sqk=tmp+i
if sqk==-1:
continue
if (sqk+b)%2:
continue
f=(sqk-b)/2
if f<e:
continue
ans+=1
print(ans)
hotman78