結果

問題 No.227 簡単ポーカー
コンテスト
ユーザー go_boardwalk
提出日時 2017-04-02 08:46:44
言語 Scheme
(Gauche-0.9.15)
コンパイル:
true
実行:
gosh _filename_
結果
AC  
実行時間 15 ms / 5,000 ms
+ 903µs
コード長 622 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 26 ms
コンパイル使用メモリ 5,888 KB
実行使用メモリ 16,384 KB
最終ジャッジ日時 2026-08-11 21:40:35
合計ジャッジ時間 1,854 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

(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