結果
| 問題 |
No.8083 12歳
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-01 20:49:35 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 391 bytes |
| コンパイル時間 | 268 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,544 KB |
| 最終ジャッジ日時 | 2024-12-21 04:28:45 |
| 合計ジャッジ時間 | 46,621 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 324 WA * 42 |
コンパイルメッセージ
Syntax OK
ソースコード
require "date"
Y, N, D = gets.split.map(&:to_i)
t0 = DateTime.new(Y, 4, 1, 20, 0, 0)
t1 = t0 + D
a = 0
N.times do |i|
d = t0.prev_year + 1 + i
next if d.month == 2 and d.day == 29 and !t1.leap?
a += 1 if t1 < d.next_year
end
b = 0
N.times do |i|
d = t0 - i
next if d.month == 2 and d.day == 29 and !t1.leap?
b += 1 if t1 < d.next_year
end
puts [a, b].minmax * " "