結果

問題 No.1423 Triangle of Multiples
ユーザー eQeeQe
提出日時 2021-03-12 21:34:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,154 bytes
コンパイル時間 4,396 ms
コンパイル使用メモリ 229,520 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 12:21:15
合計ジャッジ時間 5,232 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define pt(sth) cout << sth << "\n"
#define itr(x,c) for(auto x=c.begin();x!=c.end();x++)
#define all(a) (a.begin()),(a.end())
using namespace std;
#include <atcoder/all>
using namespace atcoder;
typedef long long ll;
typedef pair<ll, ll> pll;
template<class T>bool chmax(T &a, const T &b) {if(a<b) {a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) {if(b<a) {a=b; return 1;} return 0;}
static const ll INF=1e18;
static const ll MAX=101010;
//static const ll MOD=1e9+7;
//static const ll MOD=998244353;
//vector<ll> a(N);
//for(i=0;i<N;i++) cin>>a[i];

typedef vector<ll> v1D;
typedef vector<v1D> v2D;
typedef vector<v2D> v3D;

ll gcd(ll a,ll b){
  if(b==0) return a;
  else return gcd(b,a%b);
}


int main(){
  ll i,j;
  
  ll T;cin>>T;
  while(T--){
    vector<pll> x(3);
    for(i=0;i<3;i++){
      cin>>x[i].first;
      x[i].second=i;
    }
    sort(all(x));
    
    ll lcm=x[1].first*x[2].first/gcd(x[1].first, x[2].first);
    x[1].first=x[2].first=lcm;
    sort(all(x),[](const pll& a,const pll& b){return a.second<b.second;});
    
    for(i=0;i<3;i++)cout<<x[i].first<<" ";pt("");
    
  }
  
}
0