結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-10-23 04:01:20 |
| 言語 | Common Lisp (sbcl 2.6.7) |
| 結果 |
AC
不安定
|
| 実行時間 | 6 ms / 5,000 ms |
| + 291µs | |
| コード長 | 519 bytes |
| 記録 | |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 28,032 KB |
| 実行使用メモリ | 19,840 KB |
| 最終ジャッジ日時 | 2026-09-19 03:38:16 |
| 合計ジャッジ時間 | 1,888 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 19 SEP 2026 03:38:14 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.061
ソースコード
(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