結果

問題 No.1423 Triangle of Multiples
ユーザー ooooobaoooooba
提出日時 2021-07-17 12:18:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 791 bytes
コンパイル時間 1,147 ms
コンパイル使用メモリ 123,824 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 05:31:33
合計ジャッジ時間 2,840 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int main() {
    int32_t t;
    cin >> t;
    vector<tuple<int32_t, int32_t, int32_t>> xs(t);
    for (auto &&x : xs) {
        cin >> get<0>(x) >> get<1>(x) >> get<2>(x);
    }
    for (auto &&x : xs) {
        vector<int32_t> ys = {get<0>(x), get<1>(x), get<2>(x)};
        sort(ys.begin(), ys.end());
        if (!(ys[0] + ys[1] < ys[2]))
            ys[0] = (ys[2] - ys[1] + 1) / ys[0] * ys[0];
        cout << ys[0] << " " << ys[1] << " " << ys[2] << endl;
    }
    return 0;
}
0