結果
| 問題 | No.2778 Is there Same letter? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-15 13:44:02 |
| 言語 | Common Lisp (sbcl 2.6.1) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 2,000 ms |
| コード長 | 426 bytes |
| 記録 | |
| コンパイル時間 | 105 ms |
| コンパイル使用メモリ | 35,060 KB |
| 実行使用メモリ | 30,740 KB |
| 最終ジャッジ日時 | 2026-03-06 03:16:21 |
| 合計ジャッジ時間 | 864 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 06 MAR 2026 03:16:17 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.040
ソースコード
(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)