結果

問題 No.312 置換処理
ユーザー 826814741_6826814741_6
提出日時 2019-01-09 23:55:25
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 14,099 ms
コンパイル使用メモリ 409,084 KB
実行使用メモリ 52,288 KB
最終ジャッジ日時 2023-08-09 16:14:44
合計ジャッジ時間 28,582 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 263 ms
50,200 KB
testcase_01 AC 267 ms
50,304 KB
testcase_02 AC 269 ms
50,488 KB
testcase_03 AC 272 ms
50,428 KB
testcase_04 AC 261 ms
50,264 KB
testcase_05 AC 266 ms
50,560 KB
testcase_06 AC 262 ms
50,140 KB
testcase_07 AC 263 ms
50,376 KB
testcase_08 AC 258 ms
50,348 KB
testcase_09 AC 253 ms
50,228 KB
testcase_10 AC 262 ms
50,192 KB
testcase_11 AC 262 ms
50,500 KB
testcase_12 AC 257 ms
50,280 KB
testcase_13 AC 260 ms
50,140 KB
testcase_14 AC 264 ms
50,400 KB
testcase_15 AC 264 ms
52,288 KB
testcase_16 AC 259 ms
50,428 KB
testcase_17 AC 264 ms
50,412 KB
testcase_18 AC 259 ms
50,392 KB
testcase_19 AC 258 ms
50,680 KB
testcase_20 AC 264 ms
50,400 KB
testcase_21 AC 260 ms
50,476 KB
testcase_22 AC 271 ms
50,304 KB
testcase_23 AC 270 ms
50,260 KB
testcase_24 AC 262 ms
50,208 KB
testcase_25 AC 256 ms
50,288 KB
testcase_26 AC 256 ms
50,256 KB
testcase_27 AC 255 ms
50,368 KB
testcase_28 AC 256 ms
50,856 KB
testcase_29 AC 262 ms
50,184 KB
testcase_30 AC 262 ms
50,368 KB
testcase_31 AC 259 ms
50,272 KB
testcase_32 AC 257 ms
50,292 KB
testcase_33 AC 265 ms
50,344 KB
testcase_34 AC 262 ms
50,540 KB
testcase_35 AC 256 ms
50,348 KB
testcase_36 AC 255 ms
50,560 KB
testcase_37 AC 254 ms
50,484 KB
testcase_38 AC 264 ms
50,276 KB
testcase_39 AC 265 ms
50,188 KB
testcase_40 AC 260 ms
50,208 KB
testcase_41 AC 264 ms
50,364 KB
testcase_42 AC 263 ms
50,204 KB
testcase_43 AC 263 ms
50,280 KB
testcase_44 AC 264 ms
50,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:10:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

import kotlin.math.*

fun g(n: Long): Long = floor(sqrt(n.toDouble())).toLong()

fun f(m: Long, n: Long): Long {
    for (i in 3..m) if (n%i==0L) return i
    return if (n!=4L&&n%2==0L) n/2 else n
}

fun main(args: Array<String>) {
    val n = readLine()!!.toLong()
    println(f(g(n),n))
}
0