結果
| 問題 | No.3301 Make Right Triangle | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2025-10-09 09:12:35 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 45 ms / 2,000 ms | 
| コード長 | 515 bytes | 
| コンパイル時間 | 2,212 ms | 
| コンパイル使用メモリ | 194,988 KB | 
| 実行使用メモリ | 7,716 KB | 
| 最終ジャッジ日時 | 2025-10-09 09:12:48 | 
| 合計ジャッジ時間 | 12,044 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 9 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int T; cin >> T;
    while(T--){
        long long L; cin >> L;
        long long p2 = 1;
        while(L%2 == 0) L >>= 1,p2 <<= 1;
        if(L == 1){
            L *= 4,p2 /= 4;
            cout << 3*p2 << " " << 4*p2 << " " << 5*p2 << "\n";
            continue;
        }
        long long n = L/2,m = L-n;
        cout << L*p2 << " " << 2*n*m*p2 << " " << (n*n+m*m)*p2 << "\n";
    }
}
            
            
            
        