結果

問題 No.740 幻の木
ユーザー _Clay_____Clay____
提出日時 2018-10-07 15:30:14
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 183 ms / 2,000 ms
コード長 784 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 6,940 KB
実行使用メモリ 16,000 KB
最終ジャッジ日時 2024-04-20 18:14:36
合計ジャッジ時間 1,021 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
15,872 KB
testcase_01 AC 22 ms
15,872 KB
testcase_02 AC 21 ms
15,872 KB
testcase_03 AC 22 ms
15,872 KB
testcase_04 AC 21 ms
15,872 KB
testcase_05 AC 21 ms
16,000 KB
testcase_06 AC 183 ms
16,000 KB
testcase_07 AC 22 ms
15,872 KB
testcase_08 AC 21 ms
15,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(letrec* ((n (read))
          (m (read))
          (p (read))
          (q (read))
          (r (make-vector 12 1))
          (r-init (lambda (i j)
                          (unless (> i j)
                                  (begin 
                                    (set! (~ r (- i 1)) 2)
                                    (r-init (+ i 1) j)))))
          (check (lambda (rest a)
                         (let1 rest1 
                               (- rest 
                                  (* m 
                                     (~ r (remainder a 12)))) 
                               (if (<= rest1 0)
                                   (+ a 1)
                                   (check rest1 (+ a 1)))))))
         (r-init p (- (+ p q) 1))
         (print (check n 0)))

0