結果

問題 No.1423 Triangle of Multiples
ユーザー 箱星
提出日時 2020-10-19 17:05:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 879 bytes
コンパイル時間 2,332 ms
コンパイル使用メモリ 193,616 KB
最終ジャッジ日時 2025-01-15 11:45:40
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 1 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = int_fast64_t;
constexpr int mod = 1e9 + 7;
constexpr int inf = (1 << 30) - 1;
constexpr ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(nullptr)
#define set_digit(N) cout << fixed << setprecision((N))
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

void solve(ll a, ll b, ll c)
{
    for (ll x = a; x <= 200000; x += a) {
        for (ll y = b; y <= 200000; y += b) {
            for (ll z = c; z <= 200000; z += c) {
                if (abs(x - y) < z && z < x + y) {
                    cout << x << " " << y << " " << z << "\n";
                    return;
                }
            }
        }
    }
}

int main()
{
    int t;
    cin >> t;
    while (t--) {
        ll a, b, c;
        cin >> a >> b >> c;
        solve(a, b, c);
    }
}
0