結果

問題 No.799 赤黒かーどげぇむ
ユーザー ktgw0316ktgw0316
提出日時 2019-03-30 00:03:07
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 318 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 11,915 ms
コンパイル使用メモリ 447,768 KB
実行使用メモリ 57,052 KB
最終ジャッジ日時 2024-04-30 20:05:03
合計ジャッジ時間 19,210 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 311 ms
56,904 KB
testcase_01 AC 310 ms
56,804 KB
testcase_02 AC 311 ms
57,020 KB
testcase_03 AC 306 ms
56,912 KB
testcase_04 AC 309 ms
56,808 KB
testcase_05 AC 309 ms
56,856 KB
testcase_06 AC 305 ms
56,820 KB
testcase_07 AC 310 ms
56,876 KB
testcase_08 AC 307 ms
56,796 KB
testcase_09 AC 309 ms
56,884 KB
testcase_10 AC 306 ms
56,816 KB
testcase_11 AC 309 ms
56,988 KB
testcase_12 AC 305 ms
56,792 KB
testcase_13 AC 306 ms
56,924 KB
testcase_14 AC 301 ms
56,800 KB
testcase_15 AC 304 ms
56,804 KB
testcase_16 AC 309 ms
56,768 KB
testcase_17 AC 309 ms
56,780 KB
testcase_18 AC 313 ms
57,052 KB
testcase_19 AC 318 ms
56,888 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:3:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

import kotlin.math.*

fun main(args: Array<String>) {
    val (a, b, c, d) = readLine()!!.split(" ").map(String::toInt)
    // val red = (a..b).toList()
    // val black = (c..d).toList()
    val all = (b - a + 1) * (d - c + 1) 
    val same = max(0, min(b, d) - max(a, c) + 1)
    println(all - same)
}
0