結果
| 問題 |
No.1423 Triangle of Multiples
|
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2021-03-12 21:32:28 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 918 bytes |
| コンパイル時間 | 2,369 ms |
| コンパイル使用メモリ | 85,184 KB |
| 実行使用メモリ | 53,988 KB |
| 最終ジャッジ日時 | 2024-10-14 11:42:57 |
| 合計ジャッジ時間 | 4,774 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 4 |
ソースコード
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
PrintWriter pw = new PrintWriter(System.out);
for (int z = 0; z < t; z++) {
String[] sa = br.readLine().split(" ");
Obj[] arr = new Obj[3];
for (int i = 0; i < 3; i++) {
Obj o = new Obj();
o.i = i;
o.a = Integer.parseInt(sa[i]);
o.x = o.a;
arr[i] = o;
}
Arrays.sort(arr, (o1, o2) -> o1.a - o2.a);
while (arr[0].x + arr[1].x <= arr[2].x) {
arr[0].x *= 2;
}
Arrays.sort(arr, (o1, o2) -> o1.i - o2.i);
System.out.println(arr[0].x + " " + arr[1].x + " " + arr[2].x);
}
pw.flush();
br.close();
}
static class Obj {
int i, a;
long x;
}
}
ks2m