結果
| 問題 | No.2737 Compound Word |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-23 01:53:07 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
AC
|
| 実行時間 | 101 ms / 2,000 ms |
| コード長 | 559 bytes |
| コンパイル時間 | 942 ms |
| コンパイル使用メモリ | 27,776 KB |
| 実行使用メモリ | 22,272 KB |
| 最終ジャッジ日時 | 2024-10-15 01:09:26 |
| 合計ジャッジ時間 | 2,551 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 15 OCT 2024 01:09:23 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.095
ソースコード
(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)