結果

問題 No.293 4>7の世界
ユーザー vain0vain0
提出日時 2015-10-24 00:02:57
言語 F#
(.NET 7)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 717 bytes
コンパイル時間 7,792 ms
コンパイル使用メモリ 168,880 KB
実行使用メモリ 24,816 KB
最終ジャッジ日時 2023-08-28 21:51:26
合計ジャッジ時間 8,478 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
22,720 KB
testcase_01 AC 78 ms
22,684 KB
testcase_02 AC 79 ms
22,624 KB
testcase_03 AC 78 ms
22,688 KB
testcase_04 AC 77 ms
24,620 KB
testcase_05 AC 79 ms
24,576 KB
testcase_06 AC 78 ms
22,608 KB
testcase_07 AC 78 ms
22,668 KB
testcase_08 AC 77 ms
22,464 KB
testcase_09 AC 77 ms
22,692 KB
testcase_10 AC 77 ms
24,708 KB
testcase_11 AC 77 ms
22,636 KB
testcase_12 AC 78 ms
22,732 KB
testcase_13 AC 78 ms
22,768 KB
testcase_14 AC 77 ms
22,484 KB
testcase_15 AC 78 ms
24,576 KB
testcase_16 AC 78 ms
22,612 KB
testcase_17 AC 78 ms
22,652 KB
testcase_18 AC 77 ms
22,672 KB
testcase_19 AC 77 ms
22,628 KB
testcase_20 AC 77 ms
24,816 KB
testcase_21 AC 77 ms
22,536 KB
testcase_22 AC 78 ms
22,600 KB
testcase_23 AC 77 ms
22,616 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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)
            match (s, t) with
            | ('4', '7') -> x
            | ('7', '4') -> y
            | _ ->
                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