結果
問題 | No.308 素数は通れません |
ユーザー | firiexp |
提出日時 | 2020-03-28 15:24:10 |
言語 | Kotlin (1.9.23) |
結果 |
AC
|
実行時間 | 333 ms / 1,000 ms |
コード長 | 1,744 bytes |
コンパイル時間 | 15,278 ms |
コンパイル使用メモリ | 439,456 KB |
実行使用メモリ | 57,968 KB |
最終ジャッジ日時 | 2024-06-10 17:28:30 |
合計ジャッジ時間 | 47,763 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 277 ms
54,148 KB |
testcase_01 | AC | 279 ms
54,156 KB |
testcase_02 | AC | 290 ms
57,888 KB |
testcase_03 | AC | 294 ms
57,724 KB |
testcase_04 | AC | 295 ms
57,928 KB |
testcase_05 | AC | 293 ms
57,792 KB |
testcase_06 | AC | 291 ms
57,732 KB |
testcase_07 | AC | 290 ms
57,728 KB |
testcase_08 | AC | 293 ms
57,836 KB |
testcase_09 | AC | 291 ms
57,712 KB |
testcase_10 | AC | 294 ms
57,968 KB |
testcase_11 | AC | 292 ms
57,712 KB |
testcase_12 | AC | 292 ms
57,724 KB |
testcase_13 | AC | 292 ms
57,928 KB |
testcase_14 | AC | 290 ms
57,680 KB |
testcase_15 | AC | 270 ms
54,060 KB |
testcase_16 | AC | 282 ms
54,216 KB |
testcase_17 | AC | 278 ms
54,164 KB |
testcase_18 | AC | 268 ms
54,152 KB |
testcase_19 | AC | 270 ms
54,168 KB |
testcase_20 | AC | 279 ms
54,452 KB |
testcase_21 | AC | 286 ms
54,208 KB |
testcase_22 | AC | 291 ms
54,228 KB |
testcase_23 | AC | 282 ms
54,464 KB |
testcase_24 | AC | 271 ms
54,276 KB |
testcase_25 | AC | 275 ms
54,256 KB |
testcase_26 | AC | 272 ms
54,280 KB |
testcase_27 | AC | 283 ms
54,424 KB |
testcase_28 | AC | 269 ms
54,324 KB |
testcase_29 | AC | 274 ms
54,264 KB |
testcase_30 | AC | 273 ms
54,360 KB |
testcase_31 | AC | 272 ms
54,432 KB |
testcase_32 | AC | 283 ms
54,424 KB |
testcase_33 | AC | 273 ms
54,272 KB |
testcase_34 | AC | 279 ms
54,512 KB |
testcase_35 | AC | 274 ms
54,500 KB |
testcase_36 | AC | 270 ms
54,312 KB |
testcase_37 | AC | 271 ms
54,140 KB |
testcase_38 | AC | 272 ms
54,204 KB |
testcase_39 | AC | 274 ms
54,268 KB |
testcase_40 | AC | 288 ms
54,172 KB |
testcase_41 | AC | 288 ms
54,476 KB |
testcase_42 | AC | 270 ms
54,216 KB |
testcase_43 | AC | 270 ms
54,088 KB |
testcase_44 | AC | 277 ms
54,212 KB |
testcase_45 | AC | 273 ms
54,360 KB |
testcase_46 | AC | 273 ms
54,200 KB |
testcase_47 | AC | 273 ms
54,532 KB |
testcase_48 | AC | 275 ms
54,196 KB |
testcase_49 | AC | 285 ms
54,492 KB |
testcase_50 | AC | 277 ms
54,136 KB |
testcase_51 | AC | 275 ms
54,324 KB |
testcase_52 | AC | 268 ms
54,284 KB |
testcase_53 | AC | 272 ms
54,248 KB |
testcase_54 | AC | 276 ms
54,544 KB |
testcase_55 | AC | 280 ms
54,536 KB |
testcase_56 | AC | 273 ms
54,192 KB |
testcase_57 | AC | 271 ms
54,112 KB |
testcase_58 | AC | 273 ms
54,372 KB |
testcase_59 | AC | 272 ms
54,020 KB |
testcase_60 | AC | 273 ms
54,296 KB |
testcase_61 | AC | 286 ms
54,336 KB |
testcase_62 | AC | 272 ms
54,272 KB |
testcase_63 | AC | 270 ms
54,216 KB |
testcase_64 | AC | 273 ms
54,200 KB |
testcase_65 | AC | 275 ms
54,192 KB |
testcase_66 | AC | 271 ms
54,180 KB |
testcase_67 | AC | 275 ms
54,236 KB |
testcase_68 | AC | 270 ms
54,340 KB |
testcase_69 | AC | 273 ms
54,320 KB |
testcase_70 | AC | 270 ms
54,148 KB |
testcase_71 | AC | 274 ms
54,272 KB |
testcase_72 | AC | 282 ms
54,392 KB |
testcase_73 | AC | 280 ms
54,400 KB |
testcase_74 | AC | 279 ms
54,344 KB |
testcase_75 | AC | 283 ms
54,148 KB |
testcase_76 | AC | 284 ms
54,436 KB |
testcase_77 | AC | 298 ms
54,332 KB |
testcase_78 | AC | 289 ms
54,300 KB |
testcase_79 | AC | 291 ms
54,432 KB |
testcase_80 | AC | 299 ms
54,352 KB |
testcase_81 | AC | 299 ms
54,388 KB |
testcase_82 | AC | 288 ms
54,592 KB |
testcase_83 | AC | 290 ms
54,512 KB |
testcase_84 | AC | 292 ms
54,604 KB |
testcase_85 | AC | 287 ms
54,300 KB |
testcase_86 | AC | 286 ms
54,532 KB |
testcase_87 | AC | 293 ms
54,584 KB |
testcase_88 | AC | 287 ms
54,268 KB |
testcase_89 | AC | 291 ms
54,396 KB |
testcase_90 | AC | 300 ms
54,296 KB |
testcase_91 | AC | 318 ms
54,780 KB |
testcase_92 | AC | 331 ms
55,032 KB |
testcase_93 | AC | 333 ms
54,832 KB |
testcase_94 | AC | 333 ms
55,024 KB |
testcase_95 | AC | 328 ms
54,940 KB |
testcase_96 | AC | 280 ms
54,200 KB |
testcase_97 | AC | 269 ms
54,440 KB |
testcase_98 | AC | 267 ms
54,264 KB |
testcase_99 | AC | 274 ms
54,140 KB |
testcase_100 | AC | 274 ms
54,344 KB |
testcase_101 | AC | 318 ms
55,004 KB |
testcase_102 | AC | 326 ms
54,876 KB |
testcase_103 | AC | 291 ms
54,380 KB |
testcase_104 | AC | 276 ms
54,148 KB |
testcase_105 | AC | 267 ms
54,204 KB |
testcase_106 | AC | 273 ms
54,500 KB |
コンパイルメッセージ
Main.kt:32:10: warning: parameter 'args' is never used fun main(args: Array<String>) { ^
ソースコード
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.subtract(8.toBigInteger()).isProbablePrime(100) && t.rem(8.toBigInteger()) == BigInteger.ONE) 14 else 8) } cout.flush() }