結果
問題 | No.188 HAPPY DAY |
ユーザー |
![]() |
提出日時 | 2017-07-09 17:07:10 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 91 ms / 1,000 ms |
コード長 | 610 bytes |
コンパイル時間 | 252 ms |
コンパイル使用メモリ | 7,680 KB |
実行使用メモリ | 12,160 KB |
最終ジャッジ日時 | 2024-12-31 01:51:14 |
合計ジャッジ時間 | 600 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
コンパイルメッセージ
Syntax OK
ソースコード
def judge(wmonth, wday, wcnt) #月と日の和が等しいか判定if wmonth == (wday / 10) + (wday % 10) thenwcnt += 1endreturn wcntendcnt = 0for month in 1..12 doif month == 2 then #2月for day in 1..28 docnt = judge(month, day, cnt)endelsif month == 4 or month == 6 or month == 9 or month == 11 then #4月,6月,9月,11月for day in 1..30 docnt = judge(month, day, cnt)endelse #それ以外の月for day in 1..31 docnt = judge(month, day, cnt)endendendputs cnt