結果
問題 | No.188 HAPPY DAY |
ユーザー |
|
提出日時 | 2020-09-09 19:40:23 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 92 ms / 1,000 ms |
コード長 | 374 bytes |
コンパイル時間 | 198 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-12-16 04:14:57 |
合計ジャッジ時間 | 621 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
コンパイルメッセージ
Syntax OK
ソースコード
require "date"module Mrefine Integer dodef sum# to_s.chars.map(&:to_i).sumself / 10 + self % 10endendrefine Date dodef happy_day?month == day.sumendendendusing Mputs (Date.new(2015, 1, 1)..Date.new(2015, 12, 31)).select(&:happy_day?).count# puts (Date.new(2015, 1, 1)..Date.new(2015, 12, 31)).count(&:happy_day?)