結果

問題 No.46 はじめのn歩
ユーザー arito_asuarito_asu
提出日時 2020-05-12 15:03:52
言語 Common Lisp
(sbcl 2.3.8)
結果
AC  
実行時間 11 ms / 5,000 ms
コード長 391 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 36,900 KB
実行使用メモリ 29,880 KB
最終ジャッジ日時 2024-09-13 12:29:41
合計ジャッジ時間 880 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
25,768 KB
testcase_01 AC 10 ms
25,640 KB
testcase_02 AC 11 ms
29,880 KB
testcase_03 AC 9 ms
25,640 KB
testcase_04 AC 10 ms
25,768 KB
testcase_05 AC 9 ms
27,848 KB
testcase_06 AC 9 ms
25,768 KB
testcase_07 AC 10 ms
25,764 KB
testcase_08 AC 10 ms
25,636 KB
testcase_09 AC 10 ms
25,640 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 13 SEP 2024 12:29:38 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.006

ソースコード

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))
(princ d)
0