結果
| 問題 |
No.188 HAPPY DAY
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-09 19:39:10 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 368 bytes |
| コンパイル時間 | 63 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-12-16 04:13:30 |
| 合計ジャッジ時間 | 615 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 |
コンパイルメッセージ
Syntax OK
ソースコード
require 'date'
def suuziwa(str)
if (str.length == 1)
return str.to_i
end
if (str.length == 2)
return str[0].to_i + str[1].to_i
end
end
head = Date.new(2015, 1, 31)
tail = Date.new(2015, 12, 31)
i = 0
(head..tail).each { |date|
m = date.strftime('%m')
d = date.strftime('%d')
if (m.to_i == suuziwa(d))
i = i + 1
end
}
puts i.to_s + "\r\n"