結果

問題 No.201 yukicoderじゃんけん
ユーザー kuuso1
提出日時 2016-08-18 18:40:50
言語 F#
(F# 4.0)
結果
AC  
実行時間 88 ms / 5,000 ms
コード長 775 bytes
コンパイル時間 6,815 ms
コンパイル使用メモリ 196,692 KB
実行使用メモリ 32,640 KB
最終ジャッジ日時 2024-11-07 19:31:59
合計ジャッジ時間 9,379 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (232 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

open System
type Sol() =
    member this.Solve() = 
        
        let A = stdin.ReadLine().Split();
        let B = stdin.ReadLine().Split();
        
        let comp s t =
            if Seq.length s > (Seq.length t) then 1
            elif Seq.length s < (Seq.length t) then -1
            else
                let st = Seq.zip s t |> Seq.toArray
                let res = Seq.tryFindIndex (fun p -> (fst p) <> (snd p) ) st
                if Option.isNone res then 0 else (if fst (st.[Option.get res]) > (snd (st.[Option.get res])) then 1 else -1)
        
        let ans = match (comp A.[1] B.[1]) with
                  | 1 -> A.[0]
                  | -1 -> B.[0]
                  | _ -> "-1"
        
        printfn "%s" ans
let mySol = new Sol()
mySol.Solve()
0