結果

問題 No.3301 Make Right Triangle
コンテスト
ユーザー flippergo
提出日時 2026-03-24 08:18:55
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 264 ms / 2,000 ms
+ 236µs
コード長 350 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 229 ms
コンパイル使用メモリ 95,856 KB
実行使用メモリ 85,248 KB
最終ジャッジ日時 2026-08-04 08:20:23
合計ジャッジ時間 8,180 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_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