結果
問題 |
No.1423 Triangle of Multiples
|
ユーザー |
|
提出日時 | 2020-12-11 08:33:39 |
言語 | Kotlin (2.1.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,421 bytes |
コンパイル時間 | 12,255 ms |
コンパイル使用メモリ | 436,152 KB |
実行使用メモリ | 88,540 KB |
最終ジャッジ日時 | 2024-10-13 17:36:07 |
合計ジャッジ時間 | 17,183 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 WA * 1 TLE * 1 -- * 1 |
ソースコード
import java.io.PrintWriter import java.util.* import kotlin.math.* fun PrintWriter.solve() { val t = nextInt() case@for (_i in 0 until t) { val a = nextInt() val b = nextInt() val c = nextInt() val min = minOf(a, b, c) if (a == min) { for (x in a .. 200000 step a) { if (abs(b - c) < x && x < b + c) { println("$x $b $c") continue@case } } } else if (b == min) { for (x in b .. 200000 step b) { if (abs(c - a) < x && x < c + a) { println("$a $x $c") continue@case } } } else { for (x in c .. 200000 step c) { if (abs(a - b) < x && x < a + b) { println("$a $b $x") continue@case } } } } } fun main() { val writer = PrintWriter(System.out, false) writer.solve() writer.flush() } // region Scanner private var st = StringTokenizer("") private val br = System.`in`.bufferedReader() fun next(): String { while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine()) return st.nextToken() } fun nextInt() = next().toInt() fun nextLong() = next().toLong() fun nextLine() = br.readLine() fun nextDouble() = next().toDouble() // endregion