結果

問題 No.1143 面積Nの三角形
コンテスト
ユーザー hotman78
提出日時 2020-07-31 18:30:50
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 197 ms / 800 ms
コード長 605 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 325 ms
コンパイル使用メモリ 85,376 KB
実行使用メモリ 81,792 KB
最終ジャッジ日時 2026-03-28 04:08:44
合計ジャッジ時間 2,718 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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)
0