結果

問題 No.3054 ほぼ直角二等辺三角形
ユーザー CuriousFairy315CuriousFairy315
提出日時 2019-04-02 00:05:53
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 447 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 10,620 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2023-08-18 03:52:25
合計ジャッジ時間 1,734 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,844 KB
testcase_01 AC 17 ms
7,812 KB
testcase_02 AC 15 ms
7,812 KB
testcase_03 AC 15 ms
7,800 KB
testcase_04 AC 16 ms
7,816 KB
testcase_05 AC 15 ms
7,740 KB
testcase_06 AC 15 ms
7,784 KB
testcase_07 AC 15 ms
7,828 KB
testcase_08 AC 16 ms
7,824 KB
testcase_09 AC 15 ms
7,824 KB
testcase_10 AC 15 ms
7,812 KB
testcase_11 AC 15 ms
7,824 KB
testcase_12 AC 15 ms
7,808 KB
testcase_13 AC 15 ms
7,752 KB
testcase_14 AC 16 ms
7,796 KB
testcase_15 AC 15 ms
7,824 KB
testcase_16 AC 16 ms
7,796 KB
testcase_17 AC 15 ms
7,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X = int(input())
tup = [[0, 0], [3, 5]]
while len(str(tup[-1][1])) < X:
    A = 4 * tup[-1][1] + tup[-2][0]
    tup.append([A, round(pow(A * A + (A + 1) * (A + 1), 1/2))])
    tup[-1][1] -= 0 if len(str(tup[-1][1])) != 17 else 1 # なんか誤差あったので微調整
else:
    if X == 18: 
        print(244566641436218639, 244566641436218640, 345869461223138161) # 強行突破
    else: 
        print(tup[-1][0], tup[-1][0] + 1, tup[-1][1])
0