結果

問題 No.1143 面積Nの三角形
ユーザー hotman78hotman78
提出日時 2020-07-31 18:30:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 392 ms / 800 ms
コード長 605 bytes
コンパイル時間 788 ms
コンパイル使用メモリ 86,956 KB
実行使用メモリ 78,232 KB
最終ジャッジ日時 2023-09-20 19:37:22
合計ジャッジ時間 5,448 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
75,732 KB
testcase_01 AC 86 ms
76,240 KB
testcase_02 AC 90 ms
76,380 KB
testcase_03 AC 99 ms
76,960 KB
testcase_04 AC 93 ms
76,056 KB
testcase_05 AC 99 ms
76,704 KB
testcase_06 AC 103 ms
77,064 KB
testcase_07 AC 137 ms
77,884 KB
testcase_08 AC 137 ms
77,620 KB
testcase_09 AC 148 ms
77,744 KB
testcase_10 AC 115 ms
76,792 KB
testcase_11 AC 239 ms
77,512 KB
testcase_12 AC 245 ms
77,672 KB
testcase_13 AC 253 ms
78,232 KB
testcase_14 AC 115 ms
76,752 KB
testcase_15 AC 77 ms
71,240 KB
testcase_16 AC 391 ms
77,636 KB
testcase_17 AC 392 ms
77,612 KB
testcase_18 AC 307 ms
77,712 KB
testcase_19 AC 298 ms
77,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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