結果

問題 No.3301 Make Right Triangle
コンテスト
ユーザー flippergo
提出日時 2026-03-24 08:18:55
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 454 ms / 2,000 ms
コード長 350 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 237 ms
コンパイル使用メモリ 84,992 KB
実行使用メモリ 81,792 KB
最終ジャッジ日時 2026-03-24 08:19:11
合計ジャッジ時間 12,199 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

T = int(input())
for _ in range(T):
    L = int(input())
    if L%2==1:
        print((L**2-1)//2,(L**2+1)//2,L)
    else:
        k = 0
        x = L
        while x%2==0 and x>4:
            x = x//2
            k += 1
        a=pow(2,k)
        if x==4:
            print(a*3,a*4,a*5)
        else:
            print(a*(x**2-1)//2,a*(x**2+1)//2,L)
0