結果

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

テストケース

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

ソースコード

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)};
        int32_t i = 0;
        if (ys[i] < ys[1])
            i = 1;
        if (ys[i] < ys[2])
            i = 2;
        for (auto j = 0; j < 3; ++j) {
            int64_t t;
            if (j == i)
                t = ys[j];
            else
                t = int64_t(ys[i] + ys[j] - 1) / ys[j] * ys[j];
            cout << (j == 0 ? "" : " ") << t;
        }
        cout << endl;
    }
    return 0;
}
0