結果

問題 No.36 素数が嫌い!
ユーザー tottoripapertottoripaper
提出日時 2014-11-24 05:44:15
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 268 bytes
コンパイル時間 2,958 ms
コンパイル使用メモリ 155,788 KB
実行使用メモリ 11,376 KB
最終ジャッジ日時 2023-08-30 22:42:39
合計ジャッジ時間 3,390 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,996 KB
testcase_01 AC 2 ms
6,996 KB
testcase_02 AC 2 ms
6,968 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 4 ms
8,364 KB
testcase_08 AC 3 ms
6,988 KB
testcase_09 AC 2 ms
6,900 KB
testcase_10 AC 3 ms
6,884 KB
testcase_11 AC 152 ms
11,136 KB
testcase_12 AC 442 ms
11,120 KB
testcase_13 WA -
testcase_14 AC 5 ms
8,424 KB
testcase_15 AC 2 ms
6,872 KB
testcase_16 AC 2 ms
6,912 KB
testcase_17 AC 2 ms
6,988 KB
testcase_18 AC 3 ms
6,880 KB
testcase_19 AC 2 ms
6,928 KB
testcase_20 AC 2 ms
6,932 KB
testcase_21 AC 2 ms
6,928 KB
testcase_22 AC 2 ms
6,952 KB
testcase_23 AC 2 ms
6,876 KB
testcase_24 AC 2 ms
7,008 KB
testcase_25 AC 2 ms
6,904 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

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"
0