結果

問題 No.2778 Is there Same letter?
コンテスト
ユーザー NixOS_and_Gentoo
提出日時 2024-06-15 13:44:02
言語 Common Lisp
(sbcl 2.6.3)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
AC  
実行時間 5 ms / 2,000 ms
+ 411µs
コード長 426 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 40 ms
コンパイル使用メモリ 28,032 KB
実行使用メモリ 19,712 KB
最終ジャッジ日時 2026-07-26 13:17:48
合計ジャッジ時間 1,144 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 26 JUL 2026 01:17:46 PM):

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

ソースコード

diff #
raw source code

(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