結果
| 問題 | No.188 HAPPY DAY | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-06-21 21:22:34 | 
| 言語 | Ruby (3.4.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 86 ms / 1,000 ms | 
| コード長 | 401 bytes | 
| コンパイル時間 | 127 ms | 
| コンパイル使用メモリ | 7,552 KB | 
| 実行使用メモリ | 12,160 KB | 
| 最終ジャッジ日時 | 2024-10-14 16:18:41 | 
| 合計ジャッジ時間 | 740 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 1 | 
コンパイルメッセージ
Syntax OK
ソースコード
def count_happy_day_in_2015
  last_day_of_month = [31,28,31,30,31,30,31,31,30,31,30,31]
  counter = 0
  1.upto(12) do |month|
    0.upto(month) do |upper_digit|
      lower_digit = month - upper_digit
      break if upper_digit * 10 + lower_digit > last_day_of_month[month-1]
      if (0..9).include?(lower_digit)
        counter += 1
      end
    end
  end
  counter
end
p count_happy_day_in_2015
            
            
            
        