結果
問題 |
No.406 鴨等間隔の法則
|
ユーザー |
![]() |
提出日時 | 2017-02-11 18:47:01 |
言語 | Haskell (9.10.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 271 bytes |
コンパイル時間 | 7,961 ms |
コンパイル使用メモリ | 173,440 KB |
実行使用メモリ | 44,672 KB |
最終ジャッジ日時 | 2024-11-07 10:14:00 |
合計ジャッジ時間 | 15,223 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 27 WA * 2 |
コンパイルメッセージ
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:6:1: warning: [GHC-94817] [-Wtabs] Tab character found here, and in 9 further locations. Suggested fix: Please use spaces instead. | 6 | where | ^^^^^^^^ [2 of 2] Linking a.out
ソースコード
import Control.Applicative import Data.List f 2 _ = "YES" f n (x:xs) = if (x2 - x1) == (x3 - x2) then f (n-1) xs else "NO" where x1 = x x2 = xs !! 0 x3 = xs !! 1 main = do n <- getLine xs <- (map read . words) <$> getLine putStrLn $ f (read n) (sort xs)