結果
問題 | No.232 めぐるはめぐる (2) |
ユーザー | ducktail |
提出日時 | 2018-09-16 17:08:28 |
言語 | Haskell (9.8.2) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,064 bytes |
コンパイル時間 | 2,316 ms |
コンパイル使用メモリ | 172,620 KB |
実行使用メモリ | 8,064 KB |
最終ジャッジ日時 | 2024-07-18 07:24:51 |
合計ジャッジ時間 | 3,490 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 23 ms
7,808 KB |
testcase_01 | AC | 26 ms
7,936 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | AC | 1 ms
6,940 KB |
testcase_05 | AC | 1 ms
6,940 KB |
testcase_06 | AC | 1 ms
6,940 KB |
testcase_07 | AC | 2 ms
6,944 KB |
testcase_08 | WA | - |
testcase_09 | AC | 2 ms
6,944 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | AC | 2 ms
6,940 KB |
testcase_13 | AC | 2 ms
6,944 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 1 ms
6,944 KB |
testcase_17 | AC | 1 ms
6,940 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | AC | 1 ms
6,940 KB |
testcase_22 | AC | 2 ms
6,944 KB |
testcase_23 | AC | 2 ms
6,944 KB |
testcase_24 | WA | - |
コンパイルメッセージ
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 = solve <$> f >>= mapM_ putStrLn where f = map read <$> words <$> getLine solve :: [Int] -> [String] solve [t, a, b] | mp < 0 = ["NO"] | a == 0 && b == 0 && t == 1 = ["NO"] | a == 0 && b == 0 && even mp = ["YES"] ++ (take mp $ cycle [">", "<"]) | a == 0 && b == 0 = ["YES", ">", "^", "v<"] ++ (take (mp - 3) $ cycle [">", "<"]) | a == 0 && even mp = ["YES"] ++ (take mp $ cycle [">", "<"]) ++ replicate b "^" | a == 0 = ["YES", "^>", "<"] ++ (take (mp - 1) $ cycle [">", "<"]) ++ replicate (b - 1) "^" | b == 0 && even mp = ["YES"] ++ (take mp $ cycle [">", "<"]) ++ replicate a ">" | b == 0 = ["YES", "^>", "v"] ++ (take (mp - 1) $ cycle [">", "<"]) ++ replicate (a - 1) ">" | otherwise = ["YES"] ++ take (mp `div` 2 * 2) (cycle [">", "<"]) ++ (if even mp then ["^>"] else [">","^"]) ++ replicate (min a b - 1) "^>" ++ (if a > b then replicate (a - b) ">" else replicate (b - a) "^") where mp = t - min a b - abs (a - b)