結果

問題 No.1423 Triangle of Multiples
ユーザー CleyLCleyL
提出日時 2022-09-21 14:34:47
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 526 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 68,596 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-23 19:59:40
合計ジャッジ時間 2,058 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 78 ms
4,380 KB
testcase_03 AC 66 ms
4,376 KB
testcase_04 AC 66 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
void solve(){
  int a,b,c;cin>>a>>b>>c;
  if(a<=b && a<=c){
    int sm = b+c;
    int mx = max(b,c);
    //mx <= a < sm
    cout << (mx+a-1)/a*a << " " << b << " " << c << endl;
  }else if(b<=a && b<=c){
    int sm = a+c;
    int mx = max(a,c);
    cout << a << " " << (mx+b-1)/b*b << " " << c << endl;
  }else{
    int sm = a+b;
    int mx = max(a,b);
    cout << a << " " << b << " " << (mx+c-1)/c*c << endl;
  }
}

int main(){
  int t;cin>>t;
  for(int i = 0; t > i; i++)solve();
}
0