結果

問題 No.293 4>7の世界
ユーザー shikatsusanshikatsusan
提出日時 2016-05-17 16:19:14
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 399 bytes
コンパイル時間 1,972 ms
コンパイル使用メモリ 172,032 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 22:49:11
合計ジャッジ時間 2,871 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 WA -
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 RE -
testcase_09 WA -
testcase_10 AC 1 ms
5,376 KB
testcase_11 RE -
testcase_12 AC 2 ms
5,376 KB
testcase_13 RE -
testcase_14 AC 1 ms
5,376 KB
testcase_15 WA -
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 WA -
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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:15:14: warning: [GHC-47082] [-Woperator-whitespace-ext-conflict]
    The prefix use of a ‘$’ would denote an untyped splice
      were the TemplateHaskell extension enabled.
    Suggested fix: Add whitespace after the ‘$’.
   |
15 |              $zip (reverse n++repeat '0') (reverse m ++repeat '0') 
   |              ^
[2 of 2] Linking a.out

ソースコード

diff #

main::IO()
main = do
  n:m:[]<-fmap words getLine
  let f1 ('4','7') = GT
      f1 ('7','4') = LT
      f1 (a,b) = a `compare` b
      henkan LT = m
      henkan GT = n
      cmp =(length n) `compare` (length m)

  putStrLn . henkan 
    $ if cmp /= EQ 
        then cmp
        else foldr (compare) EQ . take (length n) . map f1 
             $zip (reverse n++repeat '0') (reverse m ++repeat '0') 
0