結果
| 問題 |
No.188 HAPPY DAY
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-21 22:00:14 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 93 ms / 1,000 ms |
| コード長 | 419 bytes |
| コンパイル時間 | 47 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,160 KB |
| 最終ジャッジ日時 | 2024-10-14 17:08:20 |
| 合計ジャッジ時間 | 621 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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|
month.downto(0) do |upper_digit|
next if upper_digit > 3
lower_digit = month - upper_digit
break if lower_digit > 9
next if upper_digit * 10 + lower_digit > last_day_of_month[month-1]
counter += 1
end
end
counter
end
p count_happy_day_in_2015