結果

問題 No.1396 Giri
ユーザー CuriousFairy315CuriousFairy315
提出日時 2021-02-14 22:18:42
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 377 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 12,310 ms
コンパイル使用メモリ 414,848 KB
実行使用メモリ 59,300 KB
最終ジャッジ日時 2023-09-29 15:56:00
合計ジャッジ時間 21,564 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 263 ms
56,024 KB
testcase_01 AC 265 ms
55,744 KB
testcase_02 AC 367 ms
59,200 KB
testcase_03 AC 263 ms
55,748 KB
testcase_04 AC 269 ms
55,844 KB
testcase_05 AC 361 ms
59,052 KB
testcase_06 AC 262 ms
55,916 KB
testcase_07 AC 264 ms
56,160 KB
testcase_08 AC 261 ms
56,136 KB
testcase_09 AC 269 ms
55,840 KB
testcase_10 AC 256 ms
55,848 KB
testcase_11 AC 257 ms
55,824 KB
testcase_12 AC 266 ms
55,824 KB
testcase_13 AC 264 ms
55,940 KB
testcase_14 AC 272 ms
55,780 KB
testcase_15 AC 266 ms
55,740 KB
testcase_16 AC 274 ms
56,004 KB
testcase_17 AC 281 ms
56,432 KB
testcase_18 AC 308 ms
56,704 KB
testcase_19 AC 355 ms
56,780 KB
testcase_20 AC 370 ms
58,824 KB
testcase_21 AC 376 ms
58,888 KB
testcase_22 AC 351 ms
59,096 KB
testcase_23 AC 361 ms
59,052 KB
testcase_24 AC 362 ms
58,872 KB
testcase_25 AC 377 ms
59,300 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args:Array<String>){
         ^

ソースコード

diff #

fun main(args:Array<String>){
    val N = readLine()!!.toInt()
    val sieve = BooleanArray(N+1){it>=2}
    for (i in 2..N) for (j in 2*i..N step i) sieve[j] = false
    val prime = sieve.withIndex().filter{it.value}.map{it.index}
    var ans = 1L
    val M = 998_244_353L
    for (i in prime.dropLast(1)){
        var j = i.toLong()
        while(j*i<=N)j*=i
        ans=ans*j%M
    }
    println(ans)
}
0