結果

問題 No.1423 Triangle of Multiples
ユーザー 👑 箱星箱星
提出日時 2020-12-11 08:40:12
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,072 bytes
コンパイル時間 2,150 ms
コンパイル使用メモリ 194,704 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-21 18:52:57
合計ジャッジ時間 5,684 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

void solve(int a, int b, int c)
{
    int m = min(a, min(b, c));
    if (a == m) {
        for (int x = a; x <= 100000; x += a) {
            if (abs(b - c) < x && x < b + c) {
                cout << x << " " << b << " " << c << "\n";
                return;
            }
        }
    }
    if (b == m) {
        for (int x = b; x <= 100000; x += b) {
            if (abs(c - a) < x && x < c + a) {
                cout << a << " " << x << " " << c << "\n";
                return;
            }
        }
    }
    if (c == m) {
        for (int x = c; x <= 100000; x += c) {
            if (abs(a - b) < x && x < a + b) {
                cout << a << " " << b << " " << x << "\n";
                return;
            }
        }
    }
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin >> t;
    while (t--) {
        int a, b, c;
        cin >> a >> b >> c;
        solve(a, b, c);
    }
}
0