結果
問題 | No.290 1010 |
ユーザー |
|
提出日時 | 2015-10-21 20:44:37 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 199 ms / 5,000 ms |
コード長 | 300 bytes |
コンパイル時間 | 3,392 ms |
コンパイル使用メモリ | 169,600 KB |
実行使用メモリ | 58,880 KB |
最終ジャッジ日時 | 2024-07-22 11:23:48 |
合計ジャッジ時間 | 5,473 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
コンパイルメッセージ
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
ソースコード
import Control.Applicative main :: IO () main = do n <- read <$> getLine s <- getLine putStrLn $ if solve n s then "YES" else "NO" solve :: Int -> String -> Bool solve n s | length s > 3 = True | length s == 1 = False | s `elem` ["01", "10", "010", "101"] = False | otherwise = True