結果

問題 No.312 置換処理
ユーザー 826814741_6826814741_6
提出日時 2019-01-09 23:55:25
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 315 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 12,465 ms
コンパイル使用メモリ 426,812 KB
実行使用メモリ 54,372 KB
最終ジャッジ日時 2024-04-27 11:00:29
合計ジャッジ時間 27,220 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 292 ms
54,200 KB
testcase_01 AC 298 ms
54,252 KB
testcase_02 AC 309 ms
54,196 KB
testcase_03 AC 313 ms
54,184 KB
testcase_04 AC 294 ms
54,204 KB
testcase_05 AC 289 ms
54,272 KB
testcase_06 AC 315 ms
54,108 KB
testcase_07 AC 299 ms
54,248 KB
testcase_08 AC 288 ms
54,312 KB
testcase_09 AC 294 ms
54,140 KB
testcase_10 AC 294 ms
54,248 KB
testcase_11 AC 288 ms
54,224 KB
testcase_12 AC 291 ms
54,328 KB
testcase_13 AC 286 ms
54,216 KB
testcase_14 AC 288 ms
54,144 KB
testcase_15 AC 288 ms
54,220 KB
testcase_16 AC 287 ms
54,364 KB
testcase_17 AC 283 ms
54,156 KB
testcase_18 AC 292 ms
54,280 KB
testcase_19 AC 292 ms
54,264 KB
testcase_20 AC 283 ms
54,124 KB
testcase_21 AC 281 ms
54,208 KB
testcase_22 AC 292 ms
54,200 KB
testcase_23 AC 285 ms
54,088 KB
testcase_24 AC 285 ms
54,372 KB
testcase_25 AC 296 ms
54,124 KB
testcase_26 AC 295 ms
54,136 KB
testcase_27 AC 288 ms
54,276 KB
testcase_28 AC 296 ms
54,304 KB
testcase_29 AC 293 ms
54,272 KB
testcase_30 AC 298 ms
54,232 KB
testcase_31 AC 304 ms
54,184 KB
testcase_32 AC 314 ms
54,128 KB
testcase_33 AC 302 ms
54,204 KB
testcase_34 AC 310 ms
54,176 KB
testcase_35 AC 308 ms
54,184 KB
testcase_36 AC 297 ms
54,320 KB
testcase_37 AC 290 ms
54,228 KB
testcase_38 AC 292 ms
54,124 KB
testcase_39 AC 291 ms
54,144 KB
testcase_40 AC 293 ms
54,108 KB
testcase_41 AC 294 ms
54,200 KB
testcase_42 AC 295 ms
54,268 KB
testcase_43 AC 288 ms
54,196 KB
testcase_44 AC 295 ms
54,108 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