結果

問題 No.2314 Backflip
コンテスト
ユーザー Common Lisp
提出日時 2024-11-07 20:07:28
言語 Common Lisp
(sbcl 2.6.3)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 330 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,060 ms
コンパイル使用メモリ 33,684 KB
実行使用メモリ 30,104 KB
最終ジャッジ日時 2026-05-08 03:42:01
合計ジャッジ時間 2,122 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 08 MAY 2026 03:41:58 AM):

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

ソースコード

diff #
raw source code

(defun toggle-last-bit (s)
  (if (string= (subseq s (1- (length s))) "0")
      (concatenate 'string (subseq s 0 (1- (length s))) "1")
      (concatenate 'string (subseq s 0 (1- (length s))) "0")))

(defun main (&rest argv)
  (declare (ignorable argv))
  (let* ((s (read-line)))
    (format t "~a~%" (toggle-last-bit s))))

(main)
0