結果

問題 No.8054 ほぼ直角二等辺三角形
ユーザー neetprogrammer
提出日時 2020-05-25 03:40:09
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 538 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 82,268 KB
実行使用メモリ 81,952 KB
最終ジャッジ日時 2024-10-12 21:04:10
合計ジャッジ時間 6,944 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 TLE * 1 -- * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt
import time


def f(a):
    return (2 * (a * a)) + (2 * a) + 1


def check(a, c):
    b = (a + 1)
    temp = (a * a) + (b * b)

    if temp == (c * c):
        return True
    return False


line = input()

digit = int(line)

start = 10 ** digit

for i in range(1, start):
    # for i in range(1, 10000000):
    c = sqrt(f(i))
    if c.is_integer():
        c = int(c)
        if check(i, c):
            if len(str(c)) == digit:
                print(str(i) + " " + str(i + 1) + " " + str(c))
                break
0