結果

問題 No.293 4>7の世界
ユーザー taktak
提出日時 2019-06-26 01:03:43
言語 F#
(F# 4.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 896 bytes
コンパイル時間 3,718 ms
コンパイル使用メモリ 166,996 KB
実行使用メモリ 24,428 KB
最終ジャッジ日時 2023-09-05 19:18:15
合計ジャッジ時間 6,558 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
24,340 KB
testcase_01 AC 61 ms
22,444 KB
testcase_02 AC 62 ms
22,288 KB
testcase_03 AC 62 ms
24,416 KB
testcase_04 AC 62 ms
24,368 KB
testcase_05 AC 62 ms
22,292 KB
testcase_06 AC 61 ms
22,316 KB
testcase_07 AC 62 ms
22,224 KB
testcase_08 AC 62 ms
24,428 KB
testcase_09 AC 62 ms
24,428 KB
testcase_10 AC 60 ms
22,316 KB
testcase_11 AC 61 ms
20,272 KB
testcase_12 AC 62 ms
20,420 KB
testcase_13 AC 62 ms
20,328 KB
testcase_14 AC 62 ms
22,240 KB
testcase_15 AC 63 ms
22,444 KB
testcase_16 AC 61 ms
22,288 KB
testcase_17 AC 62 ms
24,272 KB
testcase_18 AC 63 ms
22,452 KB
testcase_19 AC 63 ms
24,280 KB
testcase_20 AC 60 ms
20,248 KB
testcase_21 AC 61 ms
24,212 KB
testcase_22 AC 62 ms
22,380 KB
testcase_23 AC 62 ms
20,332 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

module Yuki

open System

let solve a b =
    let rec isA ax bx =
        match ax, bx with
        | 7L :: _, 4L :: _ ->
            false
        | 4L :: _, 7L :: _ ->
            true
        | a :: ax, b :: bx ->
            if a > b then true
            elif a < b then false
            else isA ax bx
        | ax, [] -> failwith ""
        | [], bx -> failwith ""
        
    let a' = string a
    let b' = string b
    if a'.Length > b'.Length then
        a
    elif a'.Length < b'.Length then
        b
    else
        let a'' = a'.ToCharArray() |> Array.map (string>>int64) |> Array.toList
        let b'' = b'.ToCharArray() |> Array.map (string>>int64) |> Array.toList
        if isA a'' b'' then
            a
        else
            b
    

let A, B = 
    let t = 
        Console.ReadLine().Split() 
        |> Array.map int64
    t.[0], t.[1]

solve A B
|> Console.WriteLine
0