結果
| 問題 | No.188 HAPPY DAY | 
| コンテスト | |
| ユーザー |  Common Lisp | 
| 提出日時 | 2024-10-08 14:38:56 | 
| 言語 | Common Lisp (sbcl 2.5.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 11 ms / 1,000 ms | 
| コード長 | 656 bytes | 
| コンパイル時間 | 133 ms | 
| コンパイル使用メモリ | 27,520 KB | 
| 実行使用メモリ | 21,760 KB | 
| 最終ジャッジ日時 | 2024-10-08 14:38:57 | 
| 合計ジャッジ時間 | 609 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 1 | 
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 08 OCT 2024 02:38:56 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.047
ソースコード
; 月の値 = (日の値 / 10) + (日の値 % 10)
; となる日を毎月カウントし
; 通年で足し合わせる 答えは 30
(defvar *2015days* #(0 31 28 31 30 31 30 31 31 30 31 30 31))
(defun main ()
  (princ
    ; from i to j [i, i+1, i+2, ..., j] の範囲を繰り返す
    (loop for i from 1 to 12
          for d = (aref *2015days* i)
          ; sum 以下の値を足し合わせたものを返す
          sum (loop for j from 1 to d
                    ; count 条件を満たす要素数を返す
                    count (= i (+ (floor j 10) (mod j 10))))))
  (terpri))
(main)
; (defun main ()
;   (princ 30)
;   (terpri))
; (main)
            
            
            
        