結果
| 問題 |
No.1423 Triangle of Multiples
|
| コンテスト | |
| ユーザー |
213R
|
| 提出日時 | 2021-03-15 23:53:55 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,483 bytes |
| コンパイル時間 | 4,206 ms |
| コンパイル使用メモリ | 256,372 KB |
| 最終ジャッジ日時 | 2025-01-19 17:27:00 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 4 |
ソースコード
#include <algorithm>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
using ll=long long;
bool chmin(ll& a, ll b){ if(a > b){ a = b; return 1; } return 0; }
bool chmax(int& a, int b){ if(a < b){ a = b; return 1; } return 0; }
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
const ll MOD = 998244353LL;
using pll = pair<int, int>;
const int INF = 1e7;
vector<int> sieve(int X) {
vector<bool> cs(X+1, true);
for (int i = 2; i*i <= X; ++i) {
if (cs[i]) {
for (int j = i*i; j <= X; j+=i) cs[j] = false;
}
}
vector<int> ans;
for (int i = 2; i <= X; ++i) if (cs[i]) ans.push_back(i);
return ans;
}
ll gcd(ll a, ll b) {
if (b==0) return a;
return gcd(b, a%b);
}
int main() {
int T;
cin >> T;
vector<ll> xs(3);
vector ans(T, vector<ll>(3));
for (int i = 0; i < T; ++i) {
cin >> xs[0] >> xs[1] >> xs[2];
sort(xs.begin(), xs.end());
ll a = xs[0], b = xs[1], c = xs[2];
int j = 2;
while (xs[0] + xs[1] <= xs[2]) {
xs[2] = c*j;
xs[1] = ((xs[2]-1)/b)*b;
xs[0] = ((xs[1]-1)/c)*c;
j++;
}
ans[i][0] = xs[0];
ans[i][1] = xs[1];
ans[i][2] = xs[2];
}
for (auto v : ans) {
cout << v[0] << " ";
cout << v[1] << " ";
cout << v[2] << endl;
}
return 0;
}
213R