結果

問題 No.264 じゃんけん
ユーザー chike_pluschike_plus
提出日時 2019-03-19 09:36:41
言語 F#
(F# 4.0)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 377 bytes
コンパイル時間 5,062 ms
コンパイル使用メモリ 162,156 KB
実行使用メモリ 22,352 KB
最終ジャッジ日時 2023-10-11 13:40:37
合計ジャッジ時間 5,745 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
22,180 KB
testcase_01 AC 58 ms
22,264 KB
testcase_02 AC 56 ms
22,320 KB
testcase_03 AC 57 ms
22,160 KB
testcase_04 AC 57 ms
22,236 KB
testcase_05 AC 59 ms
22,156 KB
testcase_06 AC 57 ms
22,064 KB
testcase_07 AC 58 ms
22,352 KB
testcase_08 AC 56 ms
20,120 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(4,10): warning FS0025: Incomplete pattern matches on this expression. For example, the value '(_,3)' may indicate a case not covered by the pattern(s).

ソースコード

diff #

open System

let ( |Won|Lost|Drew| ) (x,y) = 
  match (x , y) with
  | 0 , 1 | 1 , 2 | 2, 0 -> Won
  | 0 , 2 | 1 , 0 | 2, 1 -> Lost
  | 0 , 0 | 1 , 1 | 2, 2 -> Drew

let n, k = Console.ReadLine().Split(' ')
          |> fun s -> (s.[0] |> int, s.[1] |> int)

match (n, k) with
| Won -> Console.WriteLine "Won"
| Lost-> Console.WriteLine "Lost"
| Drew-> Console.WriteLine "Drew"
0