結果
| 問題 | No.1423 Triangle of Multiples |
| コンテスト | |
| ユーザー |
chacoder1
|
| 提出日時 | 2021-03-25 21:02:31 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 76 ms / 2,000 ms |
| コード長 | 627 bytes |
| 記録 | |
| コンパイル時間 | 1,909 ms |
| コンパイル使用メモリ | 192,636 KB |
| 最終ジャッジ日時 | 2025-01-19 21:44:07 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
typedef pair<int,int>P;
ll x[3];
int main(){
int t;
cin>>t;
rep(i,t){
ll a,b,c;
cin>>a>>b>>c;
x[0]=a;
x[1]=b;
x[2]=c;
while(1){
//cout<<a<<" "<<b<<" "<<c<<endl;
if(a+b>c && a+c>b && a<b+c){
cout<<a<<" "<<b<<" "<<c<<endl;
break;
}
if(c<=a && c<=b){
c+=(x[2]*(max(a,b)/c));
continue;
}
if(a<=b && a<=c){
a+=(x[0]*(max(b,c)/a));
continue;
}
if(b<=a && b<=c){
b+=(x[1]*(max(c,a)/b));
continue;
}
}
}
}
chacoder1