結果

問題 No.281 門松と魔法(1)
ユーザー yusakayusaka
提出日時 2015-09-23 15:16:12
言語 Scheme
(Gauche-0.9.14)
結果
WA  
実行時間 -
コード長 605 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 5,504 KB
実行使用メモリ 17,408 KB
最終ジャッジ日時 2024-04-24 11:52:59
合計ジャッジ時間 3,043 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
17,024 KB
testcase_01 AC 28 ms
17,024 KB
testcase_02 WA -
testcase_03 AC 28 ms
17,152 KB
testcase_04 AC 28 ms
17,024 KB
testcase_05 AC 21 ms
15,872 KB
testcase_06 AC 29 ms
17,024 KB
testcase_07 AC 27 ms
17,024 KB
testcase_08 AC 28 ms
17,024 KB
testcase_09 AC 29 ms
17,152 KB
testcase_10 AC 27 ms
17,024 KB
testcase_11 AC 28 ms
17,152 KB
testcase_12 AC 27 ms
17,152 KB
testcase_13 AC 28 ms
17,152 KB
testcase_14 AC 21 ms
16,000 KB
testcase_15 AC 28 ms
17,024 KB
testcase_16 AC 21 ms
16,000 KB
testcase_17 AC 29 ms
17,152 KB
testcase_18 AC 21 ms
16,000 KB
testcase_19 AC 31 ms
17,152 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 22 ms
15,872 KB
testcase_23 AC 30 ms
17,280 KB
testcase_24 AC 21 ms
15,872 KB
testcase_25 WA -
testcase_26 AC 27 ms
17,024 KB
testcase_27 AC 28 ms
17,152 KB
testcase_28 AC 27 ms
17,152 KB
testcase_29 AC 22 ms
15,872 KB
testcase_30 WA -
testcase_31 RE -
testcase_32 AC 21 ms
15,872 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 28 ms
17,024 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 21 ms
15,872 KB
testcase_45 WA -
testcase_46 AC 21 ms
15,872 KB
testcase_47 AC 27 ms
17,024 KB
testcase_48 AC 21 ms
15,872 KB
testcase_49 AC 20 ms
15,872 KB
testcase_50 RE -
testcase_51 WA -
testcase_52 AC 20 ms
16,000 KB
testcase_53 AC 20 ms
15,872 KB
testcase_54 WA -
testcase_55 AC 28 ms
17,024 KB
testcase_56 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env gosh

(define (can-resolve? lst)
  (if (not (= 0 (list-ref lst 1)))
      #t
      (if (or (= 0 (list-ref lst 0))
              (= 0 (list-ref lst 2)))
          #f
          #t)))

(define (count d lst)
  (let ((d12 (- (cadr lst) (car lst)))
        (d23 (- (cadr lst) (caddr lst))))
    (if (positive? (* d12 d23))
        0
        (+ 1
           (div (min (abs d12) (abs d23)) d)))))

(let* ((d (read))
      (h1 (read))
      (h2 (read))
      (h3 (read))
      (hlist `(,h1 ,h2 ,h3)))
  (if (not (can-resolve? hlist))
      (display -1)
      (display (count d hlist)))
  (newline))
0