結果

問題 No.920 あかあお
ユーザー バカらっくバカらっく
提出日時 2022-02-14 02:24:09
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 285 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 11,439 ms
コンパイル使用メモリ 420,372 KB
実行使用メモリ 54,964 KB
最終ジャッジ日時 2023-09-11 15:47:30
合計ジャッジ時間 17,838 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 276 ms
53,004 KB
testcase_01 AC 285 ms
53,036 KB
testcase_02 AC 280 ms
52,708 KB
testcase_03 AC 274 ms
52,604 KB
testcase_04 AC 278 ms
52,836 KB
testcase_05 AC 276 ms
52,912 KB
testcase_06 AC 272 ms
52,656 KB
testcase_07 AC 278 ms
52,756 KB
testcase_08 AC 275 ms
52,880 KB
testcase_09 AC 279 ms
52,748 KB
testcase_10 AC 280 ms
52,880 KB
testcase_11 AC 280 ms
53,076 KB
testcase_12 AC 278 ms
54,964 KB
testcase_13 AC 276 ms
52,596 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    val (x,y,z) = readLine()!!.split(" ").map { it.toInt() }
    val diff = Math.abs(x-y)
    val ans = if(diff > z) {
        Math.min(x,y) + z
    } else {
        Math.max(x,y) + (z-diff)/2
    }
    println(ans)
}
0