結果
| 問題 | No.36 素数が嫌い! |
| コンテスト | |
| ユーザー |
kou_kkk
|
| 提出日時 | 2025-07-14 12:36:36 |
| 言語 | Haskell (9.14.1) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 5,000 ms |
| + 130µs | |
| コード長 | 397 bytes |
| 記録 | |
| コンパイル時間 | 8,240 ms |
| コンパイル使用メモリ | 198,272 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-07-13 05:56:58 |
| 合計ジャッジ時間 | 10,104 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
module Main where
main :: IO ()
main = readLn >>= putStrLn . solve
solve :: Int -> String
solve n | isnotPrime n = "YES"
| otherwise = "NO"
isnotPrime :: Int -> Bool
isnotPrime = (>=3) . length . primes
primes :: Int -> [Int]
primes n = go n 2
go :: Int -> Int -> [Int]
go x i | i * i > x = [x]
| x `mod` i == 0 = i : go (x `div` i) i
| otherwise = go x $ succ i
kou_kkk