結果

問題 No.361 門松ゲーム2
ユーザー finefine
提出日時 2016-04-17 23:54:25
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 507 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-15 02:32:34
合計ジャッジ時間 3,564 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
12,416 KB
testcase_01 AC 91 ms
12,160 KB
testcase_02 AC 92 ms
12,032 KB
testcase_03 AC 89 ms
12,160 KB
testcase_04 AC 88 ms
12,160 KB
testcase_05 AC 88 ms
12,288 KB
testcase_06 AC 88 ms
12,416 KB
testcase_07 AC 93 ms
12,160 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 90 ms
12,160 KB
testcase_12 AC 91 ms
12,288 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 89 ms
12,288 KB
testcase_16 AC 89 ms
12,160 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 90 ms
12,288 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 91 ms
12,288 KB
testcase_26 WA -
testcase_27 AC 89 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

l, d = gets.split.map(&:to_i)
if d > 2
    puts ['matsu', 'kado'][((l - 1) / 5) % 2]
else
    if d == 1
        puts 'matsu'
    else
        if l % 3 == 0
            c = 0
            while l > 3
                x = (l - 3) / 3
                if x % 3 == 0
                    l = x
                else
                    l = x + 3 - x % 3
                end
                c += 1
            end
            puts ['matsu', 'kado'][c % 2]
        else
            puts 'matsu'
        end
    end
end
0