結果

問題 No.1423 Triangle of Multiples
ユーザー chocoruskchocorusk
提出日時 2021-03-12 21:29:28
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 875 bytes
コンパイル時間 1,244 ms
コンパイル使用メモリ 129,248 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 12:12:19
合計ジャッジ時間 2,037 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <stack>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    int t; cin>>t;
    while(t--){
        ll a[3];
        cin>>a[0]>>a[1]>>a[2];
        int ind[3];
        for(int i=0; i<3; i++) ind[i]=i;
        sort(ind, ind+3, [&](int i, int j){return a[i]<a[j];});
        ll k=(a[ind[2]]-a[ind[1]])/a[ind[0]]+1;
        a[ind[0]]*=k;
        cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl;
        
    }
    return 0;
}
0