結果

問題 No.52 よくある文字列の問題
ユーザー MiyamonYMiyamonY
提出日時 2019-09-08 00:31:13
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 24 ms / 5,000 ms
コード長 268 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 5,324 KB
実行使用メモリ 12,992 KB
最終ジャッジ日時 2023-09-09 21:53:43
合計ジャッジ時間 1,308 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
11,800 KB
testcase_01 AC 18 ms
11,700 KB
testcase_02 AC 20 ms
12,712 KB
testcase_03 AC 17 ms
11,888 KB
testcase_04 AC 24 ms
12,820 KB
testcase_05 AC 21 ms
12,812 KB
testcase_06 AC 24 ms
12,992 KB
testcase_07 AC 20 ms
12,436 KB
testcase_08 AC 18 ms
11,964 KB
testcase_09 AC 17 ms
11,860 KB
testcase_10 AC 17 ms
11,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (comb s)
  (cond ((null? s) '(()))
	(else
	 (append (map (lambda (x) (cons (car s) x)) (comb (cdr s)))
		 (map (lambda (x) (cons (last s) x)) (comb (drop-right s 1)))))))

(let* ((s (read-line)))
  (print (length (delete-duplicates (comb (string->list s))))))
0