結果
問題 |
No.1423 Triangle of Multiples
|
ユーザー |
|
提出日時 | 2020-12-11 08:37:04 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 981 bytes |
コンパイル時間 | 2,136 ms |
コンパイル使用メモリ | 191,824 KB |
最終ジャッジ日時 | 2025-01-16 22:05:12 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 WA * 1 TLE * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; void solve(int a, int b, int c) { int m = min(a, min(b, c)); if (a == m) { for (int x = a; x <= 200000; x += a) { if (abs(b - c) < x && x < b + c) { cout << x << " " << b << " " << c << "\n"; return; } } } if (b == m) { for (int x = b; x <= 200000; x += b) { if (abs(c - a) < x && x < c + a) { cout << a << " " << x << " " << c << "\n"; return; } } } if (c == m) { for (int x = c; x <= 200000; 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); } }