結果
| 問題 | No.312 置換処理 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-09 23:55:25 |
| 言語 | Kotlin (2.3.20) |
| 結果 |
AC
|
| 実行時間 | 178 ms / 2,000 ms |
| コード長 | 290 bytes |
| 記録 | |
| コンパイル時間 | 10,320 ms |
| コンパイル使用メモリ | 434,556 KB |
| 実行使用メモリ | 51,052 KB |
| 最終ジャッジ日時 | 2026-05-10 11:39:48 |
| 合計ジャッジ時間 | 20,915 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 45 |
ソースコード
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))
}