結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
![]() |
提出日時 | 2014-11-24 05:44:15 |
言語 | Haskell (9.10.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 268 bytes |
コンパイル時間 | 5,967 ms |
コンパイル使用メモリ | 178,560 KB |
実行使用メモリ | 10,240 KB |
最終ジャッジ日時 | 2025-01-02 21:09:54 |
合計ジャッジ時間 | 8,472 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 WA * 9 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.10.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
isPrime 1 = False isPrime n = helper n 2 where helper n x | x * x > n = True | n `mod` x == 0 = False | otherwise = helper n (x+1) main = do n <- readLn putStrLn $ if n == 1 || isPrime n then "NO" else "YES"