結果

問題 No.2778 Is there Same letter?
ユーザー Lisp_Coder
提出日時 2024-06-15 13:44:02
言語 Common Lisp
(sbcl 2.5.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 334 ms
コンパイル使用メモリ 37,264 KB
実行使用メモリ 29,984 KB
最終ジャッジ日時 2024-06-15 13:44:06
合計ジャッジ時間 1,721 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 15 JUN 2024 01:44:02 PM):

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

ソースコード

diff #

(defun has-duplicate-char (s)
  (let ((char-set (make-hash-table :test 'equal)))
    (loop for char across s do
      (if (gethash char char-set)
          (return-from has-duplicate-char t)
          (setf (gethash char char-set) t)))
    nil))

(defun main ()
  (let ((n (read))
        (s (read-line)))
    (declare (ignore n))
    (if (has-duplicate-char s)
        (format t "Yes~%")
        (format t "No~%"))))

(main)
0