結果

問題 No.227 簡単ポーカー
ユーザー go_boardwalkgo_boardwalk
提出日時 2017-04-02 08:46:44
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 622 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 11,872 KB
最終ジャッジ日時 2023-09-22 06:33:10
合計ジャッジ時間 1,795 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
11,680 KB
testcase_01 AC 19 ms
11,776 KB
testcase_02 AC 19 ms
11,800 KB
testcase_03 AC 19 ms
11,716 KB
testcase_04 AC 19 ms
11,584 KB
testcase_05 AC 19 ms
11,800 KB
testcase_06 AC 19 ms
11,672 KB
testcase_07 AC 19 ms
11,872 KB
testcase_08 AC 19 ms
11,676 KB
testcase_09 AC 19 ms
11,840 KB
testcase_10 AC 19 ms
11,652 KB
testcase_11 AC 19 ms
11,544 KB
testcase_12 AC 19 ms
11,656 KB
testcase_13 AC 19 ms
11,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define n (append (sort (map string->number (string-split (read-line) " "))) '(0)))

(print
 ((lambda (cl)
   (cond ((= cl 11) "FULL HOUSE")
         ((= cl 10) "THREE CARD")
         ((= cl 2) "TWO PAIR")
         ((= cl 1) "ONE PAIR")
         (else "NO HAND")))
  (fold + 0 ((lambda (n)
   (let loop ((n n) (c '()) (ntmp 0) (csum 0))
     (cond ((null? n) c)
           ((= ntmp (car n))
            (cond ((= csum 0) (loop (cdr n) c (car n) 1))
                  ((= csum 1) (loop (cdr n) c (car n) 10))
                  (else '(0))));FOUR CARD以上
            (else (loop (cdr n) (cons csum c) (car n) 0))))) n))))
0