結果

問題 No.293 4>7の世界
ユーザー vain0vain0
提出日時 2015-10-23 22:40:29
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 705 bytes
コンパイル時間 4,826 ms
コンパイル使用メモリ 167,424 KB
実行使用メモリ 24,784 KB
最終ジャッジ日時 2023-09-30 07:14:32
合計ジャッジ時間 7,888 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
20,656 KB
testcase_01 AC 68 ms
22,556 KB
testcase_02 AC 66 ms
22,652 KB
testcase_03 AC 68 ms
22,680 KB
testcase_04 AC 66 ms
22,604 KB
testcase_05 AC 65 ms
22,552 KB
testcase_06 AC 70 ms
22,584 KB
testcase_07 WA -
testcase_08 AC 67 ms
24,640 KB
testcase_09 AC 66 ms
24,592 KB
testcase_10 AC 64 ms
22,768 KB
testcase_11 AC 67 ms
22,600 KB
testcase_12 AC 67 ms
24,608 KB
testcase_13 WA -
testcase_14 AC 65 ms
22,632 KB
testcase_15 AC 67 ms
22,768 KB
testcase_16 AC 65 ms
22,668 KB
testcase_17 AC 65 ms
22,676 KB
testcase_18 AC 71 ms
20,624 KB
testcase_19 AC 67 ms
22,652 KB
testcase_20 AC 66 ms
22,656 KB
testcase_21 AC 65 ms
22,664 KB
testcase_22 AC 67 ms
22,660 KB
testcase_23 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

/home/judge/data/code/Main.fs(6,7): warning FS0025: Incomplete pattern matches on this expression. For example, the value '[|_; _; _|]' may indicate a case not covered by the pattern(s).

ソースコード

diff #

open System
open System.Collections.Generic

[<EntryPoint>]
let main argv =
  let [| a; b |] = Console.ReadLine().Split(' ')

  let result =
    if a.Length <> b.Length then
      if a.Length > b.Length
      then a
      else b
    else
      let rec mymax (x: string) (y: string) =
          if x.Length = 0
          then ""
          else
            let s, ss = x.[0], x.Substring(1)
            let t, ts = y.[0], y.Substring(1)
            if (min s t = '4') && (max s t = '7') then
              "4" + mymax ss ts
            else if s <> t then
              if s > t then x else y
            else
              (string s) + mymax ss ts
      mymax a b

  printfn "%s" result

  //exit code
  0
0