結果

問題 No.3301 Make Right Triangle
コンテスト
ユーザー Rumain831
提出日時 2025-10-05 16:50:36
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 223 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 727 ms
コンパイル使用メモリ 76,324 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-05 16:50:43
合計ジャッジ時間 6,934 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;
using ll = long long;

void solve(){
  ll l; cin >> l;
  if(l%2){
    ll b=(l*l-1)/2;
    cout << l << ' ' << b << ' ' << b+1 << endl; 
  }
  else{
    ll b=(l*l-4)/4;
    cout << l << ' ' << b << ' ' << b+2 << endl;
  }
}

int main(void){
  int t; cin >> t;
  while(t--){
    solve();
  }  
  return 0;
}
0