結果

問題 No.172 UFOを捕まえろ
コンテスト
ユーザー rutilicus
提出日時 2021-02-13 16:25:18
言語 Kotlin
(2.3.20)
コンパイル:
kotlinc _filename_ -include-runtime -d main.jar
実行:
kotlin main.jar
結果
AC  
実行時間 274 ms / 5,000 ms
コード長 417 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,878 ms
コンパイル使用メモリ 462,416 KB
実行使用メモリ 59,068 KB
最終ジャッジ日時 2026-04-03 02:13:30
合計ジャッジ時間 16,241 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import kotlin.math.abs
import kotlin.math.ceil
import kotlin.math.sqrt

fun main() {
    val builder = StringBuilder()

    val (x, y, r) = readInputLine().split(" ").map { it.toInt() }

    // 何も分からんから競プロ向いてない
    builder.appendLine((abs(x) + abs(y) + ceil(sqrt(2.0) * r.toDouble())).toLong())

    print(builder.toString())
}

fun readInputLine(): String {
    return readLine()!!
}
0