結果
| 問題 |
No.722 100×100=1000
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-23 05:46:53 |
| 言語 | Kotlin (2.1.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 637 bytes |
| コンパイル時間 | 13,639 ms |
| コンパイル使用メモリ | 436,928 KB |
| 実行使用メモリ | 56,992 KB |
| 最終ジャッジ日時 | 2024-10-12 11:00:38 |
| 合計ジャッジ時間 | 24,005 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 WA * 1 |
コンパイルメッセージ
Main.kt:8:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
^
ソースコード
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")
}
}
}