結果

問題 No.98 円を描こう
コンテスト
ユーザー Pump0129
提出日時 2018-04-08 15:16:54
言語 Kotlin
(2.3.20)
コンパイル:
kotlinc _filename_ -include-runtime -d main.jar
実行:
kotlin main.jar
結果
WA  
実行時間 -
コード長 449 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 8,405 ms
コンパイル使用メモリ 445,348 KB
実行使用メモリ 52,140 KB
最終ジャッジ日時 2026-05-14 18:23:19
合計ジャッジ時間 11,328 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 4 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package net.ipipip0129.kotlin.yukicoder

fun main(args: Array<String>) {
    val data = readLine()!!.split(" ")
    val pos = Pos(data[0].toDouble(), data[1].toDouble())

    val dis = Math.sqrt(Math.pow(pos.x, 2.0) + Math.pow(pos.y, 2.0))

    if (dis == dis.toLong().toDouble()) {
        println(dis.toLong() * 2 + 1)
    }else {
        println(Math.ceil(dis).toLong() * 2)
    }
}

private class Pos(val x: Double, val y: Double)
0