結果
| 問題 | 
                            No.3142 Balancing with O=>X Flip
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2025-05-16 22:10:27 | 
| 言語 | Haskell  (9.10.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 352 bytes | 
| コンパイル時間 | 4,771 ms | 
| コンパイル使用メモリ | 173,440 KB | 
| 実行使用メモリ | 13,824 KB | 
| 最終ジャッジ日時 | 2025-05-16 22:10:33 | 
| 合計ジャッジ時間 | 5,940 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 15 WA * 9 | 
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.10.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
f s m
  | null s = null m
  | null m = f ts [x]
  | [x, y] == "()" = f ts tm
  | otherwise = f ts (x : m)
  where
    (x : ts) = s 
    (y : tm) = m
main :: IO ()
main = do
  n <- read <$> getLine :: IO Int
  s <- getLine
  let
    x = length $ filter (=='(') s
    y = length $ filter (==')') s
    bl = f s []
  putStrLn $ if bl then "Yes" else "No"