結果

問題 No.722 100×100=1000
ユーザー Pump0129
提出日時 2018-08-23 05:44:13
言語 Kotlin
(2.1.0)
結果
WA  
実行時間 -
コード長 622 bytes
コンパイル時間 13,891 ms
コンパイル使用メモリ 439,448 KB
実行使用メモリ 59,000 KB
最終ジャッジ日時 2024-10-12 11:01:43
合計ジャッジ時間 25,573 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21 WA * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 = 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