結果

問題 No.308 素数は通れません
ユーザー firiexpfiriexp
提出日時 2020-03-28 15:18:01
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 1,696 bytes
コンパイル時間 15,359 ms
コンパイル使用メモリ 428,888 KB
実行使用メモリ 54,012 KB
最終ジャッジ日時 2023-08-30 17:46:40
合計ジャッジ時間 50,925 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 272 ms
50,436 KB
testcase_01 AC 268 ms
50,168 KB
testcase_02 AC 284 ms
53,684 KB
testcase_03 AC 285 ms
53,488 KB
testcase_04 AC 290 ms
53,792 KB
testcase_05 AC 287 ms
53,652 KB
testcase_06 AC 289 ms
53,720 KB
testcase_07 AC 293 ms
53,624 KB
testcase_08 AC 290 ms
53,764 KB
testcase_09 AC 290 ms
53,664 KB
testcase_10 AC 289 ms
54,012 KB
testcase_11 AC 289 ms
53,708 KB
testcase_12 AC 289 ms
53,592 KB
testcase_13 AC 289 ms
53,596 KB
testcase_14 AC 293 ms
53,656 KB
testcase_15 AC 273 ms
50,284 KB
testcase_16 WA -
testcase_17 AC 275 ms
50,200 KB
testcase_18 AC 273 ms
50,308 KB
testcase_19 AC 272 ms
50,440 KB
testcase_20 AC 272 ms
50,352 KB
testcase_21 AC 270 ms
50,176 KB
testcase_22 AC 270 ms
50,588 KB
testcase_23 AC 270 ms
50,176 KB
testcase_24 AC 272 ms
50,196 KB
testcase_25 WA -
testcase_26 AC 273 ms
50,204 KB
testcase_27 AC 273 ms
50,296 KB
testcase_28 AC 269 ms
50,648 KB
testcase_29 WA -
testcase_30 AC 272 ms
50,144 KB
testcase_31 AC 269 ms
50,188 KB
testcase_32 AC 276 ms
50,268 KB
testcase_33 AC 268 ms
50,180 KB
testcase_34 WA -
testcase_35 AC 268 ms
50,104 KB
testcase_36 AC 269 ms
50,332 KB
testcase_37 AC 269 ms
50,228 KB
testcase_38 AC 267 ms
50,244 KB
testcase_39 AC 266 ms
50,292 KB
testcase_40 AC 267 ms
50,284 KB
testcase_41 AC 270 ms
50,472 KB
testcase_42 AC 265 ms
50,164 KB
testcase_43 AC 262 ms
50,316 KB
testcase_44 AC 262 ms
50,456 KB
testcase_45 AC 264 ms
50,300 KB
testcase_46 AC 264 ms
50,164 KB
testcase_47 AC 268 ms
50,112 KB
testcase_48 AC 268 ms
50,128 KB
testcase_49 AC 279 ms
50,440 KB
testcase_50 AC 269 ms
50,020 KB
testcase_51 AC 267 ms
50,144 KB
testcase_52 AC 286 ms
50,232 KB
testcase_53 AC 274 ms
50,192 KB
testcase_54 WA -
testcase_55 WA -
testcase_56 AC 272 ms
50,204 KB
testcase_57 AC 275 ms
50,232 KB
testcase_58 AC 318 ms
50,580 KB
testcase_59 AC 270 ms
50,228 KB
testcase_60 AC 272 ms
50,252 KB
testcase_61 AC 275 ms
50,252 KB
testcase_62 AC 277 ms
50,100 KB
testcase_63 AC 271 ms
50,592 KB
testcase_64 AC 272 ms
50,184 KB
testcase_65 AC 267 ms
50,152 KB
testcase_66 AC 268 ms
50,316 KB
testcase_67 AC 278 ms
50,528 KB
testcase_68 AC 266 ms
49,976 KB
testcase_69 AC 271 ms
50,172 KB
testcase_70 AC 272 ms
50,512 KB
testcase_71 AC 275 ms
50,200 KB
testcase_72 AC 268 ms
50,384 KB
testcase_73 AC 266 ms
50,224 KB
testcase_74 AC 270 ms
50,080 KB
testcase_75 AC 264 ms
50,424 KB
testcase_76 AC 280 ms
50,552 KB
testcase_77 WA -
testcase_78 WA -
testcase_79 WA -
testcase_80 AC 286 ms
50,452 KB
testcase_81 AC 291 ms
50,540 KB
testcase_82 WA -
testcase_83 WA -
testcase_84 AC 297 ms
50,472 KB
testcase_85 WA -
testcase_86 AC 286 ms
50,488 KB
testcase_87 AC 291 ms
50,496 KB
testcase_88 WA -
testcase_89 WA -
testcase_90 AC 289 ms
50,380 KB
testcase_91 WA -
testcase_92 WA -
testcase_93 WA -
testcase_94 WA -
testcase_95 WA -
testcase_96 AC 271 ms
50,252 KB
testcase_97 AC 271 ms
49,988 KB
testcase_98 AC 269 ms
50,192 KB
testcase_99 AC 273 ms
50,368 KB
testcase_100 AC 270 ms
50,260 KB
testcase_101 AC 323 ms
50,988 KB
testcase_102 WA -
testcase_103 AC 273 ms
50,624 KB
testcase_104 AC 270 ms
50,192 KB
testcase_105 AC 270 ms
50,308 KB
testcase_106 AC 273 ms
50,148 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:32:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

import java.io.PrintWriter
import java.lang.Math.abs
import java.math.BigDecimal
import java.math.BigInteger
import java.util.*
import kotlin.math.max
import kotlin.math.min

@JvmField val INPUT = System.`in`
@JvmField val OUTPUT = System.out
@JvmField val cin = INPUT.bufferedReader()
fun readLine(): String? = cin.readLine()
fun readLn() = cin.readLine()!!
@JvmField var _tokenizer: StringTokenizer = StringTokenizer("")
fun read(): String {
    while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(cin.readLine() ?: return "", " ")
    return _tokenizer.nextToken()
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = List(n) { read() }
fun readLines(n: Int) = List(n) { readLn() }
fun readInts(n: Int) = List(n) { read().toInt() }
fun readIntArray(n: Int) = IntArray(n) { read().toInt() }
fun readDoubles(n: Int) = List(n) { read().toDouble() }
fun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }
fun readLongs(n: Int) = List(n) { read().toLong() }
fun readLongArray(n: Int) = LongArray(n) { read().toLong() }
@JvmField val cout = PrintWriter(OUTPUT, false)

fun main(args: Array<String>) {
    val t = read().toBigInteger()
    if(t <= 25.toBigInteger()){
        val tt = t.toInt()
        cout.println( when(tt) {
            4 -> 3
            6 -> 5
            in arrayOf(8, 9, 10, 15, 16, 22) -> 7
            12 -> 11
            14 -> 13
            20 -> 19
            21 -> 19
            24 -> 23
            25 -> 23
            else -> 8
        })
    }else {
        cout.println(if(t.minus(8.toBigInteger()).isProbablePrime(100)) 14 else 8)
    }
    cout.flush()
}
0