結果

問題 No.46 はじめのn歩
ユーザー arito_asuarito_asu
提出日時 2020-05-12 15:03:06
言語 Common Lisp
(sbcl 2.3.8)
結果
RE  
実行時間 -
コード長 394 bytes
コンパイル時間 1,785 ms
コンパイル使用メモリ 32,448 KB
実行使用メモリ 35,604 KB
最終ジャッジ日時 2024-09-13 12:28:13
合計ジャッジ時間 1,835 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 13 SEP 2024 12:28:10 PM):

; file: /home/judge/data/code/Main.lisp
; in: SETQ M
;     (MOD B A)
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::A

; in: SETQ D
;     (FLOOR B A)
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::A

; in: SETQ A
;     (SETQ A (PARSE-INTEGER (FIRST X)))
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::A

; in: SETQ M
;     (MOD B A)
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::B

; in: SETQ D
;     (FLOOR B A)
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::B

; in: SETQ B
;     (SETQ B (PARSE-INTEGER (SECOND X)))
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::B

; in: IF (> M 0)
;     (+ D 1)
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::D

;     (SETQ D (+ D 1))
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::D

; in: SETQ D
;     (SETQ D (FLOOR B A))
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::D

; 
; caught WARNING:
;   3 more uses of undefined variable D


; file: /home/judge/data/code/Main.lisp
; in: IF (> M 0)
;     (> M 0)
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::M

; in: SETQ M
;     (SETQ M (MOD B A))
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::M

; in: SETQ B
;     (SECOND X)
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::X

; in: SETQ A
;     (FIRST X)
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::X

; in: SETQ X
;     (SETQ X (SPLIT " " (READ-LINE)))
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::X
; 
; compilation unit finished
;   Undefined variables:
;     A B D M X
;   caught 15 WARNING conditions

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

ソースコード

diff #

(defun split (x str)
  (let ((pos (search x str))
        (size (length x)))
    (if pos
      (cons (subseq str 0 pos)
            (split x (subseq str (+ pos size))))
      (list str))))
      
(setq x (split " " (read-line)))

(setq a (parse-integer (first x)))
(setq b (parse-integer (second x)))

(setq d (floor b a))
(setq m (mod b a))

(if (> m 0)(setq d (+ d 1))(setq d d))
(format t d)
0