結果

問題 No.1224 I hate Sqrt Inequality
ユーザー rutilicusrutilicus
提出日時 2020-09-12 11:07:54
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 680 bytes
コンパイル時間 14,083 ms
コンパイル使用メモリ 414,008 KB
実行使用メモリ 86,604 KB
最終ジャッジ日時 2023-08-30 03:52:25
合計ジャッジ時間 18,226 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 305 ms
56,276 KB
testcase_01 AC 305 ms
86,604 KB
testcase_02 AC 301 ms
53,012 KB
testcase_03 AC 306 ms
53,060 KB
testcase_04 WA -
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:28:13: warning: 'appendln(String?): kotlin.text.StringBuilder /* = java.lang.StringBuilder */' is deprecated. Use appendLine instead. Note that the new method always appends the line feed character '\n' regardless of the system line separator.
    builder.appendln("No")
            ^

ソースコード

diff #

import kotlin.math.max

fun main() {
    val builder = StringBuilder()

    val (a, b) = readInputLine().split(" ").map { it.toLong() }

    var aTmp = a
    var bTmp = b

    for (i in LongRange(2L, max(a, b))) {
        if (i % 2L == 0L || i % 5L == 0L) {
            continue
        }
        if (bTmp % 2L == 0L && bTmp % 5L == 0L) {
            break
        }
        while (bTmp % i == 0L) {
            if (aTmp % i != 0L) {
                println("Yes")
                return
            }
            aTmp /= i
            bTmp /= i
        }
    }

    builder.appendln("No")

    print(builder.toString())
}

fun readInputLine(): String {
    return readLine()!!
}
0