結果

問題 No.889 素数!
ユーザー trineutron
提出日時 2019-06-16 20:50:47
言語 Haskell
(9.10.1)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 7,574 ms
コンパイル使用メモリ 175,488 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-07 02:23:57
合計ジャッジ時間 8,732 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 35 WA * 26
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

main = do
    n <- readLn
    if n `elem` [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61]
        then putStrLn "素数!"
    else if n `elem` [i ^ 2 | i <- [2 .. 7]] then putStrLn "平方数!"
    else if n `elem` [i ^ 3 | i <- [2 .. 3]] then putStrLn "立方数!"
    else if n `elem` [6, 28] then putStrLn "完全数!"
    else print n
0