結果

問題 No.722 100×100=1000
ユーザー Pump0129Pump0129
提出日時 2018-08-23 05:46:53
言語 Kotlin
(1.9.10)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 637 bytes
コンパイル時間 13,879 ms
コンパイル使用メモリ 418,108 KB
実行使用メモリ 53,204 KB
最終ジャッジ日時 2023-08-02 15:17:13
合計ジャッジ時間 23,488 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 281 ms
52,840 KB
testcase_01 AC 281 ms
52,968 KB
testcase_02 AC 286 ms
53,044 KB
testcase_03 AC 283 ms
52,980 KB
testcase_04 AC 284 ms
53,200 KB
testcase_05 AC 283 ms
52,820 KB
testcase_06 AC 287 ms
52,924 KB
testcase_07 AC 285 ms
53,028 KB
testcase_08 AC 286 ms
53,204 KB
testcase_09 AC 283 ms
52,800 KB
testcase_10 AC 284 ms
52,900 KB
testcase_11 AC 283 ms
52,844 KB
testcase_12 AC 283 ms
52,920 KB
testcase_13 AC 280 ms
52,936 KB
testcase_14 AC 283 ms
52,808 KB
testcase_15 AC 289 ms
53,032 KB
testcase_16 AC 286 ms
52,804 KB
testcase_17 AC 290 ms
53,144 KB
testcase_18 AC 288 ms
52,952 KB
testcase_19 AC 285 ms
52,916 KB
testcase_20 AC 284 ms
52,944 KB
testcase_21 AC 287 ms
52,844 KB
testcase_22 AC 287 ms
53,184 KB
testcase_23 AC 288 ms
52,768 KB
testcase_24 AC 283 ms
52,900 KB
testcase_25 AC 281 ms
52,988 KB
testcase_26 AC 283 ms
52,932 KB
testcase_27 AC 282 ms
52,900 KB
testcase_28 AC 281 ms
52,920 KB
testcase_29 AC 282 ms
53,020 KB
testcase_30 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:8:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

package net.ipipip0129.kotlin.yukicoder

import kotlin.math.abs
import kotlin.math.pow

fun checkNum(x: Int): Boolean = 10 < abs(x) && abs(x) % 10.0.pow(abs(x).toString().length - 1).toInt() == 0

fun main(args: Array<String>) {
    val numList = readLine()!!.split(" ").map { it.toInt() }
    if (checkNum(numList[0]) && checkNum(numList[1])) {
        print(((numList[0].toLong() * numList[1].toLong()) / 10))
    } else {
        val ans = numList[0].toLong() * numList[1].toLong()
        if (-99999999 <= ans && ans <= 99999999) {
            print(ans)
        } else {
            println("E")
        }
    }
}
0