結果

問題 No.87 Advent Calendar Problem
ユーザー ducktailducktail
提出日時 2018-09-05 18:02:31
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 402 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 14,524 KB
最終ジャッジ日時 2023-08-09 20:02:12
合計ジャッジ時間 2,769 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
14,292 KB
testcase_01 AC 25 ms
14,404 KB
testcase_02 AC 25 ms
14,484 KB
testcase_03 AC 24 ms
14,072 KB
testcase_04 AC 24 ms
14,080 KB
testcase_05 AC 25 ms
14,388 KB
testcase_06 AC 26 ms
14,288 KB
testcase_07 AC 26 ms
14,392 KB
testcase_08 AC 26 ms
14,316 KB
testcase_09 AC 26 ms
14,164 KB
testcase_10 AC 26 ms
14,264 KB
testcase_11 AC 26 ms
14,076 KB
testcase_12 AC 25 ms
14,440 KB
testcase_13 AC 25 ms
14,404 KB
testcase_14 AC 26 ms
14,264 KB
testcase_15 AC 26 ms
14,404 KB
testcase_16 AC 25 ms
14,300 KB
testcase_17 AC 26 ms
14,368 KB
testcase_18 AC 25 ms
14,360 KB
testcase_19 AC 25 ms
14,356 KB
testcase_20 AC 26 ms
14,348 KB
testcase_21 AC 26 ms
14,524 KB
testcase_22 AC 25 ms
14,012 KB
testcase_23 AC 25 ms
14,148 KB
testcase_24 AC 25 ms
14,064 KB
testcase_25 AC 26 ms
14,388 KB
testcase_26 AC 26 ms
14,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(use srfi-19)

(define (main args)
  (let* [(n (read))
         (c4 (quotient (- n 2014) 400))
         (rsy (+ 2015 (* 400 c4)))
         (d4 (days-wednesday 2015 2414))]
    (print (+ (* c4 d4) (days-wednesday rsy n))))
  0)

(define (days-wednesday sy ey)
  (length
   (filter (^y (= y 3))
           (map (^y (date-week-day (make-date 0 0 0 0 23 7 y 0)))
                (iota (- ey sy -1) sy)))))
0