結果

問題 No.548 国士無双
ユーザー ducktailducktail
提出日時 2017-12-25 23:51:19
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 575 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 17,684 KB
最終ジャッジ日時 2023-10-17 16:24:30
合計ジャッジ時間 2,932 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
17,684 KB
testcase_01 AC 32 ms
17,684 KB
testcase_02 AC 33 ms
17,684 KB
testcase_03 AC 34 ms
17,684 KB
testcase_04 AC 33 ms
17,684 KB
testcase_05 AC 34 ms
17,684 KB
testcase_06 AC 34 ms
17,684 KB
testcase_07 AC 34 ms
17,684 KB
testcase_08 AC 33 ms
17,684 KB
testcase_09 AC 32 ms
17,684 KB
testcase_10 AC 32 ms
17,684 KB
testcase_11 AC 31 ms
17,684 KB
testcase_12 AC 32 ms
17,684 KB
testcase_13 AC 33 ms
17,684 KB
testcase_14 AC 32 ms
17,684 KB
testcase_15 AC 33 ms
17,684 KB
testcase_16 AC 33 ms
17,684 KB
testcase_17 AC 34 ms
17,684 KB
testcase_18 AC 32 ms
17,684 KB
testcase_19 AC 33 ms
17,684 KB
testcase_20 AC 33 ms
17,684 KB
testcase_21 AC 31 ms
17,684 KB
testcase_22 AC 33 ms
17,684 KB
testcase_23 AC 33 ms
17,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(use srfi-13)

(define (main args)
  (let ([s (read-line)]
        [tm (alist->tree-map (map cons (string->list "abcdefghijklm") (make-list 13 0)))])
    (string-for-each (lambda (c)
                       (cond [(char<=? #\a c #\m) (tree-map-update! tm c (cut + <> 1))]
                             [else #f])) s)
    (let ([n (length (filter (cut = <> 0) (tree-map-values tm)))])
      (cond [(zero? n) (for-each print (tree-map-keys tm))]
            [(= 1 n) (tree-map-for-each tm (lambda (k v) (if (zero? v) (print k))))]
            [else (print "Impossible")])))
  0)
0