結果
| 問題 |
No.358 も~っと!門松列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-04-17 22:42:23 |
| 言語 | Haskell (9.10.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 473 bytes |
| コンパイル時間 | 3,908 ms |
| コンパイル使用メモリ | 175,616 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-04 10:39:46 |
| 合計ジャッジ時間 | 4,571 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main ( Main.hs, Main.o )
Main.hs:3:1: warning: [GHC-94817] [-Wtabs]
Tab character found here, and in 20 further locations.
Suggested fix: Please use spaces instead.
|
3 | where max = maximum [a,b,c];
| ^^^^^^^^
[2 of 2] Linking a.out
ソースコード
isKadomatsu :: Integer -> Integer -> Integer -> Bool isKadomatsu a b c = (a /= b && b /= c && a /= c) && (b == max || b == min) where max = maximum [a,b,c]; min = minimum [a,b,c]; main = do [a1, a2, a3] <- getLine >>= return . map (read::String->Integer) . words putStrLn $ if a1 == a2 || a2 == a3 || a1 == a3 then "0" else if isKadomatsu a1 a2 a3 then "INF" else show $ sum[1|p<-[1..maximum[a1,a2,a3]], isKadomatsu (mod a1 p) (mod a2 p) (mod a3 p)]