結果

問題 No.36 素数が嫌い!
ユーザー lrf141lrf141
提出日時 2017-03-28 22:01:25
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 1,093 ms / 5,000 ms
コード長 484 bytes
コンパイル時間 8,073 ms
コンパイル使用メモリ 245,040 KB
実行使用メモリ 62,304 KB
最終ジャッジ日時 2023-09-12 12:41:02
合計ジャッジ時間 39,704 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 980 ms
61,852 KB
testcase_01 AC 1,093 ms
61,928 KB
testcase_02 AC 900 ms
62,304 KB
testcase_03 AC 902 ms
61,880 KB
testcase_04 AC 921 ms
61,832 KB
testcase_05 AC 919 ms
62,072 KB
testcase_06 AC 942 ms
61,920 KB
testcase_07 AC 927 ms
61,876 KB
testcase_08 AC 920 ms
62,232 KB
testcase_09 AC 923 ms
61,844 KB
testcase_10 AC 919 ms
61,928 KB
testcase_11 AC 968 ms
61,872 KB
testcase_12 AC 1,054 ms
61,960 KB
testcase_13 AC 1,051 ms
61,968 KB
testcase_14 AC 1,011 ms
61,800 KB
testcase_15 AC 893 ms
62,236 KB
testcase_16 AC 902 ms
61,932 KB
testcase_17 AC 894 ms
61,928 KB
testcase_18 AC 891 ms
61,932 KB
testcase_19 AC 976 ms
61,864 KB
testcase_20 AC 1,077 ms
61,864 KB
testcase_21 AC 1,027 ms
61,944 KB
testcase_22 AC 1,039 ms
61,804 KB
testcase_23 AC 1,021 ms
62,116 KB
testcase_24 AC 1,031 ms
62,004 KB
testcase_25 AC 1,001 ms
62,056 KB
testcase_26 AC 1,006 ms
61,796 KB
testcase_27 AC 1,051 ms
61,860 KB
testcase_28 AC 1,006 ms
62,016 KB
testcase_29 AC 1,078 ms
61,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner
import scala.collection.mutable._

object no36{
    def main(args:Array[String]):Unit = {
        var n = scala.io.StdIn.readLong
        val res = ListBuffer[Int]()
        for(i <- 2 to (Math.sqrt(n).toInt+1)){
            while(n%i == 0){
                res += i
                n /= i
            }
        }
        if(n != 1) res += n.toInt
        if(2 < res.size){
            println("YES")
        }else{
            println("NO")
        }
    }
}
0