結果
| 問題 | No.547 未知の言語 |
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-10-10 20:31:41 |
| 言語 | Common Lisp (sbcl 2.6.7) |
| 結果 |
AC
不安定
|
| 実行時間 | 6 ms / 2,000 ms |
| + 260µs | |
| コード長 | 1,298 bytes |
| 記録 | |
| コンパイル時間 | 988 ms |
| コンパイル使用メモリ | 27,392 KB |
| 実行使用メモリ | 20,608 KB |
| 最終ジャッジ日時 | 2026-09-13 10:54:24 |
| 合計ジャッジ時間 | 2,985 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 13 SEP 2026 10:54:20 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.062
ソースコード
; (read) の読み込みによってシンボルの大文字小文字の区別が失われるので
; デフォルトで :upcase になっている readtable を更新しなければいけない
; (*readtable* (copy-readtable nil))
; で readtable のコピーをとっておき
; (setf (readtable-case *readtable*) :preserve)
; で区別をつけるようにする
; https://cl-community-spec.github.io/pages/Effect-of-Readtable-Case-on-the-Lisp-Reader.html
; https://cl-community-spec.github.io/pages/Examples-of-Effect-of-Readtable-Case-on-the-Lisp-Reader.html
(defun main (&rest argv)
(declare (ignorable argv))
(let* ((n (read))
(*readtable* (copy-readtable nil)))
; https://cl-community-spec.github.io/pages/readtable_002dcase.html
(setf (readtable-case *readtable*) :preserve)
; ここで読み込まれるシンボルは大文字小文字の区別がついている
(let ((sn (loop repeat n collect (read)))
(tn (loop repeat n collect (read))))
(loop for i below n
for a in sn
for b in tn
while (eql a b)
finally (princ (1+ i))
(terpri)
(princ a)
(terpri)
(princ b)
(terpri)))))
(main)
Common Lisp