結果

問題 No.2737 Compound Word
ユーザー Lisp_CoderLisp_Coder
提出日時 2024-04-23 01:53:07
言語 Common Lisp
(sbcl 2.3.8)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 559 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 37,380 KB
実行使用メモリ 30,244 KB
最終ジャッジ日時 2024-04-23 01:53:11
合計ジャッジ時間 2,066 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
25,896 KB
testcase_01 AC 11 ms
27,936 KB
testcase_02 AC 10 ms
26,024 KB
testcase_03 AC 9 ms
25,896 KB
testcase_04 AC 10 ms
27,984 KB
testcase_05 AC 10 ms
27,724 KB
testcase_06 AC 10 ms
26,028 KB
testcase_07 AC 10 ms
26,024 KB
testcase_08 AC 12 ms
30,012 KB
testcase_09 AC 99 ms
28,104 KB
testcase_10 AC 97 ms
26,152 KB
testcase_11 AC 10 ms
27,808 KB
testcase_12 AC 10 ms
27,856 KB
testcase_13 AC 11 ms
27,936 KB
testcase_14 AC 10 ms
27,856 KB
testcase_15 AC 10 ms
27,980 KB
testcase_16 AC 15 ms
26,024 KB
testcase_17 AC 24 ms
26,280 KB
testcase_18 AC 23 ms
28,360 KB
testcase_19 AC 10 ms
29,864 KB
testcase_20 AC 25 ms
26,024 KB
testcase_21 AC 16 ms
30,244 KB
testcase_22 AC 11 ms
26,280 KB
testcase_23 AC 12 ms
26,028 KB
testcase_24 AC 18 ms
26,024 KB
testcase_25 AC 11 ms
26,156 KB
testcase_26 AC 76 ms
26,024 KB
testcase_27 AC 10 ms
28,112 KB
testcase_28 AC 101 ms
30,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 23 APR 2024 01:53:07 AM):

; wrote /home/judge/data/code/Main.fasl
; compilation finished in 0:00:00.160

ソースコード

diff #

(defun count-unique-concatenations (string-list)
  (let ((result '()))
    (loop for i from 0 below (length string-list) do
      (loop for j from 0 below (length string-list) do
        (when (not (= i j))
          (let ((combined (concatenate 'string (nth i string-list) (nth j string-list))))
            (pushnew combined result :test 'equal)))))
    (length result)))

(defun main ()
  (let ((n (read)))
    (let ((string-list (loop for i from 0 below n collect (read-line))))
      (format t "~d~%" (count-unique-concatenations string-list)))))

(main)
0