結果
| 問題 |
No.1423 Triangle of Multiples
|
| ユーザー |
lynmisakura
|
| 提出日時 | 2021-01-02 17:11:12 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 617 bytes |
| コンパイル時間 | 2,057 ms |
| コンパイル使用メモリ | 194,680 KB |
| 最終ジャッジ日時 | 2025-01-17 09:05:21 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 TLE * 2 |
ソースコード
// solution for yukicoder_5395
// author : lynmisakura
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,N) for(int i=0;i<N;i++)
ll in[3];
pair<ll,int> a[3];
void main2(){
REP(i,3) cin >> in[i] , a[i].first = in[i], a[i].second = i;
sort(a,a+3);
while(a[0].first + in[a[0].second] <= a[2].first){
a[0].first += in[a[0].second];
}
while(a[1].first + in[a[1].second] <= a[2].first){
a[1].first += in[a[1].second];
}
REP(i,3)REP(j,3) if(a[j].second == i)cout << a[j].first << (i < 2 ? ' ': '\n');
}
int main(void){
int t;cin >> t;
while(t--) main2();
}
lynmisakura