結果
問題 | No.201 yukicoderじゃんけん |
ユーザー |
|
提出日時 | 2015-07-19 05:09:59 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 6 ms / 5,000 ms |
コード長 | 548 bytes |
コンパイル時間 | 1,862 ms |
コンパイル使用メモリ | 171,520 KB |
実行使用メモリ | 8,320 KB |
最終ジャッジ日時 | 2024-07-08 10:18:58 |
合計ジャッジ時間 | 1,883 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
コンパイルメッセージ
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 Data.Monoid main = getContents >>= putStrLn . solve . map (\x -> take (length x - 2) x) . lines solve :: [String] -> String solve [xs, ys] | cond == GT = sa | cond == LT = sb | otherwise = "-1" where cond = compare la lb `mappend` comp pa pb comp [] [] = mempty comp (a : as) (b : bs) = compare a b `mappend` comp as bs la = length pa lb = length pb f = takeWhile (/= ' ') g = dropWhile (/= ' ') sa = f xs sb = f ys pa = g xs pb = g ys