結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-10-23 04:01:20 |
| 言語 | Common Lisp (sbcl 2.6.3) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 5,000 ms |
| コード長 | 519 bytes |
| 記録 | |
| コンパイル時間 | 123 ms |
| コンパイル使用メモリ | 35,544 KB |
| 実行使用メモリ | 32,016 KB |
| 最終ジャッジ日時 | 2026-05-05 18:44:41 |
| 合計ジャッジ時間 | 1,550 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 05 MAY 2026 06:44:38 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.008
ソースコード
(defun main (&rest argv)
(declare (ignorable argv))
(let* ((s (read-line))
(a (parse-integer s)))
(dotimes (i (length s))
(dotimes (j i)
(let* ((prefix (subseq s 0 j))
(mid1 (subseq s i (1+ i)))
(mid2 (subseq s (1+ j) i))
(mid3 (subseq s j (1+ j)))
(suffix (subseq s (1+ i)))
(b (parse-integer (concatenate 'string prefix mid1 mid2 mid3 suffix))))
(setf a (max a b)))))
(format t "~d~%" a)))
(main)
Common Lisp