結果

問題 No.3301 Make Right Triangle
ユーザー MM
提出日時 2025-10-05 14:07:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 255 ms / 2,000 ms
コード長 991 bytes
コンパイル時間 3,906 ms
コンパイル使用メモリ 251,396 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-05 14:08:11
合計ジャッジ時間 10,227 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
#define chmin(x,y) (x) = min((x),(y))
#define chmax(x,y) (x) = max((x),(y))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define vec vector
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back 
#define eb emplace_back

using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
const ll mod = 998244353;
using mint = modint998244353;
const vector<int> dx = {1,0,-1,0}, dy = {0,1,0,-1};
// using Graph = vector<vector<pair<int,ll>>>;
using Graph = vector<vector<int>>;

int main(){
  // input
  int T;
  cin >> T;
  while(T--){
    ll L;
    cin >> L;
    ll X = 1;
    while(L % 2 == 0 && L != 4){
      X *= 2;
      L /= 2;
    }

    ll Y = (L * L - 1) / 2;
    ll Z = Y + 1;

    if(L == 4){
      Y = 3;
      Z = 5;
    }

    // output
    L *= X;
    Y *= X;
    Z *= X;

    cout << L << " " << Y << " " << Z << endl;
  }
  
  // solve
  
  // output
  
}
0