結果
問題 | No.201 yukicoderじゃんけん |
ユーザー | kuuso1 |
提出日時 | 2016-08-18 18:40:50 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 89 ms / 5,000 ms |
コード長 | 775 bytes |
コンパイル時間 | 4,025 ms |
コンパイル使用メモリ | 168,292 KB |
実行使用メモリ | 25,272 KB |
最終ジャッジ日時 | 2023-08-07 15:16:56 |
合計ジャッジ時間 | 6,236 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 86 ms
23,012 KB |
testcase_01 | AC | 87 ms
25,168 KB |
testcase_02 | AC | 84 ms
23,060 KB |
testcase_03 | AC | 77 ms
22,876 KB |
testcase_04 | AC | 77 ms
24,872 KB |
testcase_05 | AC | 87 ms
25,172 KB |
testcase_06 | AC | 86 ms
25,272 KB |
testcase_07 | AC | 87 ms
20,980 KB |
testcase_08 | AC | 87 ms
25,160 KB |
testcase_09 | AC | 87 ms
23,184 KB |
testcase_10 | AC | 77 ms
24,900 KB |
testcase_11 | AC | 86 ms
25,060 KB |
testcase_12 | AC | 86 ms
23,196 KB |
testcase_13 | AC | 88 ms
23,140 KB |
testcase_14 | AC | 76 ms
20,664 KB |
testcase_15 | AC | 77 ms
22,924 KB |
testcase_16 | AC | 88 ms
23,088 KB |
testcase_17 | AC | 87 ms
23,200 KB |
testcase_18 | AC | 89 ms
23,200 KB |
testcase_19 | AC | 87 ms
23,364 KB |
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0 Copyright (c) Microsoft Corporation. All Rights Reserved.
ソースコード
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()