結果

問題 No.1423 Triangle of Multiples
ユーザー snow39snow39
提出日時 2021-03-12 21:35:36
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 936 bytes
コンパイル時間 1,275 ms
コンパイル使用メモリ 105,600 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-22 12:22:55
合計ジャッジ時間 1,826 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 21 ms
6,940 KB
testcase_03 AC 15 ms
6,944 KB
testcase_04 AC 16 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

void solve(){
  ll A,B,C;
  cin>>A>>B>>C;

  vector<ll> ans(3,0);
  ll ma=max(A,max(B,C));

  if(A==ma){
    ans[0]=A;
    ans[1]=B*C*A;
    ans[2]=B*C*A;
  }else if(B==ma){
    ans[0]=A*B*C;
    ans[1]=B;
    ans[2]=A*B*C;
  }else{
    ans[0]=A*B*C;
    ans[1]=A*B*C;
    ans[2]=C;
  }

  cout<<ans[0]<<" "<<ans[1]<<" "<<ans[2]<<"\n";
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int T;
  cin>>T;
  rep(i,T) solve();

  return 0;
}
0