結果

問題 No.1423 Triangle of Multiples
ユーザー lynmisakuralynmisakura
提出日時 2021-01-02 17:11:12
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 617 bytes
コンパイル時間 2,690 ms
コンパイル使用メモリ 196,824 KB
実行使用メモリ 13,752 KB
最終ジャッジ日時 2024-04-21 18:54:39
合計ジャッジ時間 5,973 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,752 KB
testcase_01 AC 3 ms
6,816 KB
testcase_02 AC 81 ms
6,940 KB
testcase_03 TLE -
testcase_04 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

// 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();
}
0