結果
| 問題 | 
                            No.113 宝探し
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2015-04-18 15:12:40 | 
| 言語 | Haskell  (9.10.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 262 bytes | 
| コンパイル時間 | 5,563 ms | 
| コンパイル使用メモリ | 175,104 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-16 20:50:12 | 
| 合計ジャッジ時間 | 6,450 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| 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:5:1: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in 10 further locations.
    Suggested fix: Please use spaces instead.
  |
5 |         where
  | ^^^^^^^^
[2 of 2] Linking a.out
            
            ソースコード
main = getLine >>= print . solve solve :: String -> Double solve = calc . foldl ff (0.0, 0.0) where ff (x, y) z | z == 'N' = (x, y + 1) | z == 'E' = (x + 1, y) | z == 'W' = (x - 1, y) | otherwise = (x, y - 1) calc (x, y) = sqrt $ x ** 2.0 + y ** 2.0